aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/qapi/schema.py4
-rw-r--r--tests/qapi-schema/doc-bad-enum-member.err1
-rw-r--r--tests/qapi-schema/doc-bad-enum-member.json1
-rw-r--r--tests/qapi-schema/doc-bad-enum-member.out21
4 files changed, 5 insertions, 22 deletions
diff --git a/scripts/qapi/schema.py b/scripts/qapi/schema.py
index 9b62c8d74d..0381e3cb40 100644
--- a/scripts/qapi/schema.py
+++ b/scripts/qapi/schema.py
@@ -229,6 +229,10 @@ class QAPISchemaEnumType(QAPISchemaType):
for m in self.members:
self.doc.connect_member(m)
+ def check_doc(self):
+ if self.doc:
+ self.doc.check()
+
def is_implicit(self):
# See QAPISchema._make_implicit_enum_type() and ._def_predefineds()
return self.name.endswith('Kind') or self.name == 'QType'
diff --git a/tests/qapi-schema/doc-bad-enum-member.err b/tests/qapi-schema/doc-bad-enum-member.err
index e69de29bb2..dfa1e786d7 100644
--- a/tests/qapi-schema/doc-bad-enum-member.err
+++ b/tests/qapi-schema/doc-bad-enum-member.err
@@ -0,0 +1 @@
+doc-bad-enum-member.json:3: the following documented members are not in the declaration: a
diff --git a/tests/qapi-schema/doc-bad-enum-member.json b/tests/qapi-schema/doc-bad-enum-member.json
index 9f32fe64b4..9cab35c6e8 100644
--- a/tests/qapi-schema/doc-bad-enum-member.json
+++ b/tests/qapi-schema/doc-bad-enum-member.json
@@ -1,5 +1,4 @@
# Members listed in the doc comment must exist in the actual schema
-# BUG: nonexistent @a is not rejected
##
# @Foo:
diff --git a/tests/qapi-schema/doc-bad-enum-member.out b/tests/qapi-schema/doc-bad-enum-member.out
index 6ca31c1e9b..e69de29bb2 100644
--- a/tests/qapi-schema/doc-bad-enum-member.out
+++ b/tests/qapi-schema/doc-bad-enum-member.out
@@ -1,21 +0,0 @@
-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