From patchwork Tue Feb 11 13:00:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 319261 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A55E82C00A0 for ; Wed, 12 Feb 2014 00:01:30 +1100 (EST) Received: from localhost ([::1]:33423 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDCxp-0002Wt-Rp for incoming@patchwork.ozlabs.org; Tue, 11 Feb 2014 08:01:25 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42187) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDCx5-00024v-7n for qemu-devel@nongnu.org; Tue, 11 Feb 2014 08:00:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WDCwy-00073X-DH for qemu-devel@nongnu.org; Tue, 11 Feb 2014 08:00:39 -0500 Received: from roura.ac.upc.edu ([147.83.33.10]:46929 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WDCwx-00073H-Od for qemu-devel@nongnu.org; Tue, 11 Feb 2014 08:00:32 -0500 Received: from gw.ac.upc.edu (gw.ac.upc.es [147.83.30.3]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id s1BD0UCD010920; Tue, 11 Feb 2014 14:00:30 +0100 Received: from localhost (unknown [84.88.51.85]) by gw.ac.upc.edu (Postfix) with ESMTP id 2BD5E6B020C; Tue, 11 Feb 2014 13:55:50 +0100 (CET) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 11 Feb 2014 14:00:30 +0100 Message-Id: <20140211130030.12374.67440.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <20140211130013.12374.17471.stgit@fimbulvetr.bsc.es> References: <20140211130013.12374.17471.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.16 MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id s1BD0UCD010920 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Cc: Markus Armbruster , Luiz Capitulino Subject: [Qemu-devel] [PATCH v3 3/3] qapi: Add tests for the "include" directive X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: LluĂ­s Vilanova --- tests/Makefile | 3 ++- tests/qapi-schema/include-cycle.err | 1 + tests/qapi-schema/include-cycle.exit | 1 + tests/qapi-schema/include-cycle.json | 1 + tests/qapi-schema/include-cycle.out | 0 tests/qapi-schema/include-nested-err.err | 1 + tests/qapi-schema/include-nested-err.exit | 1 + tests/qapi-schema/include-nested-err.json | 1 + tests/qapi-schema/include-nested-err.out | 0 tests/qapi-schema/include-no-file.err | 1 + tests/qapi-schema/include-no-file.exit | 1 + tests/qapi-schema/include-no-file.json | 1 + tests/qapi-schema/include-no-file.out | 0 tests/qapi-schema/include-simple-sub.json | 2 ++ tests/qapi-schema/include-simple.err | 0 tests/qapi-schema/include-simple.exit | 1 + tests/qapi-schema/include-simple.json | 1 + tests/qapi-schema/include-simple.out | 3 +++ 18 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 tests/qapi-schema/include-cycle.err create mode 100644 tests/qapi-schema/include-cycle.exit create mode 100644 tests/qapi-schema/include-cycle.json create mode 100644 tests/qapi-schema/include-cycle.out create mode 100644 tests/qapi-schema/include-nested-err.err create mode 100644 tests/qapi-schema/include-nested-err.exit create mode 100644 tests/qapi-schema/include-nested-err.json create mode 100644 tests/qapi-schema/include-nested-err.out create mode 100644 tests/qapi-schema/include-no-file.err create mode 100644 tests/qapi-schema/include-no-file.exit create mode 100644 tests/qapi-schema/include-no-file.json create mode 100644 tests/qapi-schema/include-no-file.out create mode 100644 tests/qapi-schema/include-simple-sub.json create mode 100644 tests/qapi-schema/include-simple.err create mode 100644 tests/qapi-schema/include-simple.exit create mode 100644 tests/qapi-schema/include-simple.json create mode 100644 tests/qapi-schema/include-simple.out diff --git a/tests/Makefile b/tests/Makefile index 947e255..9270ade 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -124,7 +124,8 @@ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \ missing-comma-object.json non-objects.json \ qapi-schema-test.json quoted-structural-chars.json \ trailing-comma-list.json trailing-comma-object.json \ - unclosed-list.json unclosed-object.json unclosed-string.json) + unclosed-list.json unclosed-object.json unclosed-string.json\ + include-simple.json include-nested-err.json include-no-file.json include-cycle.json) GENERATED_HEADERS += tests/test-qapi-types.h tests/test-qapi-visit.h tests/test-qmp-commands.h diff --git a/tests/qapi-schema/include-cycle.err b/tests/qapi-schema/include-cycle.err new file mode 100644 index 0000000..3f4290c --- /dev/null +++ b/tests/qapi-schema/include-cycle.err @@ -0,0 +1 @@ +include-cycle.json:1:1: Inifite inclusion loop: include-cycle.json -> include-cycle.json diff --git a/tests/qapi-schema/include-cycle.exit b/tests/qapi-schema/include-cycle.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/include-cycle.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/include-cycle.json b/tests/qapi-schema/include-cycle.json new file mode 100644 index 0000000..90ffa6a --- /dev/null +++ b/tests/qapi-schema/include-cycle.json @@ -0,0 +1 @@ +include("include-cycle.json") diff --git a/tests/qapi-schema/include-cycle.out b/tests/qapi-schema/include-cycle.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/include-nested-err.err b/tests/qapi-schema/include-nested-err.err new file mode 100644 index 0000000..676cce5 --- /dev/null +++ b/tests/qapi-schema/include-nested-err.err @@ -0,0 +1 @@ +missing-colon.json:1:10: Expected ":" diff --git a/tests/qapi-schema/include-nested-err.exit b/tests/qapi-schema/include-nested-err.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/include-nested-err.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/include-nested-err.json b/tests/qapi-schema/include-nested-err.json new file mode 100644 index 0000000..ff53883 --- /dev/null +++ b/tests/qapi-schema/include-nested-err.json @@ -0,0 +1 @@ +include("missing-colon.json") diff --git a/tests/qapi-schema/include-nested-err.out b/tests/qapi-schema/include-nested-err.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/include-no-file.err b/tests/qapi-schema/include-no-file.err new file mode 100644 index 0000000..24832c1 --- /dev/null +++ b/tests/qapi-schema/include-no-file.err @@ -0,0 +1 @@ +include-no-file.json:1:1: Non-existing included file "include-no-file-sub.json" diff --git a/tests/qapi-schema/include-no-file.exit b/tests/qapi-schema/include-no-file.exit new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/tests/qapi-schema/include-no-file.exit @@ -0,0 +1 @@ +1 diff --git a/tests/qapi-schema/include-no-file.json b/tests/qapi-schema/include-no-file.json new file mode 100644 index 0000000..df762c2 --- /dev/null +++ b/tests/qapi-schema/include-no-file.json @@ -0,0 +1 @@ +include("include-no-file-sub.json") diff --git a/tests/qapi-schema/include-no-file.out b/tests/qapi-schema/include-no-file.out new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/include-simple-sub.json b/tests/qapi-schema/include-simple-sub.json new file mode 100644 index 0000000..4bd4af4 --- /dev/null +++ b/tests/qapi-schema/include-simple-sub.json @@ -0,0 +1,2 @@ +{ 'enum': 'Status', + 'data': [ 'good', 'bad', 'ugly' ] } diff --git a/tests/qapi-schema/include-simple.err b/tests/qapi-schema/include-simple.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/include-simple.exit b/tests/qapi-schema/include-simple.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/include-simple.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/include-simple.json b/tests/qapi-schema/include-simple.json new file mode 100644 index 0000000..31c81d1 --- /dev/null +++ b/tests/qapi-schema/include-simple.json @@ -0,0 +1 @@ +include("include-simple-sub.json") diff --git a/tests/qapi-schema/include-simple.out b/tests/qapi-schema/include-simple.out new file mode 100644 index 0000000..e3bd904 --- /dev/null +++ b/tests/qapi-schema/include-simple.out @@ -0,0 +1,3 @@ +[OrderedDict([('enum', 'Status'), ('data', ['good', 'bad', 'ugly'])])] +['Status'] +[]