]> git.proxmox.com Git - mirror_qemu.git/commit
qapi: Make doc comments optional where we don't need them
authorMarkus Armbruster <armbru@redhat.com>
Wed, 15 Mar 2017 12:56:51 +0000 (13:56 +0100)
committerMarkus Armbruster <armbru@redhat.com>
Thu, 16 Mar 2017 06:13:01 +0000 (07:13 +0100)
commitbc52d03ff589a033843b4603cfdfd1518867c626
tree8196974ce1a4777947853ad331a97e5834bb19fc
parente04dea88727c2ac97091333ac8be6af5952634a7
qapi: Make doc comments optional where we don't need them

Since we added the documentation generator in commit 3313b61, doc
comments are mandatory.  That's a very good idea for a schema that
needs to be documented, but has proven to be annoying for testing.

Make doc comments optional again, but add a new directive

    { 'pragma': { 'doc-required': true } }

to let a QAPI schema require them.

Add test cases for the new pragma directive.  While there, plug a
minor hole in includ directive test coverage.

Require documentation in the schemas we actually want documented:
qapi-schema.json and qga/qapi-schema.json.

We could probably make qapi2texi.py cope with incomplete
documentation, but for now, simply make it refuse to run unless the
schema has 'doc-required': true.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <1489582656-31133-3-git-send-email-armbru@redhat.com>
[qapi-code-gen.txt wording tweaked]
Reviewed-by: Eric Blake <eblake@redhat.com>
26 files changed:
docs/qapi-code-gen.txt
qapi-schema.json
qga/qapi-schema.json
scripts/qapi.py
scripts/qapi2texi.py
tests/Makefile.include
tests/qapi-schema/doc-missing.err [new file with mode: 0644]
tests/qapi-schema/doc-missing.exit [new file with mode: 0644]
tests/qapi-schema/doc-missing.json [new file with mode: 0644]
tests/qapi-schema/doc-missing.out [new file with mode: 0644]
tests/qapi-schema/include-extra-junk.err [new file with mode: 0644]
tests/qapi-schema/include-extra-junk.exit [new file with mode: 0644]
tests/qapi-schema/include-extra-junk.json [new file with mode: 0644]
tests/qapi-schema/include-extra-junk.out [new file with mode: 0644]
tests/qapi-schema/pragma-doc-required-crap.err [new file with mode: 0644]
tests/qapi-schema/pragma-doc-required-crap.exit [new file with mode: 0644]
tests/qapi-schema/pragma-doc-required-crap.json [new file with mode: 0644]
tests/qapi-schema/pragma-doc-required-crap.out [new file with mode: 0644]
tests/qapi-schema/pragma-extra-junk.err [new file with mode: 0644]
tests/qapi-schema/pragma-extra-junk.exit [new file with mode: 0644]
tests/qapi-schema/pragma-extra-junk.json [new file with mode: 0644]
tests/qapi-schema/pragma-extra-junk.out [new file with mode: 0644]
tests/qapi-schema/pragma-non-dict.err [new file with mode: 0644]
tests/qapi-schema/pragma-non-dict.exit [new file with mode: 0644]
tests/qapi-schema/pragma-non-dict.json [new file with mode: 0644]
tests/qapi-schema/pragma-non-dict.out [new file with mode: 0644]