]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests/qapi-schema: Make test-qapi.py print docs again
authorMarkus Armbruster <armbru@redhat.com>
Mon, 20 Mar 2017 13:11:53 +0000 (14:11 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 21 Mar 2017 09:42:52 +0000 (10:42 +0100)
test-qapi.py used to print the internal representation of doc comments
(commit 3313b61).  This went away when we dropped the doc comments in
positive tests (commit 87c16dc).  Bring it back, because I'm going to
add real positive doc comment tests.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1490015515-25851-5-git-send-email-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
tests/qapi-schema/test-qapi.py

index ef74e2c4c82b0ad835d2d94cf446e00a4e772d23..c7724d343757972bce165d17831a3f69ce4c80bb 100644 (file)
@@ -55,3 +55,14 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
 
 schema = QAPISchema(sys.argv[1])
 schema.visit(QAPISchemaTestVisitor())
+
+for doc in schema.docs:
+    if doc.symbol:
+        print 'doc symbol=%s' % doc.symbol
+    else:
+        print 'doc freeform'
+    print '    body=\n%s' % doc.body
+    for arg, section in doc.args.iteritems():
+        print '    arg=%s\n%s' % (arg, section)
+    for section in doc.sections:
+        print '    section=%s\n%s' % (section.name, section)