Eric Blake <ebl...@redhat.com> writes: > So that we don't regress in supporting downstream extensions, make > sure that our testsuite covers downstream naming choices in as many > places as possible. > > Signed-off-by: Eric Blake <ebl...@redhat.com> > --- > tests/qapi-schema/qapi-schema-test.json | 19 +++++++++++++++++++ > tests/qapi-schema/qapi-schema-test.out | 21 ++++++++++++++++++--- > tests/test-qmp-commands.c | 8 ++++++++ > 3 files changed, 45 insertions(+), 3 deletions(-) > > diff --git a/tests/qapi-schema/qapi-schema-test.json > b/tests/qapi-schema/qapi-schema-test.json > index 8193dc1..a833b63 100644 > --- a/tests/qapi-schema/qapi-schema-test.json > +++ b/tests/qapi-schema/qapi-schema-test.json > @@ -107,3 +107,22 @@ > 'data': { '*a': 'int', '*b': 'UserDefOne', 'c': 'str' } } > { 'event': 'EVENT_D', > 'data': { 'a' : 'EventStructOne', 'b' : 'str', '*c': 'str', '*enum3': > 'EnumOne' } } > + > +# test that we correctly compile downstream extensions > +{ 'enum': '__org.qemu_x-Enum', 'data': [ '__org.qemu_x-value' ] } > +{ 'struct': '__org.qemu_x-Base', > + 'data': { '__org.qemu_x-member1': '__org.qemu_x-Enum' } } > +{ 'struct': '__org.qemu_x-Struct', 'base': '__org.qemu_x-Base', > + 'data': { '__org.qemu_x-member2': 'str' } } > +{ 'struct': '__org.qemu_x-Struct2', > + 'data': { 'array': ['__org.qemu_x-Union1'] } } > +{ 'union': '__org.qemu_x-Union1', 'data': { '__org.qemu_x-branch': 'str' } } > +{ 'union': '__org.qemu_x-Union2', 'base': '__org.qemu_x-Base', > + 'discriminator': '__org.qemu_x-member1', > + 'data': { '__org.qemu_x-value': '__org.qemu_x-Struct2' } } > +{ 'alternate': '__org.qemu_x-Alt', > + 'data': { '__org.qemu_x-branch': 'str', 'b': '__org.qemu_x-Base' } } > +{ 'event': '__ORG.QEMU_X-EVENT', 'data': '__org.qemu_x-Struct' } > +{ 'command': '__org.qemu_x-command', > + 'data': { 'a': ['__org.qemu_x-Enum'], 'b': ['__org.qemu_x-Struct'], > + 'c': '__org.qemu_x-Union2', 'd': '__org.qemu_x-Alt' } }
Can't say offhand whether 'returns' takes a separate path. If it does, we better test it here. Since it can be fixed on top if it's necessary, Reviewed-by: Markus Armbruster <arm...@redhat.com>