From patchwork Fri May 26 02:12:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 685919 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp677318wrt; Thu, 25 May 2023 19:13:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OZW5+XWe70JdU7ZZAskS6NkEsi6XPjNnPUn8dxfQnvm3CjT5cQcLWmtCjXJflULm3vgBM X-Received: by 2002:a05:620a:4894:b0:75b:23a0:d9c7 with SMTP id ea20-20020a05620a489400b0075b23a0d9c7mr707293qkb.29.1685067223469; Thu, 25 May 2023 19:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685067223; cv=none; d=google.com; s=arc-20160816; b=jg7ytjtPXsR95WEdCp/FoYNpsclDOp8TaXcChD/YbWx6E2/4LNgnfsTwn/+lGaxXGG I1Aj+qOhO7rgUlJlQ4mWwtadhydKaKZwNKidsfAISjhRTgYcGS+juE0l6Aa+vf31aDqZ oQ3DYWAy59hpxefwZat3Jud4akuKPBd4sRW5SmEF0REw9Zusf95s3ACrx8iVK5677zhv HvZBYCSBIy0XIXM4iVJ1lyogtU0qMdlXi7Z1Cfi1nu0ZcBLDGfe2wvAGJtxbYh02hElD XVJybw5FrDPzBliq7Q6ZLRaX3SGFCCI8iVEf6UzTMKrkQBHAwfv+50vm8RXjzCSfr0oH 0AWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lIrHyv+mgsH/mPrNHKwXz9RtxdnCU4H2P2z5QfKtbdI=; b=LG0LHVAhnAbyxgpbQbp96hY+o9m+S+POn6ZvCM+CMbLh2yYy3ctMCXglWbcqTMZfCm Ep81IyIpHg9aX/NwDCImiRBp6sZETbsYuzmZj2qNa7cVH2GjJD8CikD7OqsjjgHKbC5m Y9p2e6rhlDyi4dFPAEABlFwZHCmH7UWeguHZ6jf6tZqAgIu6ATeHO1QU1AeMW4fUKSS2 GfDOf9aaiI9GWy2ipocST1ZyiPagPS5ZZkbqgcWUR1G7I8U7HGi4x+/pAteJHI+PIT4R qhbunV40Thnx5QOXx9qIU1ksScf7clGbugqAO6IDlXqkjn9JdsrtzFBvT6ShNjTMXBy2 Dg3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=foZhuYfC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d15-20020a05620a136f00b0075b3d4494ecsi1033294qkl.495.2023.05.25.19.13.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 May 2023 19:13:43 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=foZhuYfC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q2MwW-000262-4o; Thu, 25 May 2023 22:12:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q2MwU-00025U-SE for qemu-devel@nongnu.org; Thu, 25 May 2023 22:12:34 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q2MwS-0004se-Gu for qemu-devel@nongnu.org; Thu, 25 May 2023 22:12:33 -0400 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-253e0edc278so297240a91.3 for ; Thu, 25 May 2023 19:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1685067151; x=1687659151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lIrHyv+mgsH/mPrNHKwXz9RtxdnCU4H2P2z5QfKtbdI=; b=foZhuYfCxX6IZpZyS3sZiiS2zCZFzBIqOJx1vtRBVXdASiQi8+qrVY6otKUBDO+AJN cb0TnByRp9DDowAYjh1jLJZtmiQbY0YKznLMar8g5EVkVbTYZIink4hrEsiXqcDxHAl3 7PV/f49Ko8jyN/rnPSJZjlcyRuqZpOPwa1FxCqAgFvVYL7o35Pv2sX5kUg3yiLFTgpeR 466+tW7fHNBM2Xr4T8phcOXgBpPaJZh6vjo9N7fvXR9tkQTY7QRq5qv02LdnmhlqsUwX APy4avmLcINGdUUTLBzBcgcW4m/ZdEYuow4o5JrMGYp1GcwRMOnQDT6dCbnlbzVRzVAh hjcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685067151; x=1687659151; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lIrHyv+mgsH/mPrNHKwXz9RtxdnCU4H2P2z5QfKtbdI=; b=Aes2BxgXKyVITveZFDt6Lb1nnkMU7VI6tuuQ4u3s7r3wSC6bJXJoWapHkMULAOMLQW V9Z2sT+zOfjh2DiIzOtzvyHtlcR2wDO1yeh3ndHBqhlpVZywQ8GEpRU/dyLYBrL+hrtB 6pgJbQ6JZaQMKVy1UcN8VmvC4XjoAULSn3D1HfszxS5Ayk6RxPvB2iKp80TIb/5jt+D1 tRnhxGYkkjjyAKfseBmUGK8Qcg5aVOA+qSaYH0rwaLVv6rh9XUJCiXs+F4zZM8zuvgxg 0fRw4cFUJVBcIVvm2fg7N+0rBJV3iBwBpsXTGEewFgnpqf/HPhFfXkRFG0VyTK+2w0ss 9RxQ== X-Gm-Message-State: AC+VfDzKiFrxOL259BMZCcFbDZCEyqoeUDPSnHbIqUjGyW+XtDS1jlcg DWYcNSF3ILOQ2FyD4nkiXf2xvjyn7wIKK/bMHyA= X-Received: by 2002:a17:90a:ea85:b0:255:b1d9:a206 with SMTP id h5-20020a17090aea8500b00255b1d9a206mr706126pjz.22.1685067150878; Thu, 25 May 2023 19:12:30 -0700 (PDT) Received: from stoup.. ([2602:ae:1598:4c01:7ac5:31cc:3997:3a16]) by smtp.gmail.com with ESMTPSA id oe17-20020a17090b395100b0023a9564763bsm3594086pjb.29.2023.05.25.19.12.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 May 2023 19:12:30 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, pbonzini@redhat.com Subject: [PATCH v2 1/4] decodetree: Add --test-for-error Date: Thu, 25 May 2023 19:12:25 -0700 Message-Id: <20230526021228.1777917-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230526021228.1777917-1-richard.henderson@linaro.org> References: <20230526021228.1777917-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Invert the exit code, for use with the testsuite. Signed-off-by: Richard Henderson --- scripts/decodetree.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/decodetree.py b/scripts/decodetree.py index a03dc6b5e3..3f9f6876f7 100644 --- a/scripts/decodetree.py +++ b/scripts/decodetree.py @@ -35,6 +35,7 @@ formats = {} allpatterns = [] anyextern = False +testforerror = False translate_prefix = 'trans' translate_scope = 'static ' @@ -71,7 +72,7 @@ def error_with_file(file, lineno, *args): if output_file and output_fd: output_fd.close() os.remove(output_file) - exit(1) + exit(0 if testforerror else 1) # end error_with_file @@ -1286,11 +1287,12 @@ def main(): global bitop_width global variablewidth global anyextern + global testforerror decode_scope = 'static ' long_opts = ['decode=', 'translate=', 'output=', 'insnwidth=', - 'static-decode=', 'varinsnwidth='] + 'static-decode=', 'varinsnwidth=', 'test-for-error'] try: (opts, args) = getopt.gnu_getopt(sys.argv[1:], 'o:vw:', long_opts) except getopt.GetoptError as err: @@ -1319,6 +1321,8 @@ def main(): bitop_width = 64 elif insnwidth != 32: error(0, 'cannot handle insns of width', insnwidth) + elif o == '--test-for-error': + testforerror = True else: assert False, 'unhandled option' @@ -1417,6 +1421,7 @@ def main(): if output_file: output_fd.close() + exit(1 if testforerror else 0) # end main