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/gi/annotation_scope.xml | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 tests/scanner/annotationparser/gi/annotation_scope.xml (limited to 'tests/scanner/annotationparser/gi/annotation_scope.xml') diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml b/tests/scanner/annotationparser/gi/annotation_scope.xml new file mode 100644 index 00000000..7f05a4c6 --- /dev/null +++ b/tests/scanner/annotationparser/gi/annotation_scope.xml @@ -0,0 +1,106 @@ + + + + + + /** + * annotation_object_foreach: + * @object: a #AnnotationObject + * @func: (scope call): Callback to invoke + * @user_data: Callback user data + * + * Test taking a call-scoped callback + **/ + + + annotation_object_foreach + + + + object + a #AnnotationObject + + + func + + + scope + + + + + + Callback to invoke + + + user_data + Callback user data + + + Test taking a call-scoped callback + + + + + /** + * regress_test_callback_destroy_notify: + * @callback: (scope notified): + * + * Notified - callback persists until a DestroyNotify delegate + * is invoked. + **/ + + + regress_test_callback_destroy_notify + + + + callback + + + scope + + + + + + + + Notified - callback persists until a DestroyNotify delegate +is invoked. + + + + + /** + * regress_test_callback_async: + * @callback: (scope async): + * + **/ + + + regress_test_callback_async + + + + callback + + + scope + + + + + + + + + + + -- 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... --- tests/scanner/annotationparser/gi/annotation_scope.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/scanner/annotationparser/gi/annotation_scope.xml') diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml b/tests/scanner/annotationparser/gi/annotation_scope.xml index 7f05a4c6..7ae9c8ab 100644 --- a/tests/scanner/annotationparser/gi/annotation_scope.xml +++ b/tests/scanner/annotationparser/gi/annotation_scope.xml @@ -3,14 +3,14 @@ - /** + /** * annotation_object_foreach: * @object: a #AnnotationObject * @func: (scope call): Callback to invoke * @user_data: Callback user data * * Test taking a call-scoped callback - **/ + **/ annotation_object_foreach @@ -44,13 +44,13 @@ - /** + /** * regress_test_callback_destroy_notify: * @callback: (scope notified): * * Notified - callback persists until a DestroyNotify delegate * is invoked. - **/ + **/ regress_test_callback_destroy_notify @@ -76,11 +76,11 @@ is invoked. - /** + /** * regress_test_callback_async: * @callback: (scope async): * - **/ + **/ regress_test_callback_async -- 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/gi/annotation_scope.xml | 148 +++++++++++---------- 1 file changed, 77 insertions(+), 71 deletions(-) (limited to 'tests/scanner/annotationparser/gi/annotation_scope.xml') diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml b/tests/scanner/annotationparser/gi/annotation_scope.xml index 7ae9c8ab..e8693075 100644 --- a/tests/scanner/annotationparser/gi/annotation_scope.xml +++ b/tests/scanner/annotationparser/gi/annotation_scope.xml @@ -11,36 +11,38 @@ * * Test taking a call-scoped callback **/ - - - annotation_object_foreach - - - - object - a #AnnotationObject - - - func - - - scope - - - - - - Callback to invoke - - - user_data - Callback user data - - - Test taking a call-scoped callback - + + + + annotation_object_foreach + + + + object + a #AnnotationObject + + + func + + + scope + + + + + + Callback to invoke + + + user_data + Callback user data + + + Test taking a call-scoped callback + + @@ -51,28 +53,30 @@ * Notified - callback persists until a DestroyNotify delegate * is invoked. **/ - - - regress_test_callback_destroy_notify - - - - callback - - - scope - - - - - - - - Notified - callback persists until a DestroyNotify delegate + + + + regress_test_callback_destroy_notify + + + + callback + + + scope + + + + + + + + Notified - callback persists until a DestroyNotify delegate is invoked. - + + @@ -81,26 +85,28 @@ is invoked. * @callback: (scope async): * **/ - - - regress_test_callback_async - - - - callback - - - scope - - - - - - - - + + + + regress_test_callback_async + + + + callback + + + scope + + + + + + + + + -- 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/gi/annotation_scope.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/scanner/annotationparser/gi/annotation_scope.xml') diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml b/tests/scanner/annotationparser/gi/annotation_scope.xml index e8693075..008591d6 100644 --- a/tests/scanner/annotationparser/gi/annotation_scope.xml +++ b/tests/scanner/annotationparser/gi/annotation_scope.xml @@ -1,6 +1,6 @@ - + /** -- 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 --- .../scanner/annotationparser/gi/annotation_scope.xml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'tests/scanner/annotationparser/gi/annotation_scope.xml') diff --git a/tests/scanner/annotationparser/gi/annotation_scope.xml b/tests/scanner/annotationparser/gi/annotation_scope.xml index 008591d6..3a22274a 100644 --- a/tests/scanner/annotationparser/gi/annotation_scope.xml +++ b/tests/scanner/annotationparser/gi/annotation_scope.xml @@ -43,6 +43,14 @@ Test taking a call-scoped callback + /** + * annotation_object_foreach: + * @object: a #AnnotationObject + * @func: (scope call): Callback to invoke + * @user_data: Callback user data + * + * Test taking a call-scoped callback + */ @@ -77,6 +85,13 @@ is invoked. + /** + * regress_test_callback_destroy_notify: + * @callback: (scope notified): + * + * Notified - callback persists until a DestroyNotify delegate + * is invoked. + */ @@ -107,6 +122,10 @@ is invoked. + /** + * regress_test_callback_async: + * @callback: (scope async): + */ -- cgit v1.2.1