From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk0Vu-0004ql-94 for qemu-devel@nongnu.org; Wed, 07 Oct 2015 22:01:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk0Vq-00034R-4V for qemu-devel@nongnu.org; Wed, 07 Oct 2015 22:00:58 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk0Vp-00034C-T7 for qemu-devel@nongnu.org; Wed, 07 Oct 2015 22:00:54 -0400 From: Eric Blake Date: Wed, 7 Oct 2015 20:00:36 -0600 Message-Id: <1444269650-4117-2-git-send-email-eblake@redhat.com> In-Reply-To: <1444269650-4117-1-git-send-email-eblake@redhat.com> References: <1444269650-4117-1-git-send-email-eblake@redhat.com> Subject: [Qemu-devel] [PATCH v6 01/15] qapi: Move empty-enum to compile-time test List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, Michael Roth Rather than just asserting that we can parse an empty enum, let's also make sure we can compile it, by including it in qapi-schema-test. Signed-off-by: Eric Blake --- v6: new patch; could be hoisted earlier alongside subset B v7 3/14 --- tests/Makefile | 1 - tests/qapi-schema/enum-empty.err | 0 tests/qapi-schema/enum-empty.exit | 1 - tests/qapi-schema/enum-empty.json | 2 -- tests/qapi-schema/enum-empty.out | 2 -- tests/qapi-schema/qapi-schema-test.json | 6 ++++++ tests/qapi-schema/qapi-schema-test.out | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) delete mode 100644 tests/qapi-schema/enum-empty.err delete mode 100644 tests/qapi-schema/enum-empty.exit delete mode 100644 tests/qapi-schema/enum-empty.json delete mode 100644 tests/qapi-schema/enum-empty.out diff --git a/tests/Makefile b/tests/Makefile index 63542c4..f3626bd 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -261,7 +261,6 @@ qapi-schema += enum-bad-name.json qapi-schema += enum-bad-prefix.json qapi-schema += enum-clash-member.json qapi-schema += enum-dict-member.json -qapi-schema += enum-empty.json qapi-schema += enum-int-member.json qapi-schema += enum-max-member.json qapi-schema += enum-missing-data.json diff --git a/tests/qapi-schema/enum-empty.err b/tests/qapi-schema/enum-empty.err deleted file mode 100644 index e69de29..0000000 diff --git a/tests/qapi-schema/enum-empty.exit b/tests/qapi-schema/enum-empty.exit deleted file mode 100644 index 573541a..0000000 --- a/tests/qapi-schema/enum-empty.exit +++ /dev/null @@ -1 +0,0 @@ -0 diff --git a/tests/qapi-schema/enum-empty.json b/tests/qapi-schema/enum-empty.json deleted file mode 100644 index 40d4e85..0000000 --- a/tests/qapi-schema/enum-empty.json +++ /dev/null @@ -1,2 +0,0 @@ -# An empty enum, although unusual, is currently acceptable -{ 'enum': 'MyEnum', 'data': [ ] } diff --git a/tests/qapi-schema/enum-empty.out b/tests/qapi-schema/enum-empty.out deleted file mode 100644 index a449d45..0000000 --- a/tests/qapi-schema/enum-empty.out +++ /dev/null @@ -1,2 +0,0 @@ -object :empty -enum MyEnum [] diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/qapi-schema-test.json index 020ff2e..758bfc8 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -1,11 +1,17 @@ # *-*- Mode: Python -*-* +# This file is a stress test of supported qapi constructs that must +# parse and compile correctly. + # for testing enums { 'enum': 'EnumOne', 'data': [ 'value1', 'value2', 'value3' ] } { 'struct': 'NestedEnumsOne', 'data': { 'enum1': 'EnumOne', '*enum2': 'EnumOne', 'enum3': 'EnumOne', '*enum4': 'EnumOne' } } +# An empty enum, although unusual, is currently acceptable +{ 'enum': 'MyEnum', 'data': [ ] } + # for testing override of default naming heuristic { 'enum': 'QEnumTwo', 'prefix': 'QENUM_TWO', diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/qapi-schema-test.out index c666481..6b5a048 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -89,6 +89,7 @@ object EventStructOne object ForceArrays member unused1: UserDefOneList optional=False member unused2: UserDefTwoList optional=False +enum MyEnum [] object NestedEnumsOne member enum1: EnumOne optional=False member enum2: EnumOne optional=True -- 2.4.3