From patchwork Thu Mar 7 18:56:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159923 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7814190jad; Thu, 7 Mar 2019 11:29:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxLxLVRtT1DGsKpzkhT5BzPjyUtKa6nI8+IUXIWk5GoycWczoFB0LrraPtr/yMV8fKRiBEg X-Received: by 2002:a25:5887:: with SMTP id m129mr12430994ybb.275.1551986958650; Thu, 07 Mar 2019 11:29:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551986958; cv=none; d=google.com; s=arc-20160816; b=suKhRLFxDgenJU5y4zJuP+NslxZY8e4g+sbEbOMDrtro9lS/QPHlJaNBJmlwoA4AwI YJy4x8zVreIXX/t8z8oF0ArPdwDKrUrh5dL6cBYlnc5aLgi+znUmwvJdeNA/o2RTalVc Dtj2Gl1umsvuKREpRqmjLCf/NljrylbGyVMEtRctXcpyU8ywD01/otJ0S3qA5CwlsCop tXEr/4xzxxvlkTBd6YH4QT2c+McLq0WSuQdOV9vSS/CmXRkT9Yec8na0DiJWSylqSLMg YVyQJP4qiVatLmHSopb6dANW1OmMIII4xPG++eDjOOqy5+FqAzG3dL/+908ywNkfCupK 6oDg== 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=Y7J6f/KprS+937eWIPcoZEblJ3Vyz4FGlY/kSG/lURnv3VTdtJCHaPVoVSXNtMZMpK rhrAuVx9/ZFUUjjX/4M3A1AZh+5n7gWXF9FfY0tVAKOngyGUPNokURb7DwGzwAyNQDW/ WsZdJkn9RbTMBSLUHi8ErBev+r/3cvfKSCg8YUnRtDZAFJr7+PTGzpVoLhYRD5xtoD0x PNP/qlGXGlgfUYk12s8W/nGPx81KiDdqdFx48lUcdoTrq44EANDFYMCZ9Xtv0fqIYtmc yPAYJnxv1mZll3SR4CUAeniDwXhpWhCUMfbMgzjg6/iQYnfCOIcKyYf0Bch9HEt3Vspg 96lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=qnqihsD3; 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 i197si3235029yba.323.2019.03.07.11.29.18 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 11:29:18 -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=qnqihsD3; 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]:58161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yhi-0004f1-3o for patch@linaro.org; Thu, 07 Mar 2019 14:29:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1yC3-0001Jn-Kc for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1yC2-0002T4-K7 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:35 -0500 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]:42275) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1yC2-0002Rl-D0 for qemu-devel@nongnu.org; Thu, 07 Mar 2019 13:56:34 -0500 Received: by mail-pf1-x444.google.com with SMTP id n74so12130371pfi.9 for ; Thu, 07 Mar 2019 10:56:34 -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=qnqihsD3fUGd9BIQPTmpfdY0ITbunut5L1lazHUSLDGoPvD1F6cEX2de3Y+ACEnI/S vKiqWnkO/KRCUAURDkjn1KDF4+OQrXf43b+LMp87BubvRUKVvrJn7n4r1umr/yLrmo+1 l275TaY2A6q9DoIiMA3WQ7r2AA55h6z5y9LFYrU28GH9VmZxOTQJnZYy4y0MWF0qEl52 EjxT6re5V1hEyM8YCFoROrn7YV6VCTfYjwRoeEMpHGHkjzD9XCDNIPdTZWf2rPxbaVN+ nmywtSry8JiKDcA7n0ZuwAEhTMw3zLLwRGiqArtlrF2P1xAgAM3IiJuGYGvj9od9Jm8f wS2w== 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=jkyA+ZfcUcc9hyHCjxCg7oREmXLyqzH4uomEsLlzauNQ20Y9A+YOSXWalKoYVXddN9 y0SF9K5JVIfqBCIInbMJXYP2D+6epx9G/a12xm2ofX5ffu5L4ol4+tGSkHpLgz2Z+5Pz tUOO2wIWb2LfU2e6sHuCQ3Z4LbntcxUzEwEibYodH5nRa9OUqCNCfVvAwBJH8PYwDBQv He2Ybz5mhRU+/dv8FfygTVYp13pwhfEdTwZtHnzcUAvDEHe+vkWAZUGM0zcU1tiZ341J rMR7iKeLMO/se8CPUK85Ovd+VmBFfzGYLZSEVbxBbLQVYOveaqbjSQYN7i+1MrcewXg6 n9sg== X-Gm-Message-State: APjAAAUMncij21P6E1oN//ROeMC2TPoggr9wjoJhLmag4dOSGC4C+LDt gGyJcXEB+lEW1bD8oWgGAwaQREV9BnE= X-Received: by 2002:a17:902:9306:: with SMTP id bc6mr14104362plb.59.1551984992991; Thu, 07 Mar 2019 10:56:32 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id g12sm8801973pgr.76.2019.03.07.10.56.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 10:56:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 10:56:17 -0800 Message-Id: <20190307185622.29026-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307185622.29026-1-richard.henderson@linaro.org> References: <20190307185622.29026-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::444 Subject: [Qemu-devel] [PATCH v3 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: 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 + } + } + } +}