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/parameter.xml | 130 ++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 tests/scanner/annotationparser/gi/parameter.xml (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml new file mode 100644 index 00000000..5e3a3a1e --- /dev/null +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -0,0 +1,130 @@ + + + + + + /** + * test_unexpected_parameter: + * + * Parameters should go before the comment block description. + * + * @param1: first parameter + * Returns: something + **/ + + + + test_unexpected_parameter + + + + param1 + first parameter + + + Parameters should go before the comment block description. + + + returns + something + + + + + 6: Warning: Test: '@param1' parameter unexpected at this location: + * @param1: first parameter + ^ + + + + + + /** + * test_multiple_parameters: + * @param1: first parameter + * @param1: first parameter again + **/ + + + + test_multiple_parameters + + + + param1 + first parameter again + + + + + 4: Warning: Test: multiple '@param1' parameters for identifier 'test_multiple_parameters': + * @param1: first parameter again + ^ + + + + + + /** + * test_multiline_annotations_on_parameter: + * @param1: (allow-none) + * (transfer full): first parameter + * + * Annotations spanning multiple lines are not valid + **/ + + + + test_multiline_annotations_on_parameter + + + + param1 + + + allow-none + + + (transfer full): first parameter + + + Annotations spanning multiple lines are not valid + + + 4: Warning: Test: ignoring invalid multiline annotation continuation: + * (transfer full): first parameter + ^ + + + + + + /** + * test_multiline_annotations_on_parameter: + * @param1: (allow-none): first parameter having a second line which looks + * (like an annotation), but isn't. This should not result in a warning. + * + * Annotations spanning multiple lines are not valid + **/ + + + + test_multiline_annotations_on_parameter + + + + param1 + + + allow-none + + + first parameter having a second line which looks (like an annotation), but isn't. This should not result in a warning. + + + Annotations spanning multiple lines are not valid + + + + + -- cgit v1.2.1 From 23dddc02594e733b65f9be76dbf0a0a1e54bc67c Mon Sep 17 00:00:00 2001 From: Dieter Verfaillie Date: Wed, 14 Aug 2013 16:44:22 +0200 Subject: giscanner: improve state tracking --- tests/scanner/annotationparser/gi/parameter.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml index 5e3a3a1e..d6c4ab37 100644 --- a/tests/scanner/annotationparser/gi/parameter.xml +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -31,9 +31,12 @@ - 6: Warning: Test: '@param1' parameter unexpected at this location: + 6: Warning: Test: "@param1" parameter unexpected at this location: * @param1: first parameter ^ + 7: Warning: Test: "Returns:" tag unexpected at this location: + * Returns: something + ^ -- 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/parameter.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml index d6c4ab37..809b9d89 100644 --- a/tests/scanner/annotationparser/gi/parameter.xml +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -88,7 +88,8 @@ allow-none - (transfer full): first parameter + +(transfer full): first parameter Annotations spanning multiple lines are not valid @@ -122,7 +123,8 @@ allow-none - first parameter having a second line which looks (like an annotation), but isn't. This should not result in a warning. + first parameter having a second line which looks +(like an annotation), but isn't. This should not result in a warning. Annotations spanning multiple lines are not valid -- 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/parameter.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml index 809b9d89..e17f590b 100644 --- a/tests/scanner/annotationparser/gi/parameter.xml +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -60,7 +60,7 @@ - 4: Warning: Test: multiple '@param1' parameters for identifier 'test_multiple_parameters': + 4: Error: Test: multiple "@param1" parameters for identifier "test_multiple_parameters": * @param1: first parameter again ^ @@ -95,7 +95,7 @@ Annotations spanning multiple lines are not valid - 4: Warning: Test: ignoring invalid multiline annotation continuation: + 4: Error: Test: ignoring invalid multiline annotation continuation: * (transfer full): first parameter ^ -- 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/parameter.xml | 182 ++++++++++++++++++++++++ 1 file changed, 182 insertions(+) (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml index e17f590b..fcf9ee42 100644 --- a/tests/scanner/annotationparser/gi/parameter.xml +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -2,6 +2,39 @@ + + /** + * test_parameter_missing_colon: + * @param1: (allow-none) first parameter + * + * Forgotten colon above will result in a warning. + **/ + + + + test_parameter_missing_colon + + + + param1 + + + allow-none + + + first parameter + + + Forgotten colon above will result in a warning. + + + 3: Warning: Test: missing ":" at column 25: + * @param1: (allow-none) first parameter + ^ + + + + /** * test_unexpected_parameter: @@ -132,4 +165,153 @@ + + /** + * anjuta_async_notify_get_error: + * + * @self: An #AnjutaAsyncNotify object + * @error: Return location for the error set by the called interface to which + * this object was passed. If no error is set, @error is set to NULL. + * + * Gets the error set on @self. + */ + + + + anjuta_async_notify_get_error + + + + self + An #AnjutaAsyncNotify object + + + error + Return location for the error set by the called interface to which + this object was passed. If no error is set, @error is set to NULL. + + + Gets the error set on @self. + + + 4: Warning: Test: "@self" parameter unexpected at this location: + * @self: An #AnjutaAsyncNotify object + ^ + + + + + + /** + * GtkPrintOperation::done + * @operation: the #GtkPrintOperation on which the signal was emitted + * @result: the result of the print operation + * + * Emitted when the print operation run has finished doing + * everything required for printing. + * + * @result gives you information about what happened during the run. + * If @result is %GTK_PRINT_OPERATION_RESULT_ERROR then you can call + * gtk_print_operation_get_error() for more information. + * + * If you enabled print status tracking then + * gtk_print_operation_is_finished() may still return %FALSE + * after #GtkPrintOperation::done was emitted. + * + * Since: 2.10 + */ + + + + GtkPrintOperation::done + + + + operation + the #GtkPrintOperation on which the signal was emitted + + + result + the result of the print operation + + + Emitted when the print operation run has finished doing +everything required for printing. + +@result gives you information about what happened during the run. +If @result is %GTK_PRINT_OPERATION_RESULT_ERROR then you can call +gtk_print_operation_get_error() for more information. + +If you enabled print status tracking then +gtk_print_operation_is_finished() may still return %FALSE +after #GtkPrintOperation::done was emitted. + + + since + 2.10 + + + + + + + + /** + * TrackerDirectoryFlags: + * @TRACKER_DIRECTORY_FLAG_NONE: No flags. + * @TRACKER_DIRECTORY_FLAG_RECURSE: Should recurse in the directory. + * @TRACKER_DIRECTORY_FLAG_CHECK_MTIME: Should check mtimes of items in the directory. + * @TRACKER_DIRECTORY_FLAG_MONITOR: Should setup monitors in the items found in the directory. + * @TRACKER_DIRECTORY_FLAG_IGNORE: Should ignore the directory contents. + * @TRACKER_DIRECTORY_FLAG_PRESERVE: Should preserve items in the directory even if the directory gets removed. + * + * Flags used when adding a new directory to be indexed in the #TrackerIndexingTree. + */ + + + + TrackerDirectoryFlags + + + + TRACKER_DIRECTORY_FLAG_NONE + No flags. + + + TRACKER_DIRECTORY_FLAG_RECURSE + Should recurse in the directory. + + + TRACKER_DIRECTORY_FLAG_CHECK_MTIME + Should check mtimes of items in the directory. + + + TRACKER_DIRECTORY_FLAG_MONITOR + Should setup monitors in the items found in the directory. + + + TRACKER_DIRECTORY_FLAG_IGNORE + Should ignore the directory contents. + + + TRACKER_DIRECTORY_FLAG_PRESERVE + Should preserve items in the directory even if the directory gets removed. + + + Flags used when adding a new directory to be indexed in the #TrackerIndexingTree. + + + /** + * TrackerDirectoryFlags: + * @TRACKER_DIRECTORY_FLAG_NONE: No flags. + * @TRACKER_DIRECTORY_FLAG_RECURSE: Should recurse in the directory. + * @TRACKER_DIRECTORY_FLAG_CHECK_MTIME: Should check mtimes of items in the directory. + * @TRACKER_DIRECTORY_FLAG_MONITOR: Should setup monitors in the items found in the directory. + * @TRACKER_DIRECTORY_FLAG_IGNORE: Should ignore the directory contents. + * @TRACKER_DIRECTORY_FLAG_PRESERVE: Should preserve items in the directory even if the directory gets removed. + * + * Flags used when adding a new directory to be indexed in the #TrackerIndexingTree. + */ + + -- 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/parameter.xml | 58 +++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'tests/scanner/annotationparser/gi/parameter.xml') diff --git a/tests/scanner/annotationparser/gi/parameter.xml b/tests/scanner/annotationparser/gi/parameter.xml index fcf9ee42..43f97b3f 100644 --- a/tests/scanner/annotationparser/gi/parameter.xml +++ b/tests/scanner/annotationparser/gi/parameter.xml @@ -33,6 +33,12 @@ ^ + /** + * test_parameter_missing_colon: + * @param1: (allow-none): first parameter + * + * Forgotten colon above will result in a warning. + */ @@ -72,6 +78,14 @@ ^ + /** + * test_unexpected_parameter: + * @param1: first parameter + * + * Parameters should go before the comment block description. + * + * Returns: something + */ @@ -98,6 +112,10 @@ ^ + /** + * test_multiple_parameters: + * @param1: first parameter again + */ @@ -133,6 +151,13 @@ ^ + /** + * test_multiline_annotations_on_parameter: + * @param1: (allow-none): + * (transfer full): first parameter + * + * Annotations spanning multiple lines are not valid + */ @@ -163,6 +188,13 @@ Annotations spanning multiple lines are not valid + /** + * test_multiline_annotations_on_parameter: + * @param1: (allow-none): first parameter having a second line which looks + * (like an annotation), but isn't. This should not result in a warning. + * + * Annotations spanning multiple lines are not valid + */ @@ -199,6 +231,14 @@ ^ + /** + * anjuta_async_notify_get_error: + * @self: An #AnjutaAsyncNotify object + * @error: Return location for the error set by the called interface to which + * this object was passed. If no error is set, @error is set to NULL. + * + * Gets the error set on @self. + */ @@ -253,6 +293,24 @@ after #GtkPrintOperation::done was emitted. + /** + * GtkPrintOperation::done: + * @operation: the #GtkPrintOperation on which the signal was emitted + * @result: the result of the print operation + * + * Emitted when the print operation run has finished doing + * everything required for printing. + * + * @result gives you information about what happened during the run. + * If @result is %GTK_PRINT_OPERATION_RESULT_ERROR then you can call + * gtk_print_operation_get_error() for more information. + * + * If you enabled print status tracking then + * gtk_print_operation_is_finished() may still return %FALSE + * after #GtkPrintOperation::done was emitted. + * + * Since: 2.10 + */ -- cgit v1.2.1