Skip to content
Permalink
Browse files

[FIXED JENKINS-14333] Ignore progress percentage in warning messages.

  • Loading branch information...
uhafner committed Jul 17, 2012
1 parent b471f6d commit 2643f1f13b737621f0450f3e6021f514b5c4debd
@@ -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}.
@@ -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
@@ -8,6 +8,7 @@
import java.util.Collection;
import java.util.Iterator;

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


@@ -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.
*
@@ -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.
You can’t perform that action at this time.