Received: from eggs.gnu.org ([2001:4830:134:3::10]:60102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVact-0005L0-0l for qemu-devel@nongnu.org; Sat, 08 Dec 2018 06:18:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVacp-0004Ty-Ti for qemu-devel@nongnu.org; Sat, 08 Dec 2018 06:18:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:32834) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gVacp-0004TY-LO for qemu-devel@nongnu.org; Sat, 08 Dec 2018 06:18:23 -0500 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sat, 8 Dec 2018 15:15:57 +0400 Message-Id: <20181208111606.8505-19-marcandre.lureau@redhat.com> In-Reply-To: <20181208111606.8505-1-marcandre.lureau@redhat.com> References: <20181208111606.8505-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH for-4.0 v7 18/27] tests/qapi: add command with condition on union argument List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: armbru@redhat.com, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Michael Roth For completeness. Signed-off-by: Marc-Andr=C3=A9 Lureau --- tests/qapi-schema/qapi-schema-test.json | 3 +++ tests/qapi-schema/qapi-schema-test.out | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/tests/qapi-schema/qapi-schema-test.json b/tests/qapi-schema/= qapi-schema-test.json index 6e9e4e14d9..0d28475f4c 100644 --- a/tests/qapi-schema/qapi-schema-test.json +++ b/tests/qapi-schema/qapi-schema-test.json @@ -215,6 +215,9 @@ 'union_bar': { 'type': 'str', 'if': 'defined(TEST_IF_UNION_BAR)'} }, 'if': 'defined(TEST_IF_UNION) && defined(TEST_IF_STRUCT)' } =20 +{ 'command': 'TestIfUnionCmd', 'data': { 'union_cmd_arg': 'TestIfUnion' = }, + 'if': 'defined(TEST_IF_UNION)' } + { 'alternate': 'TestIfAlternate', 'data': { 'foo': 'int', 'bar': 'TestSt= ruct' }, 'if': 'defined(TEST_IF_ALT) && defined(TEST_IF_STRUCT)' } =20 diff --git a/tests/qapi-schema/qapi-schema-test.out b/tests/qapi-schema/q= api-schema-test.out index a342ecfc55..aedc668aa4 100644 --- a/tests/qapi-schema/qapi-schema-test.out +++ b/tests/qapi-schema/qapi-schema-test.out @@ -290,6 +290,12 @@ object TestIfUnion case union_bar: q_obj_str-wrapper if ['defined(TEST_IF_UNION_BAR)'] if ['defined(TEST_IF_UNION) && defined(TEST_IF_STRUCT)'] +object q_obj_TestIfUnionCmd-arg + member union_cmd_arg: TestIfUnion optional=3DFalse + if ['defined(TEST_IF_UNION)'] +command TestIfUnionCmd q_obj_TestIfUnionCmd-arg -> None + gen=3DTrue success_response=3DTrue boxed=3DFalse oob=3DFalse preconfi= g=3DFalse + if ['defined(TEST_IF_UNION)'] alternate TestIfAlternate tag type case foo: int --=20 2.20.0.rc1