diff options
author | Marc-André Lureau | 2018-12-13 13:37:22 +0100 |
---|---|---|
committer | Markus Armbruster | 2018-12-14 06:52:48 +0100 |
commit | 01ae9cc2544f03299bb8b9923dec5da3d94f7c57 (patch) | |
tree | 19d2cf1fc7ed259d536f225b97c528a5b78cc783 /tests/qapi-schema | |
parent | qapi: add 'If:' condition to struct members documentation (diff) | |
download | qemu-01ae9cc2544f03299bb8b9923dec5da3d94f7c57.tar.gz qemu-01ae9cc2544f03299bb8b9923dec5da3d94f7c57.tar.xz qemu-01ae9cc2544f03299bb8b9923dec5da3d94f7c57.zip |
qapi: add condition to variants documentation
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20181213123724.4866-21-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/qapi-schema')
-rw-r--r-- | tests/qapi-schema/doc-good.json | 4 | ||||
-rw-r--r-- | tests/qapi-schema/doc-good.out | 3 | ||||
-rw-r--r-- | tests/qapi-schema/doc-good.texi | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json index 28992fc615..f7fb48af38 100644 --- a/tests/qapi-schema/doc-good.json +++ b/tests/qapi-schema/doc-good.json @@ -86,13 +86,13 @@ { 'union': 'Object', 'base': 'Base', 'discriminator': 'base1', - 'data': { 'one': 'Variant1', 'two': 'Variant2' } } + 'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } } ## # @SugaredUnion: ## { 'union': 'SugaredUnion', - 'data': { 'one': 'Variant1', 'two': 'Variant2' } } + 'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } } ## # == Another subsection diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out index 4ab55683ce..21bf345ff0 100644 --- a/tests/qapi-schema/doc-good.out +++ b/tests/qapi-schema/doc-good.out @@ -25,6 +25,7 @@ object Object tag base1 case one: Variant1 case two: Variant2 + if ['IFTWO'] object q_obj_Variant1-wrapper member data: Variant1 optional=False object q_obj_Variant2-wrapper @@ -32,11 +33,13 @@ object q_obj_Variant2-wrapper enum SugaredUnionKind member one member two + if ['IFTWO'] object SugaredUnion member type: SugaredUnionKind optional=False tag type case one: q_obj_Variant1-wrapper case two: q_obj_Variant2-wrapper + if ['IFTWO'] object q_obj_cmd-arg member arg1: int optional=False member arg2: str optional=True diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi index f87f9faacb..2526abc6d9 100644 --- a/tests/qapi-schema/doc-good.texi +++ b/tests/qapi-schema/doc-good.texi @@ -142,7 +142,7 @@ Not documented @table @asis @item The members of @code{Base} @item The members of @code{Variant1} when @code{base1} is @t{"one"} -@item The members of @code{Variant2} when @code{base1} is @t{"two"} +@item The members of @code{Variant2} when @code{base1} is @t{"two"} (@b{If:} @code{IFTWO}) @end table @end deftp @@ -158,7 +158,7 @@ Not documented @item @code{type} One of @t{"one"}, @t{"two"} @item @code{data: Variant1} when @code{type} is @t{"one"} -@item @code{data: Variant2} when @code{type} is @t{"two"} +@item @code{data: Variant2} when @code{type} is @t{"two"} (@b{If:} @code{IFTWO}) @end table @end deftp |