aboutsummaryrefslogtreecommitdiff
path: root/tests/qapi-schema
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r--tests/qapi-schema/doc-bad-boxed-command-arg.err0
-rw-r--r--tests/qapi-schema/doc-bad-boxed-command-arg.json15
-rw-r--r--tests/qapi-schema/doc-bad-boxed-command-arg.out26
-rw-r--r--tests/qapi-schema/doc-bad-event-arg.err0
-rw-r--r--tests/qapi-schema/doc-bad-event-arg.json8
-rw-r--r--tests/qapi-schema/doc-bad-event-arg.out19
-rw-r--r--tests/qapi-schema/doc-good.json7
-rw-r--r--tests/qapi-schema/doc-good.out5
-rw-r--r--tests/qapi-schema/doc-good.texi8
9 files changed, 88 insertions, 0 deletions
diff --git a/tests/qapi-schema/doc-bad-boxed-command-arg.err b/tests/qapi-schema/doc-bad-boxed-command-arg.err
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-boxed-command-arg.err
diff --git a/tests/qapi-schema/doc-bad-boxed-command-arg.json b/tests/qapi-schema/doc-bad-boxed-command-arg.json
new file mode 100644
index 0000000000..2c265d2ca3
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-boxed-command-arg.json
@@ -0,0 +1,15 @@
+# Boxed arguments are not to be documented with the command
+# BUG: not rejected
+
+##
+# @Args:
+# @a: an argument
+##
+{ 'struct': 'Args', 'data': { 'a': 'int' } }
+
+##
+# @cmd-boxed:
+# @a: bogus
+##
+{ 'command': 'cmd-boxed', 'boxed': true,
+ 'data': 'Args' }
diff --git a/tests/qapi-schema/doc-bad-boxed-command-arg.out b/tests/qapi-schema/doc-bad-boxed-command-arg.out
new file mode 100644
index 0000000000..4ccd788253
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-boxed-command-arg.out
@@ -0,0 +1,26 @@
+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-boxed-command-arg.json
+object Args
+ member a: int optional=False
+command cmd-boxed Args -> None
+ gen=True success_response=True boxed=True oob=False preconfig=False
+doc symbol=Args
+ body=
+
+ arg=a
+an argument
+doc symbol=cmd-boxed
+ body=
+
+ arg=a
+bogus
diff --git a/tests/qapi-schema/doc-bad-event-arg.err b/tests/qapi-schema/doc-bad-event-arg.err
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-event-arg.err
diff --git a/tests/qapi-schema/doc-bad-event-arg.json b/tests/qapi-schema/doc-bad-event-arg.json
new file mode 100644
index 0000000000..80d4e1240b
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-event-arg.json
@@ -0,0 +1,8 @@
+# Arguments listed in the doc comment must exist in the actual schema
+# BUG: nonexistent @a is not rejected
+
+##
+# @FOO:
+# @a: a
+##
+{ 'event': 'FOO' }
diff --git a/tests/qapi-schema/doc-bad-event-arg.out b/tests/qapi-schema/doc-bad-event-arg.out
new file mode 100644
index 0000000000..ad0367cd45
--- /dev/null
+++ b/tests/qapi-schema/doc-bad-event-arg.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-bad-event-arg.json
+event FOO None
+ boxed=False
+doc symbol=FOO
+ body=
+
+ arg=a
+a
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
index 7dc21e58a3..1ae6c3a9da 100644
--- a/tests/qapi-schema/doc-good.json
+++ b/tests/qapi-schema/doc-good.json
@@ -149,3 +149,10 @@
{ 'command': 'cmd-boxed', 'boxed': true,
'data': 'Object',
'features': [ 'cmd-feat1', 'cmd-feat2' ] }
+
+##
+# @EVT-BOXED:
+# BUG: generated doc misses arguments
+##
+{ 'event': 'EVT-BOXED', 'boxed': true,
+ 'data': 'Object' }
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
index f78fdef6a9..a8fc39d288 100644
--- a/tests/qapi-schema/doc-good.out
+++ b/tests/qapi-schema/doc-good.out
@@ -54,6 +54,8 @@ command cmd-boxed Object -> None
gen=True success_response=True boxed=True oob=False preconfig=False
feature cmd-feat1
feature cmd-feat2
+event EVT-BOXED Object
+ boxed=True
doc freeform
body=
= Section
@@ -170,3 +172,6 @@ If you're bored enough to read this, go see a video of boxed cats
-> in
<- out
+doc symbol=EVT-BOXED
+ body=
+BUG: generated doc misses arguments
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index 2ce8b883c9..d6ecdac94f 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -258,3 +258,11 @@ another feature
@end deftypefn
+
+
+@deftypefn Event {} EVT-BOXED
+
+BUG: generated doc misses arguments
+
+@end deftypefn
+