From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: kwolf@redhat.com, pkrempa@redhat.com, mdroth@linux.vnet.ibm.com
Subject: [PATCH 01/19] tests/qapi-schema: Demonstrate feature and enum doc comment bugs
Date: Thu, 24 Oct 2019 13:02:19 +0200 [thread overview]
Message-ID: <20191024110237.30963-2-armbru@redhat.com> (raw)
In-Reply-To: <20191024110237.30963-1-armbru@redhat.com>
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>
---
tests/Makefile.include | 3 +++
tests/qapi-schema/doc-bad-enum-member.err | 0
tests/qapi-schema/doc-bad-enum-member.json | 9 +++++++++
tests/qapi-schema/doc-bad-enum-member.out | 21 +++++++++++++++++++++
tests/qapi-schema/doc-bad-feature.err | 0
tests/qapi-schema/doc-bad-feature.json | 10 ++++++++++
tests/qapi-schema/doc-bad-feature.out | 17 +++++++++++++++++
tests/qapi-schema/doc-undoc-feature.err | 0
tests/qapi-schema/doc-undoc-feature.json | 10 ++++++++++
tests/qapi-schema/doc-undoc-feature.out | 19 +++++++++++++++++++
10 files changed, 89 insertions(+)
create mode 100644 tests/qapi-schema/doc-bad-enum-member.err
create mode 100644 tests/qapi-schema/doc-bad-enum-member.json
create mode 100644 tests/qapi-schema/doc-bad-enum-member.out
create mode 100644 tests/qapi-schema/doc-bad-feature.err
create mode 100644 tests/qapi-schema/doc-bad-feature.json
create mode 100644 tests/qapi-schema/doc-bad-feature.out
create mode 100644 tests/qapi-schema/doc-undoc-feature.err
create mode 100644 tests/qapi-schema/doc-undoc-feature.json
create mode 100644 tests/qapi-schema/doc-undoc-feature.out
diff --git a/tests/Makefile.include b/tests/Makefile.include
index 09e5b410dc..b9deb131fb 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -342,6 +342,8 @@ qapi-schema += command-int.json
qapi-schema += comments.json
qapi-schema += doc-bad-alternate-member.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-symbol.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.json
qapi-schema += doc-no-symbol.json
+qapi-schema += doc-undoc-feature.json
qapi-schema += double-type.json
qapi-schema += duplicate-key.json
qapi-schema += empty.json
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
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
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
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=
+
--
2.21.0
next prev parent reply other threads:[~2019-10-24 11:05 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-24 11:02 [PATCH 00/19] qapi: Doc generation fixes Markus Armbruster
2019-10-24 11:02 ` Markus Armbruster [this message]
2019-10-24 11:02 ` [PATCH 02/19] tests/qapi-schema: Demonstrate command and event doc comment bugs Markus Armbruster
2019-10-24 11:02 ` [PATCH 03/19] tests/qapi-schema: Cover alternate documentation comments Markus Armbruster
2019-10-24 11:02 ` [PATCH 04/19] tests/qapi-schema: Fix feature documentation testing Markus Armbruster
2019-10-24 11:02 ` [PATCH 05/19] qemu-doc: Belatedly document QMP command deprecation Markus Armbruster
2019-10-24 11:02 ` [PATCH 06/19] qapi: Implement boxed event argument documentation Markus Armbruster
2019-10-24 11:02 ` [PATCH 07/19] qapi: De-duplicate entity documentation generation code Markus Armbruster
2019-10-24 11:02 ` [PATCH 08/19] qapi: Split .connect_doc(), .check_doc() off .check() Markus Armbruster
2019-10-24 11:02 ` [PATCH 09/19] qapi: Fix enum doc comment checking Markus Armbruster
2019-10-24 11:02 ` [PATCH 10/19] qapi: Clean up doc comment checking for implicit union base Markus Armbruster
2019-10-24 11:02 ` [PATCH 11/19] qapi: Fix doc comment checking for commands and events Markus Armbruster
2019-10-24 11:02 ` [PATCH 12/19] qapi: Simplify ._make_implicit_object_type() Markus Armbruster
2019-10-24 11:02 ` [PATCH 13/19] qapi: Eliminate .check_doc() overrides Markus Armbruster
2019-10-24 11:02 ` [PATCH 14/19] qapi: Fold normalize_if() into check_if() Markus Armbruster
2019-10-24 11:02 ` [PATCH 15/19] qapi: Fold normalize_features() into check_features() Markus Armbruster
2019-10-24 11:02 ` [PATCH 16/19] qapi: Fold normalize_enum() into check_enum() Markus Armbruster
2019-10-24 11:02 ` [PATCH 17/19] qapi: Lift features into QAPISchemaEntity Markus Armbruster
2019-10-24 11:02 ` [PATCH 18/19] qapi: Polish reporting of bogus member documentation Markus Armbruster
2019-10-24 11:02 ` [PATCH 19/19] qapi: Check feature documentation against the schema Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191024110237.30963-2-armbru@redhat.com \
--to=armbru@redhat.com \
--cc=kwolf@redhat.com \
--cc=mdroth@linux.vnet.ibm.com \
--cc=pkrempa@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).