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

Commit

Permalink
Browse files Browse the repository at this point in the history
[FIXED JENKINS-14333] Ignore progress percentage in warning messages.
  • Loading branch information
uhafner committed Jul 17, 2012
1 parent b471f6d commit 2643f1f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
Expand Up @@ -12,7 +12,7 @@
@Extension
public class AppleLLVMClangParser extends RegexpLineParser {
private static final long serialVersionUID = -3015592762345283182L;
private static final String CLANG_WARNING_PATTERN = "^\\s*(.*?):(\\d+):(?:\\d+:)?(?:(?:\\{\\d+:\\d+-\\d+:\\d+\\})+:)?\\s*warning:\\s*(.*?)(?:\\[(.*)\\])?$";
private static final String CLANG_WARNING_PATTERN = "^\\s*(?:\\d+%)?([^%]*?):(\\d+):(?:\\d+:)?(?:(?:\\{\\d+:\\d+-\\d+:\\d+\\})+:)?\\s*warning:\\s*(.*?)(?:\\[(.*)\\])?$";

/**
* Creates a new instance of {@link AppleLLVMClangParser}.
Expand All @@ -21,7 +21,7 @@ public AppleLLVMClangParser() {
super(Messages._Warnings_AppleLLVMClang_ParserName(),
Messages._Warnings_AppleLLVMClang_LinkName(),
Messages._Warnings_AppleLLVMClang_TrendName(),
CLANG_WARNING_PATTERN, true);
CLANG_WARNING_PATTERN);
}

@Override
Expand Down
Expand Up @@ -8,6 +8,7 @@
import java.util.Collection;
import java.util.Iterator;

import org.apache.commons.lang.StringUtils;
import org.junit.Test;


Expand All @@ -19,6 +20,23 @@
public class AppleLLVMClangParserTest extends ParserTester {
private static final String TYPE = new AppleLLVMClangParser().getGroup();

/**
* Parses a file with one warning that are started by ant.
*
* @throws IOException
* if the file could not be read
* @see <a href="http://issues.jenkins-ci.org/browse/JENKINS-14333">Issue 14333</a>
*/
@Test
public void issue14333() throws IOException {
Collection<FileAnnotation> warnings = new AppleLLVMClangParser().parse(openFile("issue14333.txt"));

assertEquals(WRONG_NUMBER_OF_WARNINGS_DETECTED, 1, warnings.size());
FileAnnotation annotation = warnings.iterator().next();
checkWarning(annotation, 1518, "Array access (via field 'yy_buffer_stack') results in a null pointer dereference",
"scanner.cpp", StringUtils.EMPTY, Priority.NORMAL);
}

/**
* Verifies that all messages are correctly parsed.
*
Expand Down
@@ -0,0 +1,2 @@
11% scanner.cpp:1518:28: warning: Array access (via field 'yy_buffer_stack') results in a null pointer dereference

0 comments on commit 2643f1f

Please sign in to comment.