From af2e146f5f24b93322ad0112d37a8e41222c3085 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 4 Jul 2012 11:58:13 +0200 Subject: giscanner: add AnnotationParser tests The tests in giscanner/annotationpatters.py only test the regular expression programs used when parsing GTK-Doc comment blocks but do not test the structure of the resulting "parse tree". This patch adds 193 GTK-Doc comment blocks and the expected results AnnotationParser should return (with it's current level of understanding of GTK-Doc comment block syntax). These are compared by tests/scanner/annotationparser/test_parser.py which complains with a diff on failure. https://bugzilla.gnome.org/show_bug.cgi?id=688897 --- .../annotationparser/gtkdoc/gobject/giface.c.xml | 147 +++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml new file mode 100644 index 00000000..ea09d126 --- /dev/null +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -0,0 +1,147 @@ + + + + + + + * + * Home sweet home. + * + * + * Just incase you wonder, special caracters can be escaped with a \ like in \% + * or \# or even \@. + */]]> + + + SECTION:iface + + + + title + GtkdocIface + + + short_description + interface for gtk-doc unit test + + + see_also + #GtkdocObject + + + + + Home sweet home. + + +Just incase you wonder, special caracters can be escaped with a \ like in \% +or \# or even \@.]]> + + + + + /** + * SECTION:iface2 + * @title: GtkdocIface2 + * @short_description: interface with a prerequisite for gtk-doc unit test + * @see_also: #GtkdocObject, #GtkdocIface + * + * This file contains non-sense code for the sole purpose of testing the docs. + */ + + + SECTION:iface2 + + + + title + GtkdocIface2 + + + short_description + interface with a prerequisite for gtk-doc unit test + + + see_also + #GtkdocObject, #GtkdocIface + + + This file contains non-sense code for the sole purpose of testing the docs. + + + + + /** + * gtkdoc_iface_configure: + * @config: settings + * + * Configure a new instance + * + * Returns: %TRUE for sucess or %FALSE in case of an error + * + * Since: 0.1 + */ + + + gtkdoc_iface_configure + + + + config + settings + + + Configure a new instance + + + returns + %TRUE for sucess or %FALSE in case of an error + + + since + 0.1 + + + + + + + /** + * GtkdocIface::itest: + * @self: myself + * + * The event has been triggered. + */ + + + GtkdocIface::itest + + + + self + myself + + + The event has been triggered. + + + + -- cgit v1.2.1 From 146a56f7f358dc14989e198fee4c2dd01b55be07 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 15 May 2013 14:42:09 +0200 Subject: tests: rename element to We'll start testing parser warning/error messages and serialized output later on so this will make it easier to see what's parser input and output... --- .../scanner/annotationparser/gtkdoc/gobject/giface.c.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index ea09d126..b8daf7f9 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -3,7 +3,7 @@ - + */]]> SECTION:iface @@ -58,14 +58,14 @@ or \# or even \@.]]> - /** + /** * SECTION:iface2 * @title: GtkdocIface2 * @short_description: interface with a prerequisite for gtk-doc unit test * @see_also: #GtkdocObject, #GtkdocIface * * This file contains non-sense code for the sole purpose of testing the docs. - */ + */ SECTION:iface2 @@ -89,7 +89,7 @@ or \# or even \@.]]> - /** + /** * gtkdoc_iface_configure: * @config: settings * @@ -98,7 +98,7 @@ or \# or even \@.]]> * Returns: %TRUE for sucess or %FALSE in case of an error * * Since: 0.1 - */ + */ gtkdoc_iface_configure @@ -124,12 +124,12 @@ or \# or even \@.]]> - /** + /** * GtkdocIface::itest: * @self: myself * * The event has been triggered. - */ + */ GtkdocIface::itest -- cgit v1.2.1 From 1359fb6d7a76609ec07e22af9cd79ae604d23d20 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 15 May 2013 17:31:14 +0200 Subject: tests: put element inside a element The element can then hold both the expected parse tree and the warning/error messages emitted by the parser in a future child element. --- .../annotationparser/gtkdoc/gobject/giface.c.xml | 156 +++++++++++---------- 1 file changed, 82 insertions(+), 74 deletions(-) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index b8daf7f9..6511533d 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -23,25 +23,26 @@ * Just incase you wonder, special caracters can be escaped with a \ like in \% * or \# or even \@. */]]> - - - SECTION:iface - - - - title - GtkdocIface - - - short_description - interface for gtk-doc unit test - - - see_also - #GtkdocObject - - - + + + SECTION:iface + + + + title + GtkdocIface + + + short_description + interface for gtk-doc unit test + + + see_also + #GtkdocObject + + + - + + @@ -66,26 +68,28 @@ or \# or even \@.]]> * * This file contains non-sense code for the sole purpose of testing the docs. */ - - - SECTION:iface2 - - - - title - GtkdocIface2 - - - short_description - interface with a prerequisite for gtk-doc unit test - - - see_also - #GtkdocObject, #GtkdocIface - - - This file contains non-sense code for the sole purpose of testing the docs. - + + + + SECTION:iface2 + + + + title + GtkdocIface2 + + + short_description + interface with a prerequisite for gtk-doc unit test + + + see_also + #GtkdocObject, #GtkdocIface + + + This file contains non-sense code for the sole purpose of testing the docs. + + @@ -99,28 +103,30 @@ or \# or even \@.]]> * * Since: 0.1 */ - - - gtkdoc_iface_configure - - - - config - settings - - - Configure a new instance - - - returns - %TRUE for sucess or %FALSE in case of an error - - - since - 0.1 - - - + + + + gtkdoc_iface_configure + + + + config + settings + + + Configure a new instance + + + returns + %TRUE for sucess or %FALSE in case of an error + + + since + 0.1 + + + + @@ -130,18 +136,20 @@ or \# or even \@.]]> * * The event has been triggered. */ - - - GtkdocIface::itest - - - - self - myself - - - The event has been triggered. - + + + + GtkdocIface::itest + + + + self + myself + + + The event has been triggered. + + -- cgit v1.2.1 From d464fb1f18173fea1aa3028cf44002944419b6ee Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 22 May 2013 07:39:32 +0200 Subject: tests: validate GTK-Doc test files This is more of a handy developer tool than something that is always expected to be executed as part of the test suite, so we don't add a hard dependency on xmllint. https://bugzilla.gnome.org/show_bug.cgi?id=688897 --- tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index 6511533d..65dca481 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -1,6 +1,6 @@ - + Date: Thu, 25 Jul 2013 17:22:21 +0200 Subject: giscanner: extract tag values --- tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index 65dca481..053b44b4 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -122,7 +122,7 @@ or \# or even \@.]]> since - 0.1 + 0.1 -- cgit v1.2.1 From ba425f1fd48df193fe7a8c6cc559f0b408160604 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 14 Aug 2013 17:00:39 +0200 Subject: giscanner: honor line and paragraph breaks in description fields GTK-Doc parameter description fields are allowed to span multiple lines, tag description fields are allowed to span multiple lines and paragraphs. A tool fixing/rewriting GTK-Doc comment blocks in source files would need to have description fields parsed and stored (almost) exactly as they appear in the source file. --- tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index 053b44b4..dc9ae531 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -100,7 +100,6 @@ or \# or even \@.]]> * Configure a new instance * * Returns: %TRUE for sucess or %FALSE in case of an error - * * Since: 0.1 */ -- cgit v1.2.1 From 6a874b86a1b9aae0c50a30b8cd3033870797eb1c Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Tue, 23 Jul 2013 17:34:07 +0200 Subject: giscanner: refactor GTK-Doc comment block serialization --- .../annotationparser/gtkdoc/gobject/giface.c.xml | 43 ++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml') diff --git a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml index dc9ae531..c295edbc 100644 --- a/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/gobject/giface.c.xml @@ -57,6 +57,26 @@ Just incase you wonder, special caracters can be escaped with a \ like in \% or \# or even \@.]]> + + * + * Home sweet home. + * + * + * Just incase you wonder, special caracters can be escaped with a \ like in \% + * or \# or even \@. + */]]> @@ -90,6 +110,14 @@ or \# or even \@.]]> This file contains non-sense code for the sole purpose of testing the docs. + /** + * SECTION:iface2 + * @title: GtkdocIface2 + * @short_description: interface with a prerequisite for gtk-doc unit test + * @see_also: #GtkdocObject, #GtkdocIface + * + * This file contains non-sense code for the sole purpose of testing the docs. + */ @@ -126,6 +154,15 @@ or \# or even \@.]]> + /** + * gtkdoc_iface_configure: + * @config: settings + * + * Configure a new instance + * + * Returns: %TRUE for sucess or %FALSE in case of an error + * Since: 0.1 + */ @@ -149,6 +186,12 @@ or \# or even \@.]]> The event has been triggered. + /** + * GtkdocIface::itest: + * @self: myself + * + * The event has been triggered. + */ -- cgit v1.2.1