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

Commit

Permalink
Fixed Issue JENKINS-17075:
Browse files Browse the repository at this point in the history
DiabCParser recognizes now a "fatal error".
  • Loading branch information
schlangguru committed Jun 25, 2013
1 parent 981c01a commit 6a9c77b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .classpath
Expand Up @@ -31,4 +31,4 @@
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
</classpath>
Expand Up @@ -15,7 +15,7 @@
public class DiabCParser extends RegexpLineParser {
private static final long serialVersionUID = -1251248150596418456L;

private static final String DIAB_CPP_WARNING_PATTERN = "^\\s*\"(.*)\"\\s*,\\s*line\\s*(\\d+)\\s*:\\s*(warning|error)\\s*\\(dcc:(\\d+)\\)\\s*:\\s*(.*)$";
private static final String DIAB_CPP_WARNING_PATTERN = "^\\s*\"(.*)\"\\s*,\\s*line\\s*(\\d+)\\s*:\\s*(warning|error|fatal\\s{1}error)\\s*\\(dcc:(\\d+)\\)\\s*:\\s*(.*)$";

/**
* Creates a new instance of <code>HpiCompileParser</code>.
Expand Down
Expand Up @@ -26,7 +26,7 @@ public class DiabCParserTest extends ParserTester {
public void parseDiabCpp() throws IOException {
Collection<FileAnnotation> warnings = new DiabCParser().parse(openFile());

assertEquals("Wrong number of warnings detected.", 5, warnings.size());
assertEquals("Wrong number of warnings detected.", 8, warnings.size());

Iterator<FileAnnotation> iterator = warnings.iterator();
FileAnnotation annotation = iterator.next();
Expand Down Expand Up @@ -59,6 +59,24 @@ public void parseDiabCpp() throws IOException {
"function f5 is not found",
"lint.c",
TYPE, "1378", Priority.HIGH);
annotation = iterator.next();
checkWarning(annotation,
5,
"division by zero",
"main.c",
TYPE, "1025", Priority.NORMAL);
annotation = iterator.next();
checkWarning(annotation,
5,
"division by zero",
"main.c",
TYPE, "1025", Priority.HIGH);
annotation = iterator.next();
checkWarning(annotation,
5,
"division by zero",
"main.c",
TYPE, "1025", Priority.HIGH);
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/test/resources/hudson/plugins/warnings/parser/diabc.txt
Expand Up @@ -3,4 +3,6 @@
"lint.c", line 28: warning (dcc:1243): constant out of range
"lint.c", line 4: warning (dcc:1517): function f4 is never used
"lint.c", line 11: error (dcc:1378): function f5 is not found

"main.c", line 5: warning (dcc:1025): division by zero
"main.c", line 5: error (dcc:1025): division by zero
"main.c", line 5: fatal error (dcc:1025): division by zero

0 comments on commit 6a9c77b

Please sign in to comment.