All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests
@ 2017-03-20 13:11 Markus Armbruster
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py Markus Armbruster
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Code changes only in QAPI generator scripts and tests.  Generated code
is identical.  Generated documentation is improved slightly.

Markus Armbruster (6):
  qapi: Drop excessive Make dependencies on qapi2texi.py
  qapi2texi: Fix to actually fail when 'doc-required' is false
  qapi: Drop unused QAPIDoc member optional
  tests/qapi-schema: Make test-qapi.py print docs again
  tests/qapi-schema: Systematic positive doc comment tests
  qapi2texi: Fix translation of *strong* and _emphasized_

 Makefile                        |   7 +-
 scripts/qapi.py                 |   1 -
 scripts/qapi2texi.py            |   5 +-
 tests/Makefile.include          |  13 ++-
 tests/qapi-schema/doc-good.err  |   0
 tests/qapi-schema/doc-good.exit |   1 +
 tests/qapi-schema/doc-good.json | 136 ++++++++++++++++++++++
 tests/qapi-schema/doc-good.out  | 148 ++++++++++++++++++++++++
 tests/qapi-schema/doc-good.texi | 243 ++++++++++++++++++++++++++++++++++++++++
 tests/qapi-schema/test-qapi.py  |  11 ++
 10 files changed, 555 insertions(+), 10 deletions(-)
 create mode 100644 tests/qapi-schema/doc-good.err
 create mode 100644 tests/qapi-schema/doc-good.exit
 create mode 100644 tests/qapi-schema/doc-good.json
 create mode 100644 tests/qapi-schema/doc-good.out
 create mode 100644 tests/qapi-schema/doc-good.texi

-- 
2.7.4

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:17   ` Marc-André Lureau
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false Markus Armbruster
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

When qapi2texi.py changes, we regenerate everything QAPI.  Screwed up
in commit 56e8bdd.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 73e0c12..14d3e55 100644
--- a/Makefile
+++ b/Makefile
@@ -391,7 +391,6 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
 gen-out-type = $(subst .,-,$(suffix $@))
 
 qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
-qapi-py += $(SRC_PATH)/scripts/qapi2texi.py
 
 qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
 $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py $(qapi-py)
@@ -700,10 +699,12 @@ qemu-monitor-info.texi: $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
 qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
 	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
 
-docs/qemu-qmp-qapi.texi: $(qapi-modules) $(qapi-py)
+docs/qemu-qmp-qapi.texi docs/qemu-ga-qapi.texi: $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
+
+docs/qemu-qmp-qapi.texi: $(qapi-modules)
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
 
-docs/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
+docs/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
 	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
 
 qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi qemu-monitor-info.texi
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:18   ` Marc-André Lureau
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional Markus Armbruster
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Messed up in commit bc52d03.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi2texi.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 8eed11a..5c4db78 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -292,6 +292,7 @@ def main(argv):
     if not qapi.doc_required:
         print >>sys.stderr, ("%s: need pragma 'doc-required' "
                              "to generate documentation" % argv[0])
+        sys.exit(1)
     print texi_schema(schema)
 
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py Markus Armbruster
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:24   ` Marc-André Lureau
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again Markus Armbruster
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Unused since commit aa964b7 "qapi2texi: Convert to QAPISchemaVisitor"

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi.py | 1 -
 1 file changed, 1 deletion(-)

diff --git a/scripts/qapi.py b/scripts/qapi.py
index e88c047..6c4d554 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -106,7 +106,6 @@ class QAPIDoc(object):
             self.name = name
             # the list of lines for this section
             self.content = []
-            self.optional = False
 
         def append(self, line):
             self.content.append(line)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
                   ` (2 preceding siblings ...)
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:27   ` Marc-André Lureau
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests Markus Armbruster
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

test-qapi.py used to print the internal representation of doc comments
(commit 3313b61).  This went away when we dropped the doc comments in
positive tests (commit 87c16dc).  Bring it back, because I'm going to
add real positive doc comment tests.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/qapi-schema/test-qapi.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
index ef74e2c..c7724d3 100644
--- a/tests/qapi-schema/test-qapi.py
+++ b/tests/qapi-schema/test-qapi.py
@@ -55,3 +55,14 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
 
 schema = QAPISchema(sys.argv[1])
 schema.visit(QAPISchemaTestVisitor())
+
+for doc in schema.docs:
+    if doc.symbol:
+        print 'doc symbol=%s' % doc.symbol
+    else:
+        print 'doc freeform'
+    print '    body=\n%s' % doc.body
+    for arg, section in doc.args.iteritems():
+        print '    arg=%s\n%s' % (arg, section)
+    for section in doc.sections:
+        print '    section=%s\n%s' % (section.name, section)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
                   ` (3 preceding siblings ...)
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:28   ` Marc-André Lureau
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_ Markus Armbruster
  2017-03-28 13:24 ` [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests no-reply
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

We have a number of negative tests, but we don't have systematic
positive coverage.  Fix that.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 tests/Makefile.include          |  13 ++-
 tests/qapi-schema/doc-good.err  |   0
 tests/qapi-schema/doc-good.exit |   1 +
 tests/qapi-schema/doc-good.json | 136 ++++++++++++++++++++++
 tests/qapi-schema/doc-good.out  | 148 ++++++++++++++++++++++++
 tests/qapi-schema/doc-good.texi | 243 ++++++++++++++++++++++++++++++++++++++++
 6 files changed, 537 insertions(+), 4 deletions(-)
 create mode 100644 tests/qapi-schema/doc-good.err
 create mode 100644 tests/qapi-schema/doc-good.exit
 create mode 100644 tests/qapi-schema/doc-good.json
 create mode 100644 tests/qapi-schema/doc-good.out
 create mode 100644 tests/qapi-schema/doc-good.texi

diff --git a/tests/Makefile.include b/tests/Makefile.include
index 402e71c..8b497c5 100644
--- a/tests/Makefile.include
+++ b/tests/Makefile.include
@@ -379,6 +379,7 @@ qapi-schema += doc-duplicated-since.json
 qapi-schema += doc-empty-arg.json
 qapi-schema += doc-empty-section.json
 qapi-schema += doc-empty-symbol.json
+qapi-schema += doc-good.json
 qapi-schema += doc-interleaved-section.json
 qapi-schema += doc-invalid-end.json
 qapi-schema += doc-invalid-end2.json
@@ -607,6 +608,9 @@ $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json $(SRC_PATH)/scripts/qapi-int
 		$(gen-out-type) -o tests -p "test-" $<, \
 		"GEN","$@")
 
+tests/qapi-schema/doc-good.test.texi: $(SRC_PATH)/tests/qapi-schema/doc-good.json $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
+	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< > $@,"GEN","$@")
+
 tests/test-string-output-visitor$(EXESUF): tests/test-string-output-visitor.o $(test-qapi-obj-y)
 tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o $(test-qapi-obj-y)
 tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y)
@@ -856,9 +860,6 @@ QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXE
 check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
 	$<
 
-.PHONY: check-tests/test-qapi.py
-check-tests/test-qapi.py: tests/test-qapi.py
-
 .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
 $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
 	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
@@ -871,10 +872,14 @@ $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json: $(SRC_PATH)/%.json
 	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q $(SRC_PATH)/$*.err -
 	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
 
+.PHONY: check-tests/qapi-schema/doc-good.texi
+check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
+	@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
+
 # Consolidated targets
 
 .PHONY: check-qapi-schema check-qtest check-unit check check-clean
-check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
+check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y)) check-tests/qapi-schema/doc-good.texi
 check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
 check-unit: $(patsubst %,check-%, $(check-unit-y))
 check-block: $(patsubst %,check-%, $(check-block-y))
diff --git a/tests/qapi-schema/doc-good.err b/tests/qapi-schema/doc-good.err
new file mode 100644
index 0000000..e69de29
diff --git a/tests/qapi-schema/doc-good.exit b/tests/qapi-schema/doc-good.exit
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/tests/qapi-schema/doc-good.exit
@@ -0,0 +1 @@
+0
diff --git a/tests/qapi-schema/doc-good.json b/tests/qapi-schema/doc-good.json
new file mode 100644
index 0000000..cfdc0a8
--- /dev/null
+++ b/tests/qapi-schema/doc-good.json
@@ -0,0 +1,136 @@
+# -*- Mode: Python -*-
+# Positive QAPI doc comment tests
+
+{ 'pragma': { 'doc-required': true } }
+
+##
+# = Section
+#
+# == Subsection
+#
+# *strong* _with emphasis_
+# @var {in braces}
+# * List item one
+# - Two, multiple
+#   lines
+#
+# 3. Three
+# Still in list
+#
+#   Not in list
+# - Second list
+# Note: still in list
+#
+# Note: not in list
+# 1. Third list
+#    is numbered
+#
+# - another item
+#
+# | example
+# | multiple lines
+#
+# Returns: the King
+# Since: the first age
+# Notes:
+#
+# 1. Lorem ipsum dolor sit amet
+#
+# 2. Ut enim ad minim veniam
+#
+# Duis aute irure dolor
+#
+# Example:
+#
+# -> in
+# <- out
+# Examples:
+# - *verbatim*
+# - {braces}
+##
+
+##
+# @Enum:
+# == Produces *invalid* texinfo
+# @one: The _one_ {and only}
+#
+# @two is undocumented
+##
+{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
+
+##
+# @Base:
+# @base1:
+#   the first member
+##
+{ 'struct': 'Base', 'data': { 'base1': 'Enum' } }
+
+##
+# @Variant1:
+# A paragraph
+#
+# Another paragraph (but no @var: line)
+##
+{ 'struct': 'Variant1', 'data': { 'var1': 'str' } }
+
+##
+# @Variant2:
+##
+{ 'struct': 'Variant2', 'data': {} }
+
+##
+# @Object:
+##
+{ 'union': 'Object',
+  'base': 'Base',
+  'discriminator': 'base1',
+  'data': { 'one': 'Variant1', 'two': 'Variant2' } }
+
+##
+# @SugaredUnion:
+##
+{ 'union': 'SugaredUnion',
+  'data': { 'one': 'Variant1', 'two': 'Variant2' } }
+
+##
+# == Another subsection
+##
+
+##
+# @cmd:
+# @arg1: the first argument
+#
+# @arg2: the second
+# argument
+# Note: @arg3 is undocumented
+# Returns: @Object
+# TODO: frobnicate
+# Notes:
+# - Lorem ipsum dolor sit amet
+# - Ut enim ad minim veniam
+#
+# Duis aute irure dolor
+# Example:
+#
+# -> in
+# <- out
+# Examples:
+# - *verbatim*
+# - {braces}
+# Since: 2.10
+##
+{ 'command': 'cmd',
+  'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
+  'returns': 'Object' }
+
+##
+# @cmd-boxed:
+# If you're bored enough to read this, go see a video of boxed cats
+# Example:
+#
+# -> in
+#
+# <- out
+##
+{ 'command': 'cmd-boxed', 'boxed': true,
+  'data': 'Object' }
diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
new file mode 100644
index 0000000..70c1252
--- /dev/null
+++ b/tests/qapi-schema/doc-good.out
@@ -0,0 +1,148 @@
+object Base
+    member base1: Enum optional=False
+enum Enum ['one', 'two']
+object Object
+    base Base
+    tag base1
+    case one: Variant1
+    case two: Variant2
+enum QType ['none', 'qnull', 'qint', 'qstring', 'qdict', 'qlist', 'qfloat', 'qbool']
+    prefix QTYPE
+object SugaredUnion
+    member type: SugaredUnionKind optional=False
+    tag type
+    case one: q_obj_Variant1-wrapper
+    case two: q_obj_Variant2-wrapper
+enum SugaredUnionKind ['one', 'two']
+object Variant1
+    member var1: str optional=False
+object Variant2
+command cmd q_obj_cmd-arg -> Object
+   gen=True success_response=True boxed=False
+command cmd-boxed Object -> None
+   gen=True success_response=True boxed=True
+object q_empty
+object q_obj_Variant1-wrapper
+    member data: Variant1 optional=False
+object q_obj_Variant2-wrapper
+    member data: Variant2 optional=False
+object q_obj_cmd-arg
+    member arg1: int optional=False
+    member arg2: str optional=True
+    member arg3: bool optional=False
+doc freeform
+    body=
+= Section
+
+== Subsection
+
+*strong* _with emphasis_
+@var {in braces}
+* List item one
+- Two, multiple
+lines
+
+3. Three
+Still in list
+
+Not in list
+- Second list
+Note: still in list
+
+Note: not in list
+1. Third list
+is numbered
+
+- another item
+
+| example
+| multiple lines
+
+Returns: the King
+Since: the first age
+Notes:
+
+1. Lorem ipsum dolor sit amet
+
+2. Ut enim ad minim veniam
+
+Duis aute irure dolor
+
+Example:
+
+-> in
+<- out
+Examples:
+- *verbatim*
+- {braces}
+doc symbol=Enum
+    body=
+== Produces *invalid* texinfo
+    arg=one
+The _one_ {and only}
+    arg=two
+
+    section=
+@two is undocumented
+doc symbol=Base
+    body=
+
+    arg=base1
+the first member
+doc symbol=Variant1
+    body=
+A paragraph
+
+Another paragraph (but no @var: line)
+    arg=var1
+
+doc symbol=Variant2
+    body=
+
+doc symbol=Object
+    body=
+
+doc symbol=SugaredUnion
+    body=
+
+    arg=type
+
+doc freeform
+    body=
+== Another subsection
+doc symbol=cmd
+    body=
+
+    arg=arg1
+the first argument
+    arg=arg2
+the second
+argument
+    arg=arg3
+
+    section=Note
+@arg3 is undocumented
+    section=Returns
+@Object
+    section=TODO
+frobnicate
+    section=Notes
+- Lorem ipsum dolor sit amet
+- Ut enim ad minim veniam
+
+Duis aute irure dolor
+    section=Example
+-> in
+<- out
+    section=Examples
+- *verbatim*
+- {braces}
+    section=Since
+2.10
+doc symbol=cmd-boxed
+    body=
+If you're bored enough to read this, go see a video of boxed cats
+    section=Example
+-> in
+
+<- out
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
new file mode 100644
index 0000000..1160aaf
--- /dev/null
+++ b/tests/qapi-schema/doc-good.texi
@@ -0,0 +1,243 @@
+@section Section
+
+@subsection Subsection
+
+@emph{strong}  @emph{with emphasis} 
+@code{var} @{in braces@}
+@itemize @bullet
+@item
+List item one
+@item
+Two, multiple
+lines
+
+@item
+Three
+Still in list
+
+@end itemize
+
+Not in list
+@itemize @minus
+@item
+Second list
+Note: still in list
+
+@end itemize
+
+Note: not in list
+@enumerate
+@item
+Third list
+is numbered
+
+@item
+another item
+
+@example
+example
+@end example
+
+@example
+multiple lines
+@end example
+
+
+@end enumerate
+
+Returns: the King
+Since: the first age
+Notes:
+
+@enumerate
+@item
+Lorem ipsum dolor sit amet
+
+@item
+Ut enim ad minim veniam
+
+@end enumerate
+
+Duis aute irure dolor
+
+Example:
+
+-> in
+<- out
+Examples:
+@itemize @minus
+@item
+@emph{verbatim}
+@item
+@{braces@}
+@end itemize
+
+
+
+@deftp {Enum} Enum
+
+@subsection Produces @emph{invalid} texinfo
+
+@b{Values:}
+@table @asis
+@item @code{one}
+The  @emph{one}  @{and only@}
+@item @code{two}
+Not documented
+@end table
+@code{two} is undocumented
+
+@end deftp
+
+
+
+@deftp {Object} Base
+
+
+
+@b{Members:}
+@table @asis
+@item @code{base1: Enum}
+the first member
+@end table
+
+
+@end deftp
+
+
+
+@deftp {Object} Variant1
+
+A paragraph
+
+Another paragraph (but no @code{var}: line)
+
+@b{Members:}
+@table @asis
+@item @code{var1: string}
+Not documented
+@end table
+
+
+@end deftp
+
+
+
+@deftp {Object} Variant2
+
+
+
+
+@end deftp
+
+
+
+@deftp {Object} Object
+
+
+
+@b{Members:}
+@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"}
+@end table
+
+
+@end deftp
+
+
+
+@deftp {Object} SugaredUnion
+
+
+
+@b{Members:}
+@table @asis
+@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"}
+@end table
+
+
+@end deftp
+
+
+@subsection Another subsection
+
+
+@deftypefn Command {} cmd
+
+
+
+@b{Arguments:}
+@table @asis
+@item @code{arg1: int}
+the first argument
+@item @code{arg2: string} (optional)
+the second
+argument
+@item @code{arg3: boolean}
+Not documented
+@end table
+
+
+@b{Note:}
+@code{arg3} is undocumented
+
+@b{Returns:}
+@code{Object}
+
+@b{TODO:}
+frobnicate
+
+@b{Notes:}
+@itemize @minus
+@item
+Lorem ipsum dolor sit amet
+@item
+Ut enim ad minim veniam
+
+@end itemize
+
+Duis aute irure dolor
+
+@b{Example:}
+@example
+-> in
+<- out
+@end example
+
+
+@b{Examples:}
+@example
+- *verbatim*
+- @{braces@}
+@end example
+
+
+@b{Since:}
+2.10
+
+@end deftypefn
+
+
+
+@deftypefn Command {} cmd-boxed
+
+If you're bored enough to read this, go see a video of boxed cats
+
+@b{Arguments:} the members of @code{Object}
+
+@b{Example:}
+@example
+-> in
+
+<- out
+@end example
+
+
+@end deftypefn
+
+
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
                   ` (4 preceding siblings ...)
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests Markus Armbruster
@ 2017-03-20 13:11 ` Markus Armbruster
  2017-03-20 13:32   ` Marc-André Lureau
  2017-03-28 13:24 ` [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests no-reply
  6 siblings, 1 reply; 18+ messages in thread
From: Markus Armbruster @ 2017-03-20 13:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: marcandre.lureau, eblake, mdroth

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 scripts/qapi2texi.py            | 4 ++--
 tests/qapi-schema/doc-good.texi | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
index 5c4db78..9e01500 100755
--- a/scripts/qapi2texi.py
+++ b/scripts/qapi2texi.py
@@ -35,12 +35,12 @@ EXAMPLE_FMT = """@example
 
 def subst_strong(doc):
     """Replaces *foo* by @strong{foo}"""
-    return re.sub(r'\*([^*\n]+)\*', r'@emph{\1}', doc)
+    return re.sub(r'\*([^*\n]+)\*', r'@strong{\1}', doc)
 
 
 def subst_emph(doc):
     """Replaces _foo_ by @emph{foo}"""
-    return re.sub(r'\b_([^_\n]+)_\b', r' @emph{\1} ', doc)
+    return re.sub(r'\b_([^_\n]+)_\b', r'@emph{\1}', doc)
 
 
 def subst_vars(doc):
diff --git a/tests/qapi-schema/doc-good.texi b/tests/qapi-schema/doc-good.texi
index 1160aaf..c410626 100644
--- a/tests/qapi-schema/doc-good.texi
+++ b/tests/qapi-schema/doc-good.texi
@@ -2,7 +2,7 @@
 
 @subsection Subsection
 
-@emph{strong}  @emph{with emphasis} 
+@strong{strong} @emph{with emphasis}
 @code{var} @{in braces@}
 @itemize @bullet
 @item
@@ -67,7 +67,7 @@ Example:
 Examples:
 @itemize @minus
 @item
-@emph{verbatim}
+@strong{verbatim}
 @item
 @{braces@}
 @end itemize
@@ -76,12 +76,12 @@ Examples:
 
 @deftp {Enum} Enum
 
-@subsection Produces @emph{invalid} texinfo
+@subsection Produces @strong{invalid} texinfo
 
 @b{Values:}
 @table @asis
 @item @code{one}
-The  @emph{one}  @{and only@}
+The @emph{one} @{and only@}
 @item @code{two}
 Not documented
 @end table
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py Markus Armbruster
@ 2017-03-20 13:17   ` Marc-André Lureau
  0 siblings, 0 replies; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:17 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> When qapi2texi.py changes, we regenerate everything QAPI.  Screwed up
> in commit 56e8bdd.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  Makefile | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 73e0c12..14d3e55 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -391,7 +391,6 @@ qemu-ga$(EXESUF): QEMU_CFLAGS += -I qga/qapi-generated
>  gen-out-type = $(subst .,-,$(suffix $@))
>  
>  qapi-py = $(SRC_PATH)/scripts/qapi.py $(SRC_PATH)/scripts/ordereddict.py
> -qapi-py += $(SRC_PATH)/scripts/qapi2texi.py
>  
>  qga/qapi-generated/qga-qapi-types.c qga/qapi-generated/qga-qapi-types.h :\
>  $(SRC_PATH)/qga/qapi-schema.json $(SRC_PATH)/scripts/qapi-types.py
>  $(qapi-py)
> @@ -700,10 +699,12 @@ qemu-monitor-info.texi:
> $(SRC_PATH)/hmp-commands-info.hx $(SRC_PATH)/scripts/hxt
>  qemu-img-cmds.texi: $(SRC_PATH)/qemu-img-cmds.hx $(SRC_PATH)/scripts/hxtool
>  	$(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -t < $< > $@,"GEN","$@")
>  
> -docs/qemu-qmp-qapi.texi: $(qapi-modules) $(qapi-py)
> +docs/qemu-qmp-qapi.texi docs/qemu-ga-qapi.texi:
> $(SRC_PATH)/scripts/qapi2texi.py $(qapi-py)
> +
> +docs/qemu-qmp-qapi.texi: $(qapi-modules)
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< >
>  	$@,"GEN","$@")
>  
> -docs/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json $(qapi-py)
> +docs/qemu-ga-qapi.texi: $(SRC_PATH)/qga/qapi-schema.json
>  	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< >
>  	$@,"GEN","$@")
>  
>  qemu.1: qemu-doc.texi qemu-options.texi qemu-monitor.texi
>  qemu-monitor-info.texi
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false Markus Armbruster
@ 2017-03-20 13:18   ` Marc-André Lureau
  0 siblings, 0 replies; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:18 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> Messed up in commit bc52d03.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  scripts/qapi2texi.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
> index 8eed11a..5c4db78 100755
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi2texi.py
> @@ -292,6 +292,7 @@ def main(argv):
>      if not qapi.doc_required:
>          print >>sys.stderr, ("%s: need pragma 'doc-required' "
>                               "to generate documentation" % argv[0])
> +        sys.exit(1)
>      print texi_schema(schema)
>  
>  
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional Markus Armbruster
@ 2017-03-20 13:24   ` Marc-André Lureau
  0 siblings, 0 replies; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:24 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> Unused since commit aa964b7 "qapi2texi: Convert to QAPISchemaVisitor"
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  scripts/qapi.py | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/scripts/qapi.py b/scripts/qapi.py
> index e88c047..6c4d554 100644
> --- a/scripts/qapi.py
> +++ b/scripts/qapi.py
> @@ -106,7 +106,6 @@ class QAPIDoc(object):
>              self.name = name
>              # the list of lines for this section
>              self.content = []
> -            self.optional = False
>  
>          def append(self, line):
>              self.content.append(line)
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again Markus Armbruster
@ 2017-03-20 13:27   ` Marc-André Lureau
  2017-03-21  7:18     ` Markus Armbruster
  0 siblings, 1 reply; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:27 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> test-qapi.py used to print the internal representation of doc comments
> (commit 3313b61).  This went away when we dropped the doc comments in
> positive tests (commit 87c16dc).  Bring it back, because I'm going to
> add real positive doc comment tests.

Yup, as I pointed out in the previous series, but since you biring it back modified:


> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

> ---
>  tests/qapi-schema/test-qapi.py | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/tests/qapi-schema/test-qapi.py b/tests/qapi-schema/test-qapi.py
> index ef74e2c..c7724d3 100644
> --- a/tests/qapi-schema/test-qapi.py
> +++ b/tests/qapi-schema/test-qapi.py
> @@ -55,3 +55,14 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
>  
>  schema = QAPISchema(sys.argv[1])
>  schema.visit(QAPISchemaTestVisitor())
> +
> +for doc in schema.docs:
> +    if doc.symbol:
> +        print 'doc symbol=%s' % doc.symbol
> +    else:
> +        print 'doc freeform'
> +    print '    body=\n%s' % doc.body
> +    for arg, section in doc.args.iteritems():
> +        print '    arg=%s\n%s' % (arg, section)
> +    for section in doc.sections:
> +        print '    section=%s\n%s' % (section.name, section)
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests Markus Armbruster
@ 2017-03-20 13:28   ` Marc-André Lureau
  2017-03-21  7:19     ` Markus Armbruster
  0 siblings, 1 reply; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:28 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> We have a number of negative tests, but we don't have systematic
> positive coverage.  Fix that.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

didn't test it, but I assume it passes make check, so:
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  tests/Makefile.include          |  13 ++-
>  tests/qapi-schema/doc-good.err  |   0
>  tests/qapi-schema/doc-good.exit |   1 +
>  tests/qapi-schema/doc-good.json | 136 ++++++++++++++++++++++
>  tests/qapi-schema/doc-good.out  | 148 ++++++++++++++++++++++++
>  tests/qapi-schema/doc-good.texi | 243
>  ++++++++++++++++++++++++++++++++++++++++
>  6 files changed, 537 insertions(+), 4 deletions(-)
>  create mode 100644 tests/qapi-schema/doc-good.err
>  create mode 100644 tests/qapi-schema/doc-good.exit
>  create mode 100644 tests/qapi-schema/doc-good.json
>  create mode 100644 tests/qapi-schema/doc-good.out
>  create mode 100644 tests/qapi-schema/doc-good.texi
> 
> diff --git a/tests/Makefile.include b/tests/Makefile.include
> index 402e71c..8b497c5 100644
> --- a/tests/Makefile.include
> +++ b/tests/Makefile.include
> @@ -379,6 +379,7 @@ qapi-schema += doc-duplicated-since.json
>  qapi-schema += doc-empty-arg.json
>  qapi-schema += doc-empty-section.json
>  qapi-schema += doc-empty-symbol.json
> +qapi-schema += doc-good.json
>  qapi-schema += doc-interleaved-section.json
>  qapi-schema += doc-invalid-end.json
>  qapi-schema += doc-invalid-end2.json
> @@ -607,6 +608,9 @@ $(SRC_PATH)/tests/qapi-schema/qapi-schema-test.json
> $(SRC_PATH)/scripts/qapi-int
>  		$(gen-out-type) -o tests -p "test-" $<, \
>  		"GEN","$@")
>  
> +tests/qapi-schema/doc-good.test.texi:
> $(SRC_PATH)/tests/qapi-schema/doc-good.json $(SRC_PATH)/scripts/qapi2texi.py
> $(qapi-py)
> +	$(call quiet-command,$(PYTHON) $(SRC_PATH)/scripts/qapi2texi.py $< >
> $@,"GEN","$@")
> +
>  tests/test-string-output-visitor$(EXESUF):
>  tests/test-string-output-visitor.o $(test-qapi-obj-y)
>  tests/test-string-input-visitor$(EXESUF): tests/test-string-input-visitor.o
>  $(test-qapi-obj-y)
>  tests/test-qmp-event$(EXESUF): tests/test-qmp-event.o $(test-qapi-obj-y)
> @@ -856,9 +860,6 @@ QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) =
> tests/qemu-iotests/socket_scm_helper$(EXE
>  check-tests/qemu-iotests-quick.sh: tests/qemu-iotests-quick.sh
>  qemu-img$(EXESUF) qemu-io$(EXESUF) $(QEMU_IOTESTS_HELPERS-y)
>  	$<
>  
> -.PHONY: check-tests/test-qapi.py
> -check-tests/test-qapi.py: tests/test-qapi.py
> -
>  .PHONY: $(patsubst %, check-%, $(check-qapi-schema-y))
>  $(patsubst %, check-%, $(check-qapi-schema-y)): check-%.json:
>  $(SRC_PATH)/%.json
>  	$(call quiet-command, PYTHONPATH=$(SRC_PATH)/scripts \
> @@ -871,10 +872,14 @@ $(patsubst %, check-%, $(check-qapi-schema-y)):
> check-%.json: $(SRC_PATH)/%.json
>  	@perl -p -e 's|\Q$(SRC_PATH)\E/||g' $*.test.err | diff -q
>  	$(SRC_PATH)/$*.err -
>  	@diff -q $(SRC_PATH)/$*.exit $*.test.exit
>  
> +.PHONY: check-tests/qapi-schema/doc-good.texi
> +check-tests/qapi-schema/doc-good.texi: tests/qapi-schema/doc-good.test.texi
> +	@diff -q $(SRC_PATH)/tests/qapi-schema/doc-good.texi $<
> +
>  # Consolidated targets
>  
>  .PHONY: check-qapi-schema check-qtest check-unit check check-clean
> -check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
> +check-qapi-schema: $(patsubst %,check-%, $(check-qapi-schema-y))
> check-tests/qapi-schema/doc-good.texi
>  check-qtest: $(patsubst %,check-qtest-%, $(QTEST_TARGETS))
>  check-unit: $(patsubst %,check-%, $(check-unit-y))
>  check-block: $(patsubst %,check-%, $(check-block-y))
> diff --git a/tests/qapi-schema/doc-good.err b/tests/qapi-schema/doc-good.err
> new file mode 100644
> index 0000000..e69de29
> diff --git a/tests/qapi-schema/doc-good.exit
> b/tests/qapi-schema/doc-good.exit
> new file mode 100644
> index 0000000..573541a
> --- /dev/null
> +++ b/tests/qapi-schema/doc-good.exit
> @@ -0,0 +1 @@
> +0
> diff --git a/tests/qapi-schema/doc-good.json
> b/tests/qapi-schema/doc-good.json
> new file mode 100644
> index 0000000..cfdc0a8
> --- /dev/null
> +++ b/tests/qapi-schema/doc-good.json
> @@ -0,0 +1,136 @@
> +# -*- Mode: Python -*-
> +# Positive QAPI doc comment tests
> +
> +{ 'pragma': { 'doc-required': true } }
> +
> +##
> +# = Section
> +#
> +# == Subsection
> +#
> +# *strong* _with emphasis_
> +# @var {in braces}
> +# * List item one
> +# - Two, multiple
> +#   lines
> +#
> +# 3. Three
> +# Still in list
> +#
> +#   Not in list
> +# - Second list
> +# Note: still in list
> +#
> +# Note: not in list
> +# 1. Third list
> +#    is numbered
> +#
> +# - another item
> +#
> +# | example
> +# | multiple lines
> +#
> +# Returns: the King
> +# Since: the first age
> +# Notes:
> +#
> +# 1. Lorem ipsum dolor sit amet
> +#
> +# 2. Ut enim ad minim veniam
> +#
> +# Duis aute irure dolor
> +#
> +# Example:
> +#
> +# -> in
> +# <- out
> +# Examples:
> +# - *verbatim*
> +# - {braces}
> +##
> +
> +##
> +# @Enum:
> +# == Produces *invalid* texinfo
> +# @one: The _one_ {and only}
> +#
> +# @two is undocumented
> +##
> +{ 'enum': 'Enum', 'data': [ 'one', 'two' ] }
> +
> +##
> +# @Base:
> +# @base1:
> +#   the first member
> +##
> +{ 'struct': 'Base', 'data': { 'base1': 'Enum' } }
> +
> +##
> +# @Variant1:
> +# A paragraph
> +#
> +# Another paragraph (but no @var: line)
> +##
> +{ 'struct': 'Variant1', 'data': { 'var1': 'str' } }
> +
> +##
> +# @Variant2:
> +##
> +{ 'struct': 'Variant2', 'data': {} }
> +
> +##
> +# @Object:
> +##
> +{ 'union': 'Object',
> +  'base': 'Base',
> +  'discriminator': 'base1',
> +  'data': { 'one': 'Variant1', 'two': 'Variant2' } }
> +
> +##
> +# @SugaredUnion:
> +##
> +{ 'union': 'SugaredUnion',
> +  'data': { 'one': 'Variant1', 'two': 'Variant2' } }
> +
> +##
> +# == Another subsection
> +##
> +
> +##
> +# @cmd:
> +# @arg1: the first argument
> +#
> +# @arg2: the second
> +# argument
> +# Note: @arg3 is undocumented
> +# Returns: @Object
> +# TODO: frobnicate
> +# Notes:
> +# - Lorem ipsum dolor sit amet
> +# - Ut enim ad minim veniam
> +#
> +# Duis aute irure dolor
> +# Example:
> +#
> +# -> in
> +# <- out
> +# Examples:
> +# - *verbatim*
> +# - {braces}
> +# Since: 2.10
> +##
> +{ 'command': 'cmd',
> +  'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
> +  'returns': 'Object' }
> +
> +##
> +# @cmd-boxed:
> +# If you're bored enough to read this, go see a video of boxed cats
> +# Example:
> +#
> +# -> in
> +#
> +# <- out
> +##
> +{ 'command': 'cmd-boxed', 'boxed': true,
> +  'data': 'Object' }
> diff --git a/tests/qapi-schema/doc-good.out b/tests/qapi-schema/doc-good.out
> new file mode 100644
> index 0000000..70c1252
> --- /dev/null
> +++ b/tests/qapi-schema/doc-good.out
> @@ -0,0 +1,148 @@
> +object Base
> +    member base1: Enum optional=False
> +enum Enum ['one', 'two']
> +object Object
> +    base Base
> +    tag base1
> +    case one: Variant1
> +    case two: Variant2
> +enum QType ['none', 'qnull', 'qint', 'qstring', 'qdict', 'qlist', 'qfloat',
> 'qbool']
> +    prefix QTYPE
> +object SugaredUnion
> +    member type: SugaredUnionKind optional=False
> +    tag type
> +    case one: q_obj_Variant1-wrapper
> +    case two: q_obj_Variant2-wrapper
> +enum SugaredUnionKind ['one', 'two']
> +object Variant1
> +    member var1: str optional=False
> +object Variant2
> +command cmd q_obj_cmd-arg -> Object
> +   gen=True success_response=True boxed=False
> +command cmd-boxed Object -> None
> +   gen=True success_response=True boxed=True
> +object q_empty
> +object q_obj_Variant1-wrapper
> +    member data: Variant1 optional=False
> +object q_obj_Variant2-wrapper
> +    member data: Variant2 optional=False
> +object q_obj_cmd-arg
> +    member arg1: int optional=False
> +    member arg2: str optional=True
> +    member arg3: bool optional=False
> +doc freeform
> +    body=
> += Section
> +
> +== Subsection
> +
> +*strong* _with emphasis_
> +@var {in braces}
> +* List item one
> +- Two, multiple
> +lines
> +
> +3. Three
> +Still in list
> +
> +Not in list
> +- Second list
> +Note: still in list
> +
> +Note: not in list
> +1. Third list
> +is numbered
> +
> +- another item
> +
> +| example
> +| multiple lines
> +
> +Returns: the King
> +Since: the first age
> +Notes:
> +
> +1. Lorem ipsum dolor sit amet
> +
> +2. Ut enim ad minim veniam
> +
> +Duis aute irure dolor
> +
> +Example:
> +
> +-> in
> +<- out
> +Examples:
> +- *verbatim*
> +- {braces}
> +doc symbol=Enum
> +    body=
> +== Produces *invalid* texinfo
> +    arg=one
> +The _one_ {and only}
> +    arg=two
> +
> +    section=
> +@two is undocumented
> +doc symbol=Base
> +    body=
> +
> +    arg=base1
> +the first member
> +doc symbol=Variant1
> +    body=
> +A paragraph
> +
> +Another paragraph (but no @var: line)
> +    arg=var1
> +
> +doc symbol=Variant2
> +    body=
> +
> +doc symbol=Object
> +    body=
> +
> +doc symbol=SugaredUnion
> +    body=
> +
> +    arg=type
> +
> +doc freeform
> +    body=
> +== Another subsection
> +doc symbol=cmd
> +    body=
> +
> +    arg=arg1
> +the first argument
> +    arg=arg2
> +the second
> +argument
> +    arg=arg3
> +
> +    section=Note
> +@arg3 is undocumented
> +    section=Returns
> +@Object
> +    section=TODO
> +frobnicate
> +    section=Notes
> +- Lorem ipsum dolor sit amet
> +- Ut enim ad minim veniam
> +
> +Duis aute irure dolor
> +    section=Example
> +-> in
> +<- out
> +    section=Examples
> +- *verbatim*
> +- {braces}
> +    section=Since
> +2.10
> +doc symbol=cmd-boxed
> +    body=
> +If you're bored enough to read this, go see a video of boxed cats
> +    section=Example
> +-> in
> +
> +<- out
> diff --git a/tests/qapi-schema/doc-good.texi
> b/tests/qapi-schema/doc-good.texi
> new file mode 100644
> index 0000000..1160aaf
> --- /dev/null
> +++ b/tests/qapi-schema/doc-good.texi
> @@ -0,0 +1,243 @@
> +@section Section
> +
> +@subsection Subsection
> +
> +@emph{strong}  @emph{with emphasis}
> +@code{var} @{in braces@}
> +@itemize @bullet
> +@item
> +List item one
> +@item
> +Two, multiple
> +lines
> +
> +@item
> +Three
> +Still in list
> +
> +@end itemize
> +
> +Not in list
> +@itemize @minus
> +@item
> +Second list
> +Note: still in list
> +
> +@end itemize
> +
> +Note: not in list
> +@enumerate
> +@item
> +Third list
> +is numbered
> +
> +@item
> +another item
> +
> +@example
> +example
> +@end example
> +
> +@example
> +multiple lines
> +@end example
> +
> +
> +@end enumerate
> +
> +Returns: the King
> +Since: the first age
> +Notes:
> +
> +@enumerate
> +@item
> +Lorem ipsum dolor sit amet
> +
> +@item
> +Ut enim ad minim veniam
> +
> +@end enumerate
> +
> +Duis aute irure dolor
> +
> +Example:
> +
> +-> in
> +<- out
> +Examples:
> +@itemize @minus
> +@item
> +@emph{verbatim}
> +@item
> +@{braces@}
> +@end itemize
> +
> +
> +
> +@deftp {Enum} Enum
> +
> +@subsection Produces @emph{invalid} texinfo
> +
> +@b{Values:}
> +@table @asis
> +@item @code{one}
> +The  @emph{one}  @{and only@}
> +@item @code{two}
> +Not documented
> +@end table
> +@code{two} is undocumented
> +
> +@end deftp
> +
> +
> +
> +@deftp {Object} Base
> +
> +
> +
> +@b{Members:}
> +@table @asis
> +@item @code{base1: Enum}
> +the first member
> +@end table
> +
> +
> +@end deftp
> +
> +
> +
> +@deftp {Object} Variant1
> +
> +A paragraph
> +
> +Another paragraph (but no @code{var}: line)
> +
> +@b{Members:}
> +@table @asis
> +@item @code{var1: string}
> +Not documented
> +@end table
> +
> +
> +@end deftp
> +
> +
> +
> +@deftp {Object} Variant2
> +
> +
> +
> +
> +@end deftp
> +
> +
> +
> +@deftp {Object} Object
> +
> +
> +
> +@b{Members:}
> +@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"}
> +@end table
> +
> +
> +@end deftp
> +
> +
> +
> +@deftp {Object} SugaredUnion
> +
> +
> +
> +@b{Members:}
> +@table @asis
> +@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"}
> +@end table
> +
> +
> +@end deftp
> +
> +
> +@subsection Another subsection
> +
> +
> +@deftypefn Command {} cmd
> +
> +
> +
> +@b{Arguments:}
> +@table @asis
> +@item @code{arg1: int}
> +the first argument
> +@item @code{arg2: string} (optional)
> +the second
> +argument
> +@item @code{arg3: boolean}
> +Not documented
> +@end table
> +
> +
> +@b{Note:}
> +@code{arg3} is undocumented
> +
> +@b{Returns:}
> +@code{Object}
> +
> +@b{TODO:}
> +frobnicate
> +
> +@b{Notes:}
> +@itemize @minus
> +@item
> +Lorem ipsum dolor sit amet
> +@item
> +Ut enim ad minim veniam
> +
> +@end itemize
> +
> +Duis aute irure dolor
> +
> +@b{Example:}
> +@example
> +-> in
> +<- out
> +@end example
> +
> +
> +@b{Examples:}
> +@example
> +- *verbatim*
> +- @{braces@}
> +@end example
> +
> +
> +@b{Since:}
> +2.10
> +
> +@end deftypefn
> +
> +
> +
> +@deftypefn Command {} cmd-boxed
> +
> +If you're bored enough to read this, go see a video of boxed cats
> +
> +@b{Arguments:} the members of @code{Object}
> +
> +@b{Example:}
> +@example
> +-> in
> +
> +<- out
> +@end example
> +
> +
> +@end deftypefn
> +
> +
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_ Markus Armbruster
@ 2017-03-20 13:32   ` Marc-André Lureau
  2017-03-20 13:37     ` Peter Maydell
  0 siblings, 1 reply; 18+ messages in thread
From: Marc-André Lureau @ 2017-03-20 13:32 UTC (permalink / raw)
  To: Markus Armbruster; +Cc: qemu-devel, marcandre lureau, eblake, mdroth



----- Original Message -----
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

weird this disparity went so far unnoticed

Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>


> ---
>  scripts/qapi2texi.py            | 4 ++--
>  tests/qapi-schema/doc-good.texi | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/scripts/qapi2texi.py b/scripts/qapi2texi.py
> index 5c4db78..9e01500 100755
> --- a/scripts/qapi2texi.py
> +++ b/scripts/qapi2texi.py
> @@ -35,12 +35,12 @@ EXAMPLE_FMT = """@example
>  
>  def subst_strong(doc):
>      """Replaces *foo* by @strong{foo}"""
> -    return re.sub(r'\*([^*\n]+)\*', r'@emph{\1}', doc)
> +    return re.sub(r'\*([^*\n]+)\*', r'@strong{\1}', doc)
>  
>  
>  def subst_emph(doc):
>      """Replaces _foo_ by @emph{foo}"""
> -    return re.sub(r'\b_([^_\n]+)_\b', r' @emph{\1} ', doc)
> +    return re.sub(r'\b_([^_\n]+)_\b', r'@emph{\1}', doc)
>  
>  
>  def subst_vars(doc):
> diff --git a/tests/qapi-schema/doc-good.texi
> b/tests/qapi-schema/doc-good.texi
> index 1160aaf..c410626 100644
> --- a/tests/qapi-schema/doc-good.texi
> +++ b/tests/qapi-schema/doc-good.texi
> @@ -2,7 +2,7 @@
>  
>  @subsection Subsection
>  
> -@emph{strong}  @emph{with emphasis}
> +@strong{strong} @emph{with emphasis}
>  @code{var} @{in braces@}
>  @itemize @bullet
>  @item
> @@ -67,7 +67,7 @@ Example:
>  Examples:
>  @itemize @minus
>  @item
> -@emph{verbatim}
> +@strong{verbatim}
>  @item
>  @{braces@}
>  @end itemize
> @@ -76,12 +76,12 @@ Examples:
>  
>  @deftp {Enum} Enum
>  
> -@subsection Produces @emph{invalid} texinfo
> +@subsection Produces @strong{invalid} texinfo
>  
>  @b{Values:}
>  @table @asis
>  @item @code{one}
> -The  @emph{one}  @{and only@}
> +The @emph{one} @{and only@}
>  @item @code{two}
>  Not documented
>  @end table
> --
> 2.7.4
> 
> 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_
  2017-03-20 13:32   ` Marc-André Lureau
@ 2017-03-20 13:37     ` Peter Maydell
  2017-03-21  7:20       ` Markus Armbruster
  0 siblings, 1 reply; 18+ messages in thread
From: Peter Maydell @ 2017-03-20 13:37 UTC (permalink / raw)
  To: Marc-André Lureau
  Cc: Markus Armbruster, marcandre lureau, QEMU Developers, Michael Roth

On 20 March 2017 at 13:32, Marc-André Lureau <mlureau@redhat.com> wrote:
>
>
> ----- Original Message -----
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> weird this disparity went so far unnoticed

You think people read the documentation? :-)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again
  2017-03-20 13:27   ` Marc-André Lureau
@ 2017-03-21  7:18     ` Markus Armbruster
  0 siblings, 0 replies; 18+ messages in thread
From: Markus Armbruster @ 2017-03-21  7:18 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: marcandre lureau, qemu-devel, mdroth

Marc-André Lureau <mlureau@redhat.com> writes:

> ----- Original Message -----
>> test-qapi.py used to print the internal representation of doc comments
>> (commit 3313b61).  This went away when we dropped the doc comments in
>> positive tests (commit 87c16dc).  Bring it back, because I'm going to
>> add real positive doc comment tests.
>
> Yup, as I pointed out in the previous series, but since you biring it back modified:

As you see, I took your complaint about the loss of positive tests
seriously :)

>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests
  2017-03-20 13:28   ` Marc-André Lureau
@ 2017-03-21  7:19     ` Markus Armbruster
  0 siblings, 0 replies; 18+ messages in thread
From: Markus Armbruster @ 2017-03-21  7:19 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: marcandre lureau, qemu-devel, mdroth

Marc-André Lureau <mlureau@redhat.com> writes:

> ----- Original Message -----
>> We have a number of negative tests, but we don't have systematic
>> positive coverage.  Fix that.
>> 
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>
> didn't test it,

Patchew did :)

>                 but I assume it passes make check, so:
> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>

Thanks!

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_
  2017-03-20 13:37     ` Peter Maydell
@ 2017-03-21  7:20       ` Markus Armbruster
  0 siblings, 0 replies; 18+ messages in thread
From: Markus Armbruster @ 2017-03-21  7:20 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Marc-André Lureau, Michael Roth, marcandre lureau, QEMU Developers

Peter Maydell <peter.maydell@linaro.org> writes:

> On 20 March 2017 at 13:32, Marc-André Lureau <mlureau@redhat.com> wrote:
>>
>>
>> ----- Original Message -----
>>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>>
>> weird this disparity went so far unnoticed
>
> You think people read the documentation? :-)

It's exactly the kind of stupid pasto that gets caught only when you
write systematic tests and carefully check their output against your
expectations.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests
  2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
                   ` (5 preceding siblings ...)
  2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_ Markus Armbruster
@ 2017-03-28 13:24 ` no-reply
  6 siblings, 0 replies; 18+ messages in thread
From: no-reply @ 2017-03-28 13:24 UTC (permalink / raw)
  To: armbru; +Cc: famz, qemu-devel, marcandre.lureau, mdroth

Hi,

This series seems to have some coding style problems. See output below for
more information:

Subject: [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests
Message-id: 1490015515-25851-1-git-send-email-armbru@redhat.com
Type: series

=== TEST SCRIPT BEGIN ===
#!/bin/bash

BASE=base
n=1
total=$(git log --oneline $BASE.. | wc -l)
failed=0

# Useful git options
git config --local diff.renamelimit 0
git config --local diff.renames True

commits="$(git log --format=%H --reverse $BASE..)"
for c in $commits; do
    echo "Checking PATCH $n/$total: $(git log -n 1 --format=%s $c)..."
    if ! git show $c --format=email | ./scripts/checkpatch.pl --mailback -; then
        failed=1
        echo
    fi
    n=$((n+1))
done

exit $failed
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
Switched to a new branch 'test'
4fea5b2 qapi2texi: Fix translation of *strong* and _emphasized_
824c22b tests/qapi-schema: Systematic positive doc comment tests
369016b tests/qapi-schema: Make test-qapi.py print docs again
8040557 qapi: Drop unused QAPIDoc member optional
78edd92 qapi2texi: Fix to actually fail when 'doc-required' is false
f64e5ff qapi: Drop excessive Make dependencies on qapi2texi.py

=== OUTPUT BEGIN ===
Checking PATCH 1/6: qapi: Drop excessive Make dependencies on qapi2texi.py...
Checking PATCH 2/6: qapi2texi: Fix to actually fail when 'doc-required' is false...
Checking PATCH 3/6: qapi: Drop unused QAPIDoc member optional...
Checking PATCH 4/6: tests/qapi-schema: Make test-qapi.py print docs again...
Checking PATCH 5/6: tests/qapi-schema: Systematic positive doc comment tests...
ERROR: trailing whitespace
#380: FILE: tests/qapi-schema/doc-good.texi:5:
+@emph{strong}  @emph{with emphasis} $

total: 1 errors, 0 warnings, 568 lines checked

Your patch has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

Checking PATCH 6/6: qapi2texi: Fix translation of *strong* and _emphasized_...
=== OUTPUT END ===

Test command exited with code: 1


---
Email generated automatically by Patchew [http://patchew.org/].
Please send your feedback to patchew-devel@freelists.org

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2017-03-28 13:24 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-20 13:11 [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests Markus Armbruster
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 1/6] qapi: Drop excessive Make dependencies on qapi2texi.py Markus Armbruster
2017-03-20 13:17   ` Marc-André Lureau
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 2/6] qapi2texi: Fix to actually fail when 'doc-required' is false Markus Armbruster
2017-03-20 13:18   ` Marc-André Lureau
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 3/6] qapi: Drop unused QAPIDoc member optional Markus Armbruster
2017-03-20 13:24   ` Marc-André Lureau
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 4/6] tests/qapi-schema: Make test-qapi.py print docs again Markus Armbruster
2017-03-20 13:27   ` Marc-André Lureau
2017-03-21  7:18     ` Markus Armbruster
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 5/6] tests/qapi-schema: Systematic positive doc comment tests Markus Armbruster
2017-03-20 13:28   ` Marc-André Lureau
2017-03-21  7:19     ` Markus Armbruster
2017-03-20 13:11 ` [Qemu-devel] [PATCH for-2.9 6/6] qapi2texi: Fix translation of *strong* and _emphasized_ Markus Armbruster
2017-03-20 13:32   ` Marc-André Lureau
2017-03-20 13:37     ` Peter Maydell
2017-03-21  7:20       ` Markus Armbruster
2017-03-28 13:24 ` [Qemu-devel] [PATCH for-2.9 0/6] qapi: Small qapi2texi fixes and addition tests no-reply

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.