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>
This commit is contained in:
parent
aaffb85335
commit
f035b47e3f
@ -342,6 +342,8 @@ qapi-schema += command-int.json
|
|||||||
qapi-schema += comments.json
|
qapi-schema += comments.json
|
||||||
qapi-schema += doc-bad-alternate-member.json
|
qapi-schema += doc-bad-alternate-member.json
|
||||||
qapi-schema += doc-bad-command-arg.json
|
qapi-schema += doc-bad-command-arg.json
|
||||||
|
qapi-schema += doc-bad-enum-member.json
|
||||||
|
qapi-schema += doc-bad-feature.json
|
||||||
qapi-schema += doc-bad-section.json
|
qapi-schema += doc-bad-section.json
|
||||||
qapi-schema += doc-bad-symbol.json
|
qapi-schema += doc-bad-symbol.json
|
||||||
qapi-schema += doc-bad-union-member.json
|
qapi-schema += doc-bad-union-member.json
|
||||||
@ -365,6 +367,7 @@ qapi-schema += doc-missing-expr.json
|
|||||||
qapi-schema += doc-missing-space.json
|
qapi-schema += doc-missing-space.json
|
||||||
qapi-schema += doc-missing.json
|
qapi-schema += doc-missing.json
|
||||||
qapi-schema += doc-no-symbol.json
|
qapi-schema += doc-no-symbol.json
|
||||||
|
qapi-schema += doc-undoc-feature.json
|
||||||
qapi-schema += double-type.json
|
qapi-schema += double-type.json
|
||||||
qapi-schema += duplicate-key.json
|
qapi-schema += duplicate-key.json
|
||||||
qapi-schema += empty.json
|
qapi-schema += empty.json
|
||||||
|
0
tests/qapi-schema/doc-bad-enum-member.err
Normal file
0
tests/qapi-schema/doc-bad-enum-member.err
Normal file
9
tests/qapi-schema/doc-bad-enum-member.json
Normal file
9
tests/qapi-schema/doc-bad-enum-member.json
Normal file
@ -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' ] }
|
21
tests/qapi-schema/doc-bad-enum-member.out
Normal file
21
tests/qapi-schema/doc-bad-enum-member.out
Normal file
@ -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
|
0
tests/qapi-schema/doc-bad-feature.err
Normal file
0
tests/qapi-schema/doc-bad-feature.err
Normal file
10
tests/qapi-schema/doc-bad-feature.json
Normal file
10
tests/qapi-schema/doc-bad-feature.json
Normal file
@ -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' }
|
17
tests/qapi-schema/doc-bad-feature.out
Normal file
17
tests/qapi-schema/doc-bad-feature.out
Normal file
@ -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=
|
||||||
|
|
0
tests/qapi-schema/doc-undoc-feature.err
Normal file
0
tests/qapi-schema/doc-undoc-feature.err
Normal file
10
tests/qapi-schema/doc-undoc-feature.json
Normal file
10
tests/qapi-schema/doc-undoc-feature.json
Normal file
@ -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'] }
|
19
tests/qapi-schema/doc-undoc-feature.out
Normal file
19
tests/qapi-schema/doc-undoc-feature.out
Normal file
@ -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=
|
||||||
|
|
Loading…
Reference in New Issue
Block a user