mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-26 19:42:33 -06:00
tests: print enum type members more like object type members
Commit 93bda4dd46
changed the internal representation of enum type
members from str to QAPISchemaMember, but we still print only a
string. Has been good enough, as the name is the member's only
attribute of interest, but that's about to change. To prepare, print
them more like object type members.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20181213123724.4866-4-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
1962bd39d5
commit
1e381b6559
12 changed files with 149 additions and 27 deletions
|
@ -24,9 +24,11 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
|
|||
print('include %s' % name)
|
||||
|
||||
def visit_enum_type(self, name, info, ifcond, members, prefix):
|
||||
print('enum %s %s' % (name, [m.name for m in members]))
|
||||
print('enum %s' % name)
|
||||
if prefix:
|
||||
print(' prefix %s' % prefix)
|
||||
for m in members:
|
||||
print(' member %s' % m.name)
|
||||
self._print_if(ifcond)
|
||||
|
||||
def visit_object_type(self, name, info, ifcond, base, members, variants):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue