summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarkus Armbruster2019-10-24 13:02:22 +0200
committerMarkus Armbruster2019-10-29 07:35:16 +0100
commita0418a4a6b5bfc2f5d467af77a125dd7e4c4ca24 (patch)
tree9d4ea4dc7f2c72f9b07d0e7e0c134f14cb975e6e /tests
parenttests/qapi-schema: Cover alternate documentation comments (diff)
downloadqemu-a0418a4a6b5bfc2f5d467af77a125dd7e4c4ca24.tar.gz
qemu-a0418a4a6b5bfc2f5d467af77a125dd7e4c4ca24.tar.xz
qemu-a0418a4a6b5bfc2f5d467af77a125dd7e4c4ca24.zip
tests/qapi-schema: Fix feature documentation testing
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/qapi-schema/doc-bad-feature.out2
-rw-r--r--tests/qapi-schema/doc-good.out10
-rw-r--r--tests/qapi-schema/doc-undoc-feature.out2
-rwxr-xr-xtests/qapi-schema/test-qapi.py2
4 files changed, 16 insertions, 0 deletions
diff --git a/tests/qapi-schema/doc-bad-feature.out b/tests/qapi-schema/doc-bad-feature.out
index 4670be3a72..fef4a3e400 100644
--- a/tests/qapi-schema/doc-bad-feature.out
+++ b/tests/qapi-schema/doc-bad-feature.out
@@ -15,3 +15,5 @@ command foo None -> None
doc symbol=foo
body=
+ feature=a
+a
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index b0e99f2110..8cc29fce50 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -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
diff --git a/tests/qapi-schema/doc-undoc-feature.out b/tests/qapi-schema/doc-undoc-feature.out
index faae777f0d..cdb097361f 100644
--- a/tests/qapi-schema/doc-undoc-feature.out
+++ b/tests/qapi-schema/doc-undoc-feature.out
@@ -17,3 +17,5 @@ command foo None -> None
doc symbol=foo
body=
+ feature=doc
+documented feature
diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index 2bd9fd8742..bad14edb47 100755
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -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))