From a52dd2c3cf240c8b6b621305b2f80d76eadc7a64 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Fri, 26 Jul 2013 13:47:36 +0200 Subject: tests: move GTK-Doc comment block warning tests It makes sense to let test_parser.py check everything which is focused purely on testing GTK-Doc comment blocks (ie annotationparser.py functionality). --- tests/scanner/annotationparser/gi/tag.xml | 70 +++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/scanner/annotationparser/gi/tag.xml (limited to 'tests/scanner/annotationparser/gi/tag.xml') diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml new file mode 100644 index 00000000..2dfe41aa --- /dev/null +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -0,0 +1,70 @@ + + + + + + /** + * test_multiline_annotations_on_tag: + * + * Annotations spanning multiple lines are not valid + * + * Returns: (allow-none) + * (transfer full): something + **/ + + + + test_multiline_annotations_on_tag + + Annotations spanning multiple lines are not valid + + + returns + + + allow-none + + + (transfer full): something + + + + + 7: Warning: Test: ignoring invalid multiline annotation continuation: + * (transfer full): something + ^ + + + + + + /** + * test_multiline_annotations_on_tag: + * + * Annotations spanning multiple lines are not valid + * + * Returns: (allow-none): Returns tag having a second line which looks + * (like an annotation), but isn't. This should not result in a warning. + **/ + + + + test_multiline_annotations_on_tag + + Annotations spanning multiple lines are not valid + + + returns + + + allow-none + + + Returns tag having a second line which looks (like an annotation), but isn't. This should not result in a warning. + + + + + + + -- 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/gi/tag.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/scanner/annotationparser/gi/tag.xml') diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml index 2dfe41aa..d7eca816 100644 --- a/tests/scanner/annotationparser/gi/tag.xml +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -25,7 +25,8 @@ allow-none - (transfer full): something + +(transfer full): something @@ -60,7 +61,8 @@ allow-none - Returns tag having a second line which looks (like an annotation), but isn't. This should not result in a warning. + Returns tag having a second line which looks +(like an annotation), but isn't. This should not result in a warning. -- cgit v1.2.1 From 0af20939c8e2deaf1d1f06e069594d53acf65d2f Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Tue, 13 Aug 2013 23:16:41 +0200 Subject: giscanner: make some warnings errors GTK-Doc comment block fixer tool will refuse to rewrite source files that generated errors (indicating a source->parse tree->source would result in information being lost), but will happily continue on warnings (which do not result in information being lost). --- tests/scanner/annotationparser/gi/tag.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/scanner/annotationparser/gi/tag.xml') diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml index d7eca816..d116841c 100644 --- a/tests/scanner/annotationparser/gi/tag.xml +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -31,7 +31,7 @@ - 7: Warning: Test: ignoring invalid multiline annotation continuation: + 7: Error: Test: ignoring invalid multiline annotation continuation: * (transfer full): something ^ -- cgit v1.2.1 From 4b690b187bf8d0b7b571faaa050986b796e797a4 Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Tue, 13 Aug 2013 15:01:00 +0200 Subject: giscanner: add missing tests --- tests/scanner/annotationparser/gi/tag.xml | 269 ++++++++++++++++++++++++++++++ 1 file changed, 269 insertions(+) (limited to 'tests/scanner/annotationparser/gi/tag.xml') diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml index d116841c..c91ec0f0 100644 --- a/tests/scanner/annotationparser/gi/tag.xml +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -2,6 +2,151 @@ + + /** + * test_tag_missing_colon: + * + * Forgotten colon below will result in a warning. + * + * Returns: (allow-none) return value + **/ + + + + test_tag_missing_colon + + Forgotten colon below will result in a warning. + + + returns + + + allow-none + + + return value + + + + + 6: Warning: Test: missing ":" at column 25: + * Returns: (allow-none) return value + ^ + + + + + + /** + * test_unexpected_tag: + * + * @param1: first parameter + * does something + * Returns: something + * returning something + * + * Probably intended as the comment block description part but in reality belongs to + * the "Returns:"" tag description field. + **/ + + + + test_unexpected_tag + + + + param1 + first parameter +does something + + + + + returns + something +returning something + +Probably intended as the comment block description part but in reality belongs to +the "Returns:"" tag description field. + + + + + 4: Warning: Test: "@param1" parameter unexpected at this location: + * @param1: first parameter + ^ + + + + + + /** + * test_unknown_tag: + * + * Foo: something + * + * Returns: True + * Moo: anything + **/ + + + + test_unknown_tag + + Foo: something + + + returns + True +Moo: anything + + + + + /** + * test_unknown_tag: + * + * Foo: something + * + * Returns: True + * Moo: anything + */ + + + + /** + * test_multiline_tag: + * + * Returns: + * True + * Since: + * 1.0: yeah + */ + + + + test_multiline_tag + + + + returns + True + + + since + 1.0: yeah + + + + + /** + * test_multiline_tag: + * + * Returns: True + * Since: 1.0: yeah + */ + + /** * test_multiline_annotations_on_tag: @@ -69,4 +214,128 @@ + + /** + * gdk_device_list_axes: + * @device: a pointer #GdkDevice + * + * Returns a #GList of #GdkAtoms, containing the labels for + * the axes that @device currently has. + * + * Returns: (transfer container) (element-type GdkAtom): + * A #GList of #GdkAtoms, free + * with g_list_free(). + * + * Since: 3.0 + **/ + + + + gdk_device_list_axes + + + + device + a pointer #GdkDevice + + + Returns a #GList of #GdkAtoms, containing the labels for +the axes that @device currently has. + + + returns + + + transfer + + + + + + element-type + + + + + + + A #GList of #GdkAtoms, free + with g_list_free(). + + + since + 3.0 + + + + + + + + /** + * FsSession:codec-preferences: + * + * Type: GLib.List(FsCodec) + * Transfer: full + * + * This is the current preferences list for the local codecs. It is + * set by the user to specify the codec options and priorities. The user may + * change its value with fs_session_set_codec_preferences() at any time + * during a session. It is a #GList of #FsCodec. + * The user must free this codec list using fs_codec_list_destroy() when done. + * + * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE + * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the + * payload type of the codec will be "reserved" and not be used by any + * dynamically assigned payload type. + */ + + + + FsSession:codec-preferences + + + type + + + + + + transfer + + + + + + + This is the current preferences list for the local codecs. It is +set by the user to specify the codec options and priorities. The user may +change its value with fs_session_set_codec_preferences() at any time +during a session. It is a #GList of #FsCodec. +The user must free this codec list using fs_codec_list_destroy() when done. + +The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE +or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the +payload type of the codec will be "reserved" and not be used by any +dynamically assigned payload type. + + + 4: Warning: Test: GObject-Introspection specific GTK-Doc tag "Type" has been deprecated, please use annotations on the identifier instead: + * Type: GLib.List(FsCodec) + ^ + 5: Warning: Test: GObject-Introspection specific GTK-Doc tag "Transfer" has been deprecated, please use annotations on the identifier instead: + * Transfer: full + ^ + + + + -- 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 --- tests/scanner/annotationparser/gi/tag.xml | 60 +++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'tests/scanner/annotationparser/gi/tag.xml') diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml index c91ec0f0..8480d4b4 100644 --- a/tests/scanner/annotationparser/gi/tag.xml +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -34,6 +34,13 @@ ^ + /** + * test_tag_missing_colon: + * + * Forgotten colon below will result in a warning. + * + * Returns: (allow-none): return value + */ @@ -77,6 +84,17 @@ the "Returns:"" tag description field. ^ + /** + * test_unexpected_tag: + * @param1: first parameter + * does something + * + * Returns: something + * returning something + * + * Probably intended as the comment block description part but in reality belongs to + * the "Returns:"" tag description field. + */ @@ -181,6 +199,14 @@ Moo: anything ^ + /** + * test_multiline_annotations_on_tag: + * + * Annotations spanning multiple lines are not valid + * + * Returns: (allow-none): + * (transfer full): something + */ @@ -212,6 +238,14 @@ Moo: anything + /** + * test_multiline_annotations_on_tag: + * + * Annotations spanning multiple lines are not valid + * + * Returns: (allow-none): Returns tag having a second line which looks + * (like an annotation), but isn't. This should not result in a warning. + */ @@ -273,6 +307,18 @@ the axes that @device currently has. + /** + * gdk_device_list_axes: + * @device: a pointer #GdkDevice + * + * Returns a #GList of #GdkAtoms, containing the labels for + * the axes that @device currently has. + * + * Returns: (transfer container) (element-type GdkAtom): + * A #GList of #GdkAtoms, free + * with g_list_free(). + * Since: 3.0 + */ @@ -336,6 +382,20 @@ dynamically assigned payload type. ^ + /** + * FsSession:codec-preferences: (type GLib.List(FsCodec)) (transfer full) + * + * This is the current preferences list for the local codecs. It is + * set by the user to specify the codec options and priorities. The user may + * change its value with fs_session_set_codec_preferences() at any time + * during a session. It is a #GList of #FsCodec. + * The user must free this codec list using fs_codec_list_destroy() when done. + * + * The payload type may be a valid dynamic PT (96-127), %FS_CODEC_ID_DISABLE + * or %FS_CODEC_ID_ANY. If the encoding name is "reserve-pt", then the + * payload type of the codec will be "reserved" and not be used by any + * dynamically assigned payload type. + */ -- cgit v1.2.1