From patchwork Thu Feb 28 05:24:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159310 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp230636jad; Wed, 27 Feb 2019 21:27:55 -0800 (PST) X-Google-Smtp-Source: AHgI3IaA2C9cP4/frgu7+wlRcveEk0WR+ptq3tBZMywSAC72hF+f6oPEHYsihZnJagUjoyT+73qk X-Received: by 2002:a25:a181:: with SMTP id a1mr5167772ybi.260.1551331675476; Wed, 27 Feb 2019 21:27:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551331675; cv=none; d=google.com; s=arc-20160816; b=a30g+hUgQhubxJJG45gT8e1LUsg1bfOONDQb7M7xgWUDBKQ6RJv+nvCXGCybmnP1l9 YGQ7OPxLSJXDQx/8ei9yvo28rFpRyONhC1NM1arKAE1Eg0GTyek12kQ0zaYfhtYJiu4H 65/udySMMw6vpoSRWBOVtnuE91a/V67N43l8VW6k2qdyLojdnS9WraTAcmE+6amhjM9e TAfeRaaFGTDmkwajFnazZcQVL72q0WK/536qgIBv3HOcaj8TgMYpsf7E+NgmG0hQvMvZ +hn8UulvgNRD4eixpCMBLoAKMZoAmCGhhxtIP7/ojp6z3ZaIdrQMmsYykNKvFTZZ4nEp XLaQ== 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=duYJLy/s+Uat1e7s1nSJAb7UVjBZnwz1clEtsrnH2barJt+4LoErqS3c42yucFCoax O3PYm53whKZjTYM+PlGZjnH0H4VYwblpN5PFkF267FVTv1XAWNo7oa3u9eg8FQXcVH4I G35FYEKaPSuk2nMK2/7q3bkreakRc7YPAAgEkL72Y3ZReY5Pf94Yt06via5CYiVhFRk5 DLj0+6WZIZvp04PTVjpy7e8mbL+SnSFcnzQC/1OQwJSTHUsKvflPbzT+bTO2SdR3eYox N9tZkh6lFWj6lMs++OY3mEMRG6yQqMQU2VBuEc3eUTcuSH82lbhwH2KBngGe2i4gq3fG 32aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=eSIR8T7q; 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 y9si6346940ybp.245.2019.02.27.21.27.55 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 27 Feb 2019 21:27:55 -0800 (PST) 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=eSIR8T7q; 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]:60585 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEEc-0006r7-Tl for patch@linaro.org; Thu, 28 Feb 2019 00:27:54 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59622) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzEBg-0005g1-8H for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzEBe-0003mZ-7n for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:52 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]:45354) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzEBc-0003kf-81 for qemu-devel@nongnu.org; Thu, 28 Feb 2019 00:24:50 -0500 Received: by mail-pl1-x642.google.com with SMTP id r14so9142862pls.12 for ; Wed, 27 Feb 2019 21:24:46 -0800 (PST) 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=eSIR8T7qebdfYMduSHNv62RSpVKAKNaP8oLD/HWXhITjOwQSZ2qoDNXU0agwjmdwGd wZkNuH+QZkOf9XhWMAmeo1FpFqI5cuyGdkpSDhWy1cJnAwSrmH8ZVHv0yuK/G3Q162OP C3y/zLKBzsoJgY56FtO1UX9rCo2QiMXiovfvJ1NqHup68IW265fmEEZWeXNPySkNWKnp /1DgOWXImk57sFlcnUXewvDMajL++jBTCqwilr4+acleXQoRnajebohIYhixrUVS8mUy Sk/x+oY6e3Drfabm63q5e6/YwrOPa6FOrawYB37ioSfE3D0HUYZYIu6U0O+Dqi/oB1ws vbnw== 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=Q59AfXDVsrPDhzYUz+khFpGiUKaWvfcx2qKoTlbMzFYhY9ADrd7OkjgGD/YJL9JIay av4X0O0Uk15DOPtcwtLQWpD8cL6DHLtG0HXaSv9GGUIbt+4QXk790VG4DOlcANQ94q7I FmqQl+0RWI6Ke6PH6xs7XOhVrIp4MH5e5a9I9qvXB2Q2X90EcO0BM/Cj+/aICifj0Ety K6YzRjoCfcpp5Q1zxdtqO7wmSA+zvxWIPWG/VDJ5vrxdhNbQHo2d44rqkrm6xEII6Qpl HKoafZq14sk0z13rE2Tpz+ZEe4/tyB7M7uXkYCwSQ9EnjlWTuEXJkiUvdBOL5AJJaFM6 WmMA== X-Gm-Message-State: AHQUAub8MbG1wJ+3CPexlMWVQhhRw6HthTjomRr0OxZ55sDZYrNiek15 Pcvq5eWBs9TBivAFHPQ8V78hLkIoRmo= X-Received: by 2002:a17:902:1aa:: with SMTP id b39mr6107471plb.317.1551331485114; Wed, 27 Feb 2019 21:24:45 -0800 (PST) Received: from cloudburst.dc.rr.com (cpe-72-132-251-149.dc.res.rr.com. [72.132.251.149]) by smtp.gmail.com with ESMTPSA id u13sm32758371pfa.169.2019.02.27.21.24.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 21:24:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 27 Feb 2019 21:24:31 -0800 Message-Id: <20190228052432.32571-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190228052432.32571-1-richard.henderson@linaro.org> References: <20190228052432.32571-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::642 Subject: [Qemu-devel] [PATCH v2 7/8] 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: kbastian@mail.uni-paderborn.de, f4bug@amsat.org 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 + } + } + } +}