Received: from eggs.gnu.org ([2001:4830:134:3::10]:44964) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnOE-0001qf-Qm for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:39:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XEnO0-0004rF-Nb for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:39:30 -0400 Received: from qmta14.emeryville.ca.mail.comcast.net ([2001:558:fe2d:44:76:96:27:212]:44036) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XEnO0-0004qh-F1 for qemu-devel@nongnu.org; Tue, 05 Aug 2014 18:39:16 -0400 From: Eric Blake Date: Tue, 5 Aug 2014 16:38:57 -0600 Message-Id: <1407278346-17427-6-git-send-email-eblake@redhat.com> In-Reply-To: <1407278346-17427-1-git-send-email-eblake@redhat.com> References: <1407278346-17427-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v2 05/14] qapi: add some expr tests List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Fam Zheng , Markus Armbruster , wenchaoqemu@gmail.com, Luiz Capitulino Demonstrate that the qapi generator doesn't deal well with expressions that aren't up to par. Later patches will improve the expected results as the generator is made stricter. * tests/qapi-schema/missing-type.*: New files. * tests/qapi-schema/double-type.*: Likewise. * tests/Makefile (check-qapi-schema-y): Run them. Signed-off-by: Eric Blake --- tests/Makefile | 1 + tests/qapi-schema/double-type.err | 0 tests/qapi-schema/double-type.exit | 1 + tests/qapi-schema/double-type.json | 1 + tests/qapi-schema/double-type.out | 3 +++ tests/qapi-schema/missing-type.err | 0 tests/qapi-schema/missing-type.exit | 1 + tests/qapi-schema/missing-type.json | 1 + tests/qapi-schema/missing-type.out | 3 +++ 9 files changed, 11 insertions(+) create mode 100644 tests/qapi-schema/double-type.err create mode 100644 tests/qapi-schema/double-type.exit create mode 100644 tests/qapi-schema/double-type.json create mode 100644 tests/qapi-schema/double-type.out create mode 100644 tests/qapi-schema/missing-type.err create mode 100644 tests/qapi-schema/missing-type.exit create mode 100644 tests/qapi-schema/missing-type.json create mode 100644 tests/qapi-schema/missing-type.out diff --git a/tests/Makefile b/tests/Makefile index fbf6909..1b0c96f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -192,6 +192,7 @@ $(foreach target,$(SYSEMU_TARGET_LIST), \ check-qapi-schema-y := $(addprefix tests/qapi-schema/, \ comments.json empty.json enum-empty.json enum-missing-data.json \ enum-wrong-data.json funny-char.json indented-expr.json \ + missing-type.json double-type.json \ missing-colon.json missing-comma-list.json \ missing-comma-object.json non-objects.json \ qapi-schema-test.json quoted-structural-chars.json \ diff --git a/tests/qapi-schema/double-type.err b/tests/qapi-schema/double-type.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/double-type.exit b/tests/qapi-schema/double-type.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/double-type.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/double-type.json b/tests/qapi-schema/double-type.json new file mode 100644 index 0000000..2d4d97d --- /dev/null +++ b/tests/qapi-schema/double-type.json @@ -0,0 +1 @@ +{ 'command': 'foo', 'type': 'bar', 'data': { } } diff --git a/tests/qapi-schema/double-type.out b/tests/qapi-schema/double-type.out new file mode 100644 index 0000000..3e244f5 --- /dev/null +++ b/tests/qapi-schema/double-type.out @@ -0,0 +1,3 @@ +[OrderedDict([('command', 'foo'), ('type', 'bar'), ('data', OrderedDict())])] +[] +[OrderedDict([('command', 'foo'), ('type', 'bar'), ('data', OrderedDict())])] diff --git a/tests/qapi-schema/missing-type.err b/tests/qapi-schema/missing-type.err new file mode 100644 index 0000000..e69de29 diff --git a/tests/qapi-schema/missing-type.exit b/tests/qapi-schema/missing-type.exit new file mode 100644 index 0000000..573541a --- /dev/null +++ b/tests/qapi-schema/missing-type.exit @@ -0,0 +1 @@ +0 diff --git a/tests/qapi-schema/missing-type.json b/tests/qapi-schema/missing-type.json new file mode 100644 index 0000000..9043aa4 --- /dev/null +++ b/tests/qapi-schema/missing-type.json @@ -0,0 +1 @@ +{ 'data': { } } diff --git a/tests/qapi-schema/missing-type.out b/tests/qapi-schema/missing-type.out new file mode 100644 index 0000000..67fd4fa --- /dev/null +++ b/tests/qapi-schema/missing-type.out @@ -0,0 +1,3 @@ +[OrderedDict([('data', OrderedDict())])] +[] +[] -- 1.9.3