Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Make Doxygen parser handle global messages correctly
The parsing of local messages did not recognize global messages as a
point to stop grabbing the message.

[FIXED JENKINS-18913]
  • Loading branch information
olafmandel committed Jul 24, 2013
1 parent 9b1c30d commit b69168dc47956e26519d0f834e1735e73cde420c
@@ -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
@@ -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;
@@ -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(),
@@ -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);
}

/**
@@ -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 b69168d

Please sign in to comment.