Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Fixed Issue JENKINS-17075:
DiabCParser recognizes now a "fatal error".
  • Loading branch information
schlangguru committed Jun 25, 2013
1 parent 981c01a commit 6a9c77bbafa05ed3e921b2884e9e34bd7b86449c
@@ -31,4 +31,4 @@
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
</classpath>
@@ -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>.
@@ -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();
@@ -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
@@ -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.