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

Commit

Permalink
[FIXED JENKINS-36817] Fixed false positives.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Jan 10, 2017
1 parent d7977fe commit b49d2b8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
Expand Up @@ -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}.
Expand Down
14 changes: 14 additions & 0 deletions src/test/java/hudson/plugins/warnings/parser/ClangParserTest.java
Expand Up @@ -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.
*
Expand Down
@@ -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

2 changes: 1 addition & 1 deletion warnings.iml
Expand Up @@ -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" />
Expand Down

0 comments on commit b49d2b8

Please sign in to comment.