Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #28 from olafmandel/JENKINS-18913
Browse files Browse the repository at this point in the history
[FIXED JENKINS-18913] Make Doxygen parser handle global messages correctly
  • Loading branch information
uhafner committed Jul 24, 2013
2 parents 9b1c30d + b69168d commit ab33031
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Expand Up @@ -42,7 +42,9 @@ public class DoxygenParser extends RegexpDocumentParser {
* can get quite complex.
* The message is made of the remaining of the current line and of
* an arbitrary long (and optional) sequence of lines which can take many
* shapes, but that never begins like an absolute path or a function.
* shapes, but that never begins like an absolute path, a function or
* a global message. Global messages are excluded with a lookahead and
* file messages are detected via their first three characters:
* So we accept anything except '/' and '<' for the first character,
* anything except ':' (windows drive colon) for the second character,
* and anything except '/' (doxygen uses slash instead of backslash, after
Expand All @@ -52,10 +54,10 @@ public class DoxygenParser extends RegexpDocumentParser {
* suspicious).
* After these 3 characters, we accept anything until the end of the line.
* The whole multi-line message is matched by:
* (.+(?:\\n[^/<\\n][^:\\n][^\\\\\\n].+)*
* (.+(?:\\n(?!\\s*(?:[Nn]otice|[Ww]arning|[Ee]rror): )[^/<\\n][^:\\n][^/\\n].+)*)
* */
private static final String DOXYGEN_WARNING_PATTERN =
ANT_TASK + "(?:(?:((?:[/.]|[A-Za-z]:).+?):(-?\\d+):\\s*([Ww]arning|[Ee]rror)|<.+>:-?\\d+(?::\\s*([Ww]arning|[Ee]rror))?): (.+(?:\\n[^/<\\n][^:\\n][^/\\n].+)*)|\\s*([Nn]otice|[Ww]arning|[Ee]rror): (.+))$";
ANT_TASK + "(?:(?:((?:[/.]|[A-Za-z]:).+?):(-?\\d+):\\s*([Ww]arning|[Ee]rror)|<.+>:-?\\d+(?::\\s*([Ww]arning|[Ee]rror))?): (.+(?:\\n(?!\\s*(?:[Nn]otice|[Ww]arning|[Ee]rror): )[^/<\\n][^:\\n][^/\\n].+)*)|\\s*([Nn]otice|[Ww]arning|[Ee]rror): (.+))$";

/** The index of the regexp group capturing the file name (when the warning occurs in a file). */
private static final int FILE_NAME_GROUP = 1;
Expand Down
Expand Up @@ -32,7 +32,7 @@ public class DoxygenParserTest extends ParserTester {
public void testWarningsParser() throws IOException {
Collection<FileAnnotation> warnings = new DoxygenParser().parse(openFile());

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 21, warnings.size());
assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 22, warnings.size());

Iterator<FileAnnotation> iterator = warnings.iterator();
checkWarning(iterator.next(),
Expand Down Expand Up @@ -140,6 +140,11 @@ public void testWarningsParser() throws IOException {
"The following parameters of sofa::component::odesolver::EulerKaapiSolver::v_peq(VecId v, VecId a, double f) are not documented:\n parameter 'v'\n parameter 'a'",
"",
WARNING_TYPE, WARNING_CATEGORY, Priority.NORMAL);
checkWarning(iterator.next(),
0,
"Could not read image `/home/user/myproject/html/struct_foo_graph.png' generated by dot!",
"",
WARNING_TYPE, WARNING_CATEGORY, Priority.HIGH);
}

/**
Expand Down
Expand Up @@ -45,4 +45,5 @@ Possible candidates:
/home/user/myproject/helper/SimpleTimer.h:19: Error: Unexpected character `"'
<v_peq>:1: Warning: The following parameters of sofa::component::odesolver::EulerKaapiSolver::v_peq(VecId v, VecId a, double f) are not documented:
parameter 'v'
parameter 'a'
parameter 'a'
error: Could not read image `/home/user/myproject/html/struct_foo_graph.png' generated by dot!

0 comments on commit ab33031

Please sign in to comment.