diff options
author | Markus Armbruster | 2019-10-24 13:02:19 +0200 |
---|---|---|
committer | Markus Armbruster | 2019-10-29 07:35:16 +0100 |
commit | f035b47e3f461e04e36e709aaad8bc8048b5f739 (patch) | |
tree | 0ddc30862c13a7cd6324c882d915e48face900ad /tests/qapi-schema | |
parent | Merge remote-tracking branch 'remotes/maxreitz/tags/pull-block-2019-10-28' in... (diff) | |
download | qemu-f035b47e3f461e04e36e709aaad8bc8048b5f739.tar.gz qemu-f035b47e3f461e04e36e709aaad8bc8048b5f739.tar.xz qemu-f035b47e3f461e04e36e709aaad8bc8048b5f739.zip |
tests/qapi-schema: Demonstrate feature and enum doc comment bugs
Add negative tests doc-bad-enum-member and doc-bad-feature to cover
documentation for nonexistent enum members and features, and test
doc-undoc-feature to cover features lacking documentation. None of
them works. To be fixed later in this series.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20191024110237.30963-2-armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r-- | tests/qapi-schema/doc-bad-enum-member.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/doc-bad-enum-member.json | 9 | ||||
-rw-r--r-- | tests/qapi-schema/doc-bad-enum-member.out | 21 | ||||
-rw-r--r-- | tests/qapi-schema/doc-bad-feature.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/doc-bad-feature.json | 10 | ||||
-rw-r--r-- | tests/qapi-schema/doc-bad-feature.out | 17 | ||||
-rw-r--r-- | tests/qapi-schema/doc-undoc-feature.err | 0 | ||||
-rw-r--r-- | tests/qapi-schema/doc-undoc-feature.json | 10 | ||||
-rw-r--r-- | tests/qapi-schema/doc-undoc-feature.out | 19 |
9 files changed, 86 insertions, 0 deletions
diff --git a/tests/qapi-schema/doc-bad-enum-member.err b/tests/qapi-schema/doc-bad-enum-member.err new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/doc-bad-enum-member.err diff --git a/tests/qapi-schema/doc-bad-enum-member.json b/tests/qapi-schema/doc-bad-enum-member.json new file mode 100644 index 0000000000..9f32fe64b4 --- /dev/null +++ b/tests/qapi-schema/doc-bad-enum-member.json @@ -0,0 +1,9 @@ +# Members listed in the doc comment must exist in the actual schema +# BUG: nonexistent @a is not rejected + +## +# @Foo: +# @a: a +# @b: b +## +{ 'enum': 'Foo', 'data': [ 'b' ] } diff --git a/tests/qapi-schema/doc-bad-enum-member.out b/tests/qapi-schema/doc-bad-enum-member.out new file mode 100644 index 0000000000..6ca31c1e9b --- /dev/null +++ b/tests/qapi-schema/doc-bad-enum-member.out @@ -0,0 +1,21 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module doc-bad-enum-member.json +enum Foo + member b +doc symbol=Foo + body= + + arg=a +a + arg=b +b diff --git a/tests/qapi-schema/doc-bad-feature.err b/tests/qapi-schema/doc-bad-feature.err new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/doc-bad-feature.err diff --git a/tests/qapi-schema/doc-bad-feature.json b/tests/qapi-schema/doc-bad-feature.json new file mode 100644 index 0000000000..2a78e3b1db --- /dev/null +++ b/tests/qapi-schema/doc-bad-feature.json @@ -0,0 +1,10 @@ +# Features listed in the doc comment must exist in the actual schema +# BUG: nonexistent @a is not rejected + +## +# @foo: +# +# Features: +# @a: a +## +{ 'command': 'foo' } diff --git a/tests/qapi-schema/doc-bad-feature.out b/tests/qapi-schema/doc-bad-feature.out new file mode 100644 index 0000000000..4670be3a72 --- /dev/null +++ b/tests/qapi-schema/doc-bad-feature.out @@ -0,0 +1,17 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module doc-bad-feature.json +command foo None -> None + gen=True success_response=True boxed=False oob=False preconfig=False +doc symbol=foo + body= + diff --git a/tests/qapi-schema/doc-undoc-feature.err b/tests/qapi-schema/doc-undoc-feature.err new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/tests/qapi-schema/doc-undoc-feature.err diff --git a/tests/qapi-schema/doc-undoc-feature.json b/tests/qapi-schema/doc-undoc-feature.json new file mode 100644 index 0000000000..c7650d9974 --- /dev/null +++ b/tests/qapi-schema/doc-undoc-feature.json @@ -0,0 +1,10 @@ +# Doc comment must cover all features +# BUG: missing documentation for @undoc not caught + +## +# @foo: +# +# Features: +# @doc: documented feature +## +{ 'command': 'foo', 'features': ['undoc', 'doc'] } diff --git a/tests/qapi-schema/doc-undoc-feature.out b/tests/qapi-schema/doc-undoc-feature.out new file mode 100644 index 0000000000..faae777f0d --- /dev/null +++ b/tests/qapi-schema/doc-undoc-feature.out @@ -0,0 +1,19 @@ +module None +object q_empty +enum QType + prefix QTYPE + member none + member qnull + member qnum + member qstring + member qdict + member qlist + member qbool +module doc-undoc-feature.json +command foo None -> None + gen=True success_response=True boxed=False oob=False preconfig=False + feature undoc + feature doc +doc symbol=foo + body= + |