[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 2/6] tests/qapi-schema: Test for good feature
From: |
Markus Armbruster |
Subject: |
Re: [Qemu-devel] [PATCH v2 2/6] tests/qapi-schema: Test for good feature lists in structs |
Date: |
Fri, 24 May 2019 15:29:07 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Kevin Wolf <address@hidden> writes:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> tests/qapi-schema/qapi-schema-test.json | 30 +++++++++++++++++++++++
> tests/qapi-schema/qapi-schema-test.out | 32 +++++++++++++++++++++++++
> tests/qapi-schema/test-qapi.py | 4 ++++
> 3 files changed, 66 insertions(+)
>
> diff --git a/tests/qapi-schema/qapi-schema-test.json
> b/tests/qapi-schema/qapi-schema-test.json
> index 0952c68734..35a50fbe54 100644
> --- a/tests/qapi-schema/qapi-schema-test.json
> +++ b/tests/qapi-schema/qapi-schema-test.json
> @@ -242,3 +242,33 @@
> { 'foo': 'TestIfStruct',
> 'bar': { 'type': ['TestIfEnum'], 'if': 'defined(TEST_IF_EVT_BAR)' } },
> 'if': 'defined(TEST_IF_EVT) && defined(TEST_IF_STRUCT)' }
> +
> +# test 'features' for structs
> +
> +{ 'struct': 'FeatureStruct0',
> + 'data': { 'foo': 'int' },
> + 'features': [] }
> +{ 'struct': 'FeatureStruct1',
> + 'data': { 'foo': 'int' },
> + 'features': [ 'feature1' ] }
> +{ 'struct': 'FeatureStruct2',
> + 'data': { 'foo': 'int' },
> + 'features': [ { 'name': 'feature1' } ] }
> +{ 'struct': 'FeatureStruct3',
> + 'data': { 'foo': 'int' },
> + 'features': [ 'feature1', 'feature2' ] }
> +{ 'struct': 'FeatureStruct4',
> + 'data': { 'namespace-test': 'int' },
> + 'features': [ 'namespace-test', 'int', 'name', 'if' ] }
> +
> +{ 'struct': 'CondFeatureStruct1',
> + 'data': { 'foo': 'int' },
> + 'features': [ { 'name': 'feature1', 'if': 'defined(TEST_IF_FEATURE_1)'} ] }
> +{ 'struct': 'CondFeatureStruct2',
> + 'data': { 'foo': 'int' },
> + 'features': [ { 'name': 'feature1', 'if': 'defined(TEST_IF_FEATURE_1)'},
> + { 'name': 'feature2', 'if': 'defined(TEST_IF_FEATURE_2)'} ] }
> +{ 'struct': 'CondFeatureStruct3',
> + 'data': { 'foo': 'int' },
> + 'features': [ { 'name': 'feature1', 'if': [ 'defined(TEST_IF_COND_1)',
> + 'defined(TEST_IF_COND_2)'] } ]
> }
Let's add
{ 'command': 'test-features',
'data': { 'fs0': 'FeatureStruct0',
'fs1': 'FeatureStruct1',
'fs2': 'FeatureStruct2',
'fs3': 'FeatureStruct3',
'cfs1': 'CondFeatureStruct1',
'cfs2': 'CondFeatureStruct2',
'cfs3': 'CondFeatureStruct3' } }
because without it, the feature test cases won't generate introspection
code.
[...]
- [Qemu-devel] [PATCH v2 0/6] file-posix: Add dynamic-auto-read-only QAPI feature, Kevin Wolf, 2019/05/17
- [Qemu-devel] [PATCH v2 1/6] qapi: Support features for structs, Kevin Wolf, 2019/05/17
- [Qemu-devel] [PATCH v2 2/6] tests/qapi-schema: Test for good feature lists in structs, Kevin Wolf, 2019/05/17
- Re: [Qemu-devel] [PATCH v2 2/6] tests/qapi-schema: Test for good feature lists in structs,
Markus Armbruster <=
- [Qemu-devel] [PATCH v2 4/6] qapi: Disentangle QAPIDoc code, Kevin Wolf, 2019/05/17
- [Qemu-devel] [PATCH v2 5/6] qapi: Allow documentation for features, Kevin Wolf, 2019/05/17
- [Qemu-devel] [PATCH v2 3/6] tests/qapi-schema: Error case tests for features in structs, Kevin Wolf, 2019/05/17
- [Qemu-devel] [PATCH v2 6/6] file-posix: Add dynamic-auto-read-only QAPI feature, Kevin Wolf, 2019/05/17
- Re: [Qemu-devel] [PATCH v2 0/6] file-posix: Add dynamic-auto-read-only QAPI feature, Markus Armbruster, 2019/05/24