]> git.proxmox.com Git - mirror_qemu.git/commitdiff
tests/qapi-schema: Demonstrate command and event doc comment bugs
authorMarkus Armbruster <armbru@redhat.com>
Thu, 24 Oct 2019 11:02:20 +0000 (13:02 +0200)
committerMarkus Armbruster <armbru@redhat.com>
Tue, 29 Oct 2019 06:35:16 +0000 (07:35 +0100)
Add negative tests doc-bad-boxed-command-arg and doc-bad-event-arg to
cover boxed and no arguments.  They demonstrate insufficient doc
comment checking.

Update positive test doc-good to cover boxed event arguments.  It
demonstrates the generated doc comment misses arguments.

These bugs will be fixed later in this series.

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

tests/Makefile.include
tests/qapi-schema/doc-bad-boxed-command-arg.err [new file with mode: 0644]
tests/qapi-schema/doc-bad-boxed-command-arg.json [new file with mode: 0644]
tests/qapi-schema/doc-bad-boxed-command-arg.out [new file with mode: 0644]
tests/qapi-schema/doc-bad-event-arg.err [new file with mode: 0644]
tests/qapi-schema/doc-bad-event-arg.json [new file with mode: 0644]
tests/qapi-schema/doc-bad-event-arg.out [new file with mode: 0644]
tests/qapi-schema/doc-good.json
tests/qapi-schema/doc-good.out
tests/qapi-schema/doc-good.texi

index ca2a0cb84fcbb1a0b7020272d32d75a89d554e33..237e5acd279d9d0086978c7b1e2b132694ed50ed 100644 (file)
@@ -341,8 +341,10 @@ qapi-schema += base-cycle-indirect.json
 qapi-schema += command-int.json
 qapi-schema += comments.json
 qapi-schema += doc-bad-alternate-member.json
+qapi-schema += doc-bad-boxed-command-arg.json
 qapi-schema += doc-bad-command-arg.json
 qapi-schema += doc-bad-enum-member.json
+qapi-schema += doc-bad-event-arg.json
 qapi-schema += doc-bad-feature.json
 qapi-schema += doc-bad-section.json
 qapi-schema += doc-bad-symbol.json
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 (file)
index 0000000..e69de29
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 (file)
index 0000000..2c265d2
--- /dev/null
@@ -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 (file)
index 0000000..4ccd788
--- /dev/null
@@ -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 (file)
index 0000000..e69de29
diff --git a/tests/qapi-schema/doc-bad-event-arg.json b/tests/qapi-schema/doc-bad-event-arg.json
new file mode 100644 (file)
index 0000000..80d4e12
--- /dev/null
@@ -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 (file)
index 0000000..ad0367c
--- /dev/null
@@ -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
index 7dc21e58a3ee6fba2029d9e0529c31034b49000d..1ae6c3a9daf9d5d48ed1510c9e7703ecd2c8bd34 100644 (file)
 { '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' }
index f78fdef6a92a17c2f75962d8d1797cc0fae7fede..a8fc39d288e065f6875be1edeb036f02b8036b5d 100644 (file)
@@ -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
index 2ce8b883c92d2c5036c464d1e5ef5ea9a2889f14..d6ecdac94f987089078cce49f2873a2517da2462 100644 (file)
@@ -258,3 +258,11 @@ another feature
 
 @end deftypefn
 
+
+
+@deftypefn Event {} EVT-BOXED
+
+BUG: generated doc misses arguments
+
+@end deftypefn
+