diff options
author | Peter Krempa <pkrempa@redhat.com> | 2019-10-18 10:14:52 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2019-10-22 13:54:13 +0200 |
commit | 2e2e0df2706886488caf3d0dd22d4fe3acc4d4e0 (patch) | |
tree | a9ca91d7b9b91558b3607460ca61b7eb491b0e23 /tests/qapi-schema/test-qapi.py | |
parent | 23394b4c393c832aa3891533587ff97e04c70883 (diff) |
tests: qapi: Test 'features' of commands
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191018081454.21369-4-armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema/test-qapi.py')
-rwxr-xr-x | tests/qapi-schema/test-qapi.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py index d31ac4bbb7..2bd9fd8742 100755 --- a/tests/qapi-schema/test-qapi.py +++ b/tests/qapi-schema/test-qapi.py @@ -61,10 +61,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): self._print_if(m.ifcond, 8) self._print_variants(variants) self._print_if(ifcond) - if features: - for f in features: - print(' feature %s' % f.name) - self._print_if(f.ifcond, 8) + self._print_features(features) def visit_alternate_type(self, name, info, ifcond, variants): print('alternate %s' % name) @@ -80,6 +77,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): print(' gen=%s success_response=%s boxed=%s oob=%s preconfig=%s' % (gen, success_response, boxed, allow_oob, allow_preconfig)) self._print_if(ifcond) + self._print_features(features) def visit_event(self, name, info, ifcond, arg_type, boxed): print('event %s %s' % (name, arg_type and arg_type.name)) @@ -99,6 +97,13 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor): if ifcond: print('%sif %s' % (' ' * indent, ifcond)) + @classmethod + def _print_features(cls, features): + if features: + for f in features: + print(' feature %s' % f.name) + cls._print_if(f.ifcond, 8) + def test_frontend(fname): schema = QAPISchema(fname) |