]> git.proxmox.com Git - mirror_qemu.git/commit - tests/qapi-schema/qapi-schema-test.out
qapi: add 'if' to top-level expressions
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 Jul 2018 15:56:35 +0000 (17:56 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 3 Jul 2018 16:21:24 +0000 (18:21 +0200)
commit967c885108f18e5065744719f7959ba5ea0a5b0d
treeb2138075fca0ddc4ca19454502ed0c376b8bc190
parentb07cd3e748b3f27a17c27afeee578dc4eedb8dd5
qapi: add 'if' to top-level expressions

Accept 'if' key in top-level elements, accepted as string or list of
string type. The following patches will modify the test visitor to
check the value is correctly saved, and generate #if/#endif code (as a
single #if/endif line or a series for a list).

Example of 'if' key:
{ 'struct': 'TestIfStruct', 'data': { 'foo': 'int' },
  'if': 'defined(TEST_IF_STRUCT)' }

The generated code is for now *unconditional*. Later patches generate
the conditionals.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20180703155648.11933-2-marcandre.lureau@redhat.com>
[Commit message and Documentation improved]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
22 files changed:
docs/devel/qapi-code-gen.txt
scripts/qapi/common.py
tests/Makefile.include
tests/qapi-schema/bad-if-empty-list.err [new file with mode: 0644]
tests/qapi-schema/bad-if-empty-list.exit [new file with mode: 0644]
tests/qapi-schema/bad-if-empty-list.json [new file with mode: 0644]
tests/qapi-schema/bad-if-empty-list.out [new file with mode: 0644]
tests/qapi-schema/bad-if-empty.err [new file with mode: 0644]
tests/qapi-schema/bad-if-empty.exit [new file with mode: 0644]
tests/qapi-schema/bad-if-empty.json [new file with mode: 0644]
tests/qapi-schema/bad-if-empty.out [new file with mode: 0644]
tests/qapi-schema/bad-if-list.err [new file with mode: 0644]
tests/qapi-schema/bad-if-list.exit [new file with mode: 0644]
tests/qapi-schema/bad-if-list.json [new file with mode: 0644]
tests/qapi-schema/bad-if-list.out [new file with mode: 0644]
tests/qapi-schema/bad-if.err [new file with mode: 0644]
tests/qapi-schema/bad-if.exit [new file with mode: 0644]
tests/qapi-schema/bad-if.json [new file with mode: 0644]
tests/qapi-schema/bad-if.out [new file with mode: 0644]
tests/qapi-schema/qapi-schema-test.json
tests/qapi-schema/qapi-schema-test.out
tests/test-qmp-cmds.c