Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[FIXED JENKINS-36817] Fixed false positives.
  • Loading branch information
uhafner committed Jan 10, 2017
1 parent d7977fe commit b49d2b85a32f6b62a218386a2c922d48332973ed
@@ -14,7 +14,7 @@
@Extension
public class ClangParser extends RegexpLineParser {
private static final long serialVersionUID = -3015592762345283182L;
private static final String CLANG_WARNING_PATTERN = "^\\s*(?:\\d+%)?([^%]*?):(\\d+):(?:(\\d+):)?(?:(?:\\{\\d+:\\d+-\\d+:\\d+\\})+:)?\\s*(warning|.*error):\\s*(.*?)(?:\\[(.*)\\])?$";
private static final String CLANG_WARNING_PATTERN = "^\\s*(?:\\d+%)?([^%]*?):(\\d+):(?:(\\d+):)?(?:(?:\\{\\d+:\\d+-\\d+:\\d+\\})+:)?\\s*(warning|[^\\[\\]]*error):\\s*(.*?)(?:\\[(.*)\\])?$";

/**
* Creates a new instance of {@link ClangParser}.
@@ -37,6 +37,20 @@ public void issue31936() throws IOException {
"/Volumes/workspace/MyApp/ViewController.m", "-Wshorten-64-to-32", Priority.NORMAL);
}

/**
* Parses a file with fatal error message.
*
* @throws IOException
* if the file could not be read
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-36817">Issue 36817</a>
*/
@Test
public void issue36817() throws IOException {
Collection<FileAnnotation> warnings = new ClangParser().parse(openFile("issue36817.txt"));

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 0, warnings.size());
}

/**
* Parses a file with fatal error message.
*
@@ -0,0 +1,4 @@
2017-01-09 23:58:38.845 TheApp[23132:1512765431] void dbErrorLogCallback(...[Line 346] SQL error: 23 misuse at line 112343 of [c78c5a7786]
2017-01-09 23:57:56.598 TheApp[22354:151245512] void dbErrorLogCallback(...[Line 326] SQL error: 232 statement aborts at 12: [select a.id, a.zid, a.user_id
2017-01-09 23:58:38.943 TheApp[26457:151457651] void dbErrorLogCallback(...[Line 324] SQL error: 1 no such table: main.bin_fr_st

@@ -21,7 +21,7 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module" module-name="analysis-core" />
<orderEntry type="library" name="Maven: org.jvnet.hudson.plugins:analysis-core:1.82" level="project" />
<orderEntry type="library" name="Maven: de.java2html:java2html:5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.3.2" level="project" />
<orderEntry type="library" name="Maven: xerces:xercesImpl:2.11.0" level="project" />

0 comments on commit b49d2b8

Please sign in to comment.