From patchwork Tue Mar 12 17:03:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 160169 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp13394476jad; Tue, 12 Mar 2019 10:59:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzT0Ms/qoELp78B0qFyX5yn4SYdyPpCpZFRYyIc5q5VNoM9ZcCeYlkj6qBTPXxIZ5IQnVob X-Received: by 2002:a25:3d2:: with SMTP id 201mr28723278ybd.276.1552413563630; Tue, 12 Mar 2019 10:59:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552413563; cv=none; d=google.com; s=arc-20160816; b=B29IOdjg4YJ5vehAJO236xEK5nfdxcQn+lt9+TURmAapQ/p1+pgVZyjU5nRF5n9vSB I5klzlPKw2nHDuyLdon4QilpqBCydnmGiNgMuuZ8zZQiHe9mE8PFmqhAS+q8rIELjiK6 71PsIET9v752GNlWxMk9mih+RtzB17oJpXaLJM3Z71LtmfMmnTExESBJSiyrH+lqf+nZ 8Y5upz6xqWf9mg7/dXVIxC22CW3M1nDYy6sfjP+B3P7lgzdGwtyWRaICJV4/EEy7i83l Oa/6HBoNNSJydlbmY0syGnQ3DanKux9NNl977BbiyFZyZvw18qynV1JK5XpcdHv6jMJr V5/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=8ulPBZ7h8lwje33FAm/1yxM4mNmEPfuMt2JEIkVfEzs=; b=JjDNptqpetlSW0B6goBWjTM1lNiZ8s7Vh/bRpqnAbcf/Z+4gLZSM60W2G6NK3ysoEN WiU8EORazuohBSoUgEsHBcIRE3rFak+gVnIEdHtA2KMtjRgRjMXV0xlJXL2HFYx0ZUhM GTOGnjOu/wM5v6CY0ZhMGt4ABNdAtt2bQ/hsQqF96LIkSLMJ7hlGYC/I3VE9KAYMx/mN yxIuhSxdfor+kYcruyYRaj7VVzaYYbmqZWWpFaYvaq6QuMtgD4TRbj2U38QrOW9gqUz7 zOmMtZccNDqV+zJNncm2tKfW5ksqPjuhu7VIh2sa7chUt7USniKrkwS2E/scTOIbJpnk ziQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KrGhuouC; 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=fail (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 z62si5333494ybb.428.2019.03.12.10.59.23 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 12 Mar 2019 10:59:23 -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=fail header.i=@linaro.org header.s=google header.b=KrGhuouC; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([127.0.0.1]:56858 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3lgR-0007x7-4K for patch@linaro.org; Tue, 12 Mar 2019 13:59:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h3l3N-000633-65 for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:19:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h3koj-0001Hu-PD for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:03:58 -0400 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]:46303) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h3koe-0001DA-RL for qemu-devel@nongnu.org; Tue, 12 Mar 2019 13:03:49 -0400 Received: by mail-pf1-x430.google.com with SMTP id s23so2238446pfe.13 for ; Tue, 12 Mar 2019 10:03:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8ulPBZ7h8lwje33FAm/1yxM4mNmEPfuMt2JEIkVfEzs=; b=KrGhuouC1wk9YoflPvCezNeHMVj/Spq9J4DrWiBfARwf1tXRDLb/IOYpy/pd/KbICW W6Kdi89Cs0GD8WsjNeaVUtkMk0rCwkTd3k7K3WHKGynPLXAZSp1IsVYLu/SlkejBXWFm lFiIos5bnXbUYqJ1fT/1SbU2Qn3yAP3gkInKGIiC/Pa/yuHsHVol9GZkUzesD5QXDWch SJMWqmeZrShJaeFdGqIM6k1FHmHt/Ojy/0eWSM8G7lQZpGN5q51YZwaQ4VlGkcAiyntW 46rOCqoTQrxm+Nk0iwcehRxzNOgtqt9FIsE6BjVbdpcNwQ4gELd+OyUpeuauM4so/WV8 W7Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8ulPBZ7h8lwje33FAm/1yxM4mNmEPfuMt2JEIkVfEzs=; b=A85At6WKwK9C975q0rYWOzyTEocq5e3P2Thvwgqh7ScddD/rKQg8RkXmseN/kKxJb0 ZqgeGF6c49AHERBJWRPGvCsyHwhk4hnd7aBFhOvvFuJTatq/FgOhfTE6hXaxHlY7E+qW Snuh5VM5Mn/Bmqe/UmEVrEkPgdtHRQz5qjuAPNVoV9d4cAaC7J0sZwMYT07OJQhoHon5 mFMEPqbp9d1MsBdLoYePPCtCIFHhmgoz+HATkgIviv7u4XdxVPGuNQM/TCzFBvLWsaL8 rtRaQj9s319BfQ/kKRB5AB3qb19j3CJkncSqEzqu7rYf7CC8oYID249eGZV96ys6rXiQ BFpA== X-Gm-Message-State: APjAAAWOlQzq9yXweUt3oT2l2rHI9ULprRXey4M2mN5jmob7lgixk0rB iha/KhSjcxuSv4Kb/4Y0vnUCD14zBDU= X-Received: by 2002:a17:902:6804:: with SMTP id h4mr40752244plk.115.1552410226368; Tue, 12 Mar 2019 10:03:46 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id v22sm17514265pfa.49.2019.03.12.10.03.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2019 10:03:45 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 12 Mar 2019 10:03:29 -0700 Message-Id: <20190312170334.14005-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190312170334.14005-1-richard.henderson@linaro.org> References: <20190312170334.14005-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::430 Subject: [Qemu-devel] [PULL 07/12] test/decode: Add tests for PatternGroups X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, Bastian Koppelmann Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Bastian Koppelmann This adds one test that supposed to succeed to test deep nesting of pattern groups which is rarely exercised by targets using decode tree. The remaining tests exercise various fail conditions. Signed-off-by: Bastian Koppelmann Message-Id: <20190227120217.20794-1-kbastian@mail.uni-paderborn.de> Signed-off-by: Richard Henderson --- tests/decode/check.sh | 6 ++++++ tests/decode/err_pattern_group_empty.decode | 6 ++++++ tests/decode/err_pattern_group_ident1.decode | 10 +++++++++ tests/decode/err_pattern_group_ident2.decode | 11 ++++++++++ tests/decode/err_pattern_group_nest1.decode | 13 ++++++++++++ tests/decode/succ_pattern_group_nest1.decode | 22 ++++++++++++++++++++ 6 files changed, 68 insertions(+) create mode 100644 tests/decode/err_pattern_group_empty.decode create mode 100644 tests/decode/err_pattern_group_ident1.decode create mode 100644 tests/decode/err_pattern_group_ident2.decode create mode 100644 tests/decode/err_pattern_group_nest1.decode create mode 100644 tests/decode/succ_pattern_group_nest1.decode -- 2.17.2 diff --git a/tests/decode/check.sh b/tests/decode/check.sh index 79a06c37cd..95445a0115 100755 --- a/tests/decode/check.sh +++ b/tests/decode/check.sh @@ -15,4 +15,10 @@ for i in err_*.decode; do fi done +for i in succ_*.decode; do + if ! $PYTHON $DECODETREE $i > /dev/null 2> /dev/null; then + echo FAIL:$i 1>&2 + fi +done + exit $E diff --git a/tests/decode/err_pattern_group_empty.decode b/tests/decode/err_pattern_group_empty.decode new file mode 100644 index 0000000000..abbff6b528 --- /dev/null +++ b/tests/decode/err_pattern_group_empty.decode @@ -0,0 +1,6 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or later. +# See the COPYING.LIB file in the top-level directory. + +# empty groups are not allowed +{ +} diff --git a/tests/decode/err_pattern_group_ident1.decode b/tests/decode/err_pattern_group_ident1.decode new file mode 100644 index 0000000000..3e65fab2f9 --- /dev/null +++ b/tests/decode/err_pattern_group_ident1.decode @@ -0,0 +1,10 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or later. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 + +# Make sure that indentation is enforced +{ + top 00000000 00000000 00000000 00000000 + sub1 00000000 00000000 00000000 ........ %sub1 +} diff --git a/tests/decode/err_pattern_group_ident2.decode b/tests/decode/err_pattern_group_ident2.decode new file mode 100644 index 0000000000..bc859233b1 --- /dev/null +++ b/tests/decode/err_pattern_group_ident2.decode @@ -0,0 +1,11 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or later. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 + +# Make sure that indentation is enforced +{ + top 00000000 00000000 00000000 00000000 + sub1 00000000 00000000 00000000 ........ %sub1 +# comments are suposed to be indented +} diff --git a/tests/decode/err_pattern_group_nest1.decode b/tests/decode/err_pattern_group_nest1.decode new file mode 100644 index 0000000000..92e971c3c5 --- /dev/null +++ b/tests/decode/err_pattern_group_nest1.decode @@ -0,0 +1,13 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or later. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 +%sub3 16:8 +%sub4 24:8 + +# Groups with no overlap are supposed to fail +{ + top 00000000 00000000 00000000 00000000 + sub4 ........ ........ ........ ........ %sub1 %sub2 %sub3 %sub4 +} diff --git a/tests/decode/succ_pattern_group_nest1.decode b/tests/decode/succ_pattern_group_nest1.decode new file mode 100644 index 0000000000..77b0f48b49 --- /dev/null +++ b/tests/decode/succ_pattern_group_nest1.decode @@ -0,0 +1,22 @@ +# This work is licensed under the terms of the GNU LGPL, version 2 or later. +# See the COPYING.LIB file in the top-level directory. + +%sub1 0:8 +%sub2 8:8 +%sub3 16:8 +%sub4 24:7 + +# Make sure deep netsting works, as few targets will actually exercise it +{ + top 00000000 00000000 00000000 00000000 + { + sub1 00000000 00000000 00000000 ........ %sub1 + { + sub2 00000000 00000000 ........ ........ %sub1 %sub2 + { + sub3 00000000 ........ ........ ........ %sub1 %sub2 %sub3 + sub4 0....... ........ ........ ........ %sub1 %sub2 %sub3 %sub4 + } + } + } +}