[PATCH 03/16] tests/qapi-schema: Cover 'Features:' not followed by descriptions

Markus Armbruster posted 16 patches 8 months, 2 weeks ago
Maintainers: Markus Armbruster <armbru@redhat.com>, Michael Roth <michael.roth@amd.com>, Peter Maydell <peter.maydell@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, Eric Blake <eblake@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>, Jason Wang <jasowang@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Yuval Shaia <yuval.shaia.ml@gmail.com>, Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru>, Jiri Pirko <jiri@resnulli.us>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Stefan Hajnoczi <stefanha@redhat.com>, Mads Ynddal <mads@ynddal.dk>, Gerd Hoffmann <kraxel@redhat.com>, Lukas Straub <lukasstraub2@web.de>
[PATCH 03/16] tests/qapi-schema: Cover 'Features:' not followed by descriptions
Posted by Markus Armbruster 8 months, 2 weeks ago
A 'Features:' line without any features is useless, but not an error
now.  However, a later commit will make it one, because that makes
rejecting duplicate 'Features:' easier.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/qapi-schema/doc-empty-features.err  |  0
 tests/qapi-schema/doc-empty-features.json | 10 ++++++++++
 tests/qapi-schema/doc-empty-features.out  | 19 +++++++++++++++++++
 tests/qapi-schema/meson.build             |  1 +
 4 files changed, 30 insertions(+)
 create mode 100644 tests/qapi-schema/doc-empty-features.err
 create mode 100644 tests/qapi-schema/doc-empty-features.json
 create mode 100644 tests/qapi-schema/doc-empty-features.out

diff --git a/tests/qapi-schema/doc-empty-features.err b/tests/qapi-schema/doc-empty-features.err
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/tests/qapi-schema/doc-empty-features.json b/tests/qapi-schema/doc-empty-features.json
new file mode 100644
index 0000000000..06f814e45d
--- /dev/null
+++ b/tests/qapi-schema/doc-empty-features.json
@@ -0,0 +1,10 @@
+# 'Features:' line not followed by feature descriptions
+
+##
+# @foo:
+#
+# Features:
+#
+# not a description
+##
+{ 'command': 'foo' }
diff --git a/tests/qapi-schema/doc-empty-features.out b/tests/qapi-schema/doc-empty-features.out
new file mode 100644
index 0000000000..0f85623dde
--- /dev/null
+++ b/tests/qapi-schema/doc-empty-features.out
@@ -0,0 +1,19 @@
+module ./builtin
+object q_empty
+enum QType
+    prefix QTYPE
+    member none
+    member qnull
+    member qnum
+    member qstring
+    member qdict
+    member qlist
+    member qbool
+module doc-empty-features.json
+command foo None -> None
+    gen=True success_response=True boxed=False oob=False preconfig=False
+doc symbol=foo
+    body=
+
+    section=None
+not a description
diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build
index 4c714c792f..4b8329d070 100644
--- a/tests/qapi-schema/meson.build
+++ b/tests/qapi-schema/meson.build
@@ -71,6 +71,7 @@ schemas = [
   'doc-duplicated-return.json',
   'doc-duplicated-since.json',
   'doc-empty-arg.json',
+  'doc-empty-features.json',
   'doc-empty-section.json',
   'doc-empty-symbol.json',
   'doc-good.json',
-- 
2.43.0
Re: [PATCH 03/16] tests/qapi-schema: Cover 'Features:' not followed by descriptions
Posted by Daniel P. Berrangé 8 months, 2 weeks ago
On Fri, Feb 16, 2024 at 03:58:27PM +0100, Markus Armbruster wrote:
> A 'Features:' line without any features is useless, but not an error
> now.  However, a later commit will make it one, because that makes
> rejecting duplicate 'Features:' easier.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>  tests/qapi-schema/doc-empty-features.err  |  0
>  tests/qapi-schema/doc-empty-features.json | 10 ++++++++++
>  tests/qapi-schema/doc-empty-features.out  | 19 +++++++++++++++++++
>  tests/qapi-schema/meson.build             |  1 +
>  4 files changed, 30 insertions(+)
>  create mode 100644 tests/qapi-schema/doc-empty-features.err
>  create mode 100644 tests/qapi-schema/doc-empty-features.json
>  create mode 100644 tests/qapi-schema/doc-empty-features.out

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|