]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
tests/qapi-schema: Fix feature documentation testing
authorMarkus Armbruster <armbru@redhat.com>
Thu, 24 Oct 2019 11:02:22 +0000 (13:02 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 29 Oct 2019 06:35:16 +0000 (07:35 +0100)
Commit 8aa3a33e44 "tests/qapi-schema: Test for good feature lists in
structs" made test-qapi.py show features, but neglected to show their
documentation.  Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-5-armbru@redhat.com>

tests/qapi-schema/doc-bad-feature.out
tests/qapi-schema/doc-good.out
tests/qapi-schema/doc-undoc-feature.out
tests/qapi-schema/test-qapi.py

index 4670be3a722bfe5702fc1554b0f94c8b12c46ef7..fef4a3e4007d4cc0552359f0fd8813ccd57f52c0 100644 (file)
@@ -15,3 +15,5 @@ command foo None -> None
 doc symbol=foo
     body=
 
+    feature=a
+a
index b0e99f2110671c68707e4b28d8d5f61f73079a78..8cc29fce50b0c2d06d1784150dd57bc5489ab695 100644 (file)
@@ -126,6 +126,8 @@ A paragraph
 Another paragraph (but no @var: line)
     arg=var1
 
+    feature=variant1-feat
+a feature
 doc symbol=Variant2
     body=
 
@@ -158,6 +160,10 @@ the second
 argument
     arg=arg3
 
+    feature=cmd-feat1
+a feature
+    feature=cmd-feat2
+another feature
     section=Note
 @arg3 is undocumented
     section=Returns
@@ -180,6 +186,10 @@ Duis aute irure dolor
 doc symbol=cmd-boxed
     body=
 If you're bored enough to read this, go see a video of boxed cats
+    feature=cmd-feat1
+a feature
+    feature=cmd-feat2
+another feature
     section=Example
 -> in
 
index faae777f0d319e29d620a95ccfb76e4fa119d2c0..cdb097361f98cdd676d3232b2e7695aee3a5bc08 100644 (file)
@@ -17,3 +17,5 @@ command foo None -> None
 doc symbol=foo
     body=
 
+    feature=doc
+documented feature
index 2bd9fd874247e0dd392bb0b4cac50027604f93f6..bad14edb476a226c8b58663ef1fe6bb303f2267f 100755 (executable)
@@ -117,6 +117,8 @@ def test_frontend(fname):
         print('    body=\n%s' % doc.body.text)
         for arg, section in doc.args.items():
             print('    arg=%s\n%s' % (arg, section.text))
+        for feat, section in doc.features.items():
+            print('    feature=%s\n%s' % (feat, section.text))
         for section in doc.sections:
             print('    section=%s\n%s' % (section.name, section.text))