mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 301338: [Error Parser] Makefile error parser shows bogus external location in problems view
This commit is contained in:
parent
916f81c0ce
commit
0315c2f844
3 changed files with 29 additions and 6 deletions
|
@ -686,4 +686,26 @@ public class RegexErrorParserTests extends TestCase {
|
|||
assertNotSame(clone1, clone2);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check how RegexErrorParser parses output.
|
||||
*
|
||||
* @throws Exception...
|
||||
*/
|
||||
public void testRegexErrorParserExternalLocation_bug301338() throws Exception {
|
||||
RegexErrorParser regexErrorParser = new RegexErrorParser();
|
||||
regexErrorParser.addPattern(new RegexErrorPattern("pattern",
|
||||
"", "", "", "$0", IMarkerGenerator.SEVERITY_ERROR_RESOURCE, true));
|
||||
|
||||
ErrorParserManager epManager = new ErrorParserManager(fProject, markerGenerator, new String[0]);
|
||||
|
||||
regexErrorParser.processLine("wrong pattern", epManager);
|
||||
regexErrorParser.processLine("pattern wrong", epManager);
|
||||
|
||||
errorList.clear();
|
||||
epManager.reportProblems();
|
||||
assertEquals(0, errorList.size());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -178,14 +178,14 @@
|
|||
class="org.eclipse.cdt.core.errorparsers.RegexErrorParser"
|
||||
id="org.eclipse.cdt.core.GmakeErrorParser"
|
||||
name="%CDTGNUMakeErrorParser.name">
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex="make.*:.*Error.*\(ignored\)" severity="Info"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex=".*make.*:.*Error.*\(ignored\)" severity="Info"/>
|
||||
<pattern description-expr="make: $3" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="(.*):(\d*): (\*\*\* .*)" severity="Error"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex="make.*: \*\*\* .*" severity="Error"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex="make.*: Target (.*) not remade because of errors." severity="Error"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex=".*make.*: \*\*\* .*" severity="Error"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex=".*make.*: Target (.*) not remade because of errors." severity="Error"/>
|
||||
<pattern description-expr="make: $3" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="(.*):(\d*): warning: (.*)" severity="Warning"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex="make.*\[.*\] Error [-]{0,1}\d*.*" severity="Warning"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex=".*make.*\[.*\] Error [-]{0,1}\d*.*" severity="Warning"/>
|
||||
<pattern description-expr="make: $3" eat-processed-line="true" file-expr="$1" line-expr="$2" regex="(.*):(\d*): (.*No such file or directory)" severity="Warning"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex="make.*: Circular .* dependency dropped." severity="Warning"/>
|
||||
<pattern description-expr="$0" eat-processed-line="true" file-expr="" line-expr="" regex=".*make.*: Circular .* dependency dropped." severity="Warning"/>
|
||||
</errorparser>
|
||||
</extension>
|
||||
<extension
|
||||
|
|
|
@ -277,7 +277,8 @@ public class RegexErrorPattern implements Cloneable {
|
|||
*/
|
||||
public boolean processLine(String line, ErrorParserManager eoParser) {
|
||||
Matcher matcher = getMatcher(line);
|
||||
if (!matcher.find())
|
||||
// pattern should cover the whole line
|
||||
if (!(matcher.find() && matcher.group(0).length()==line.length()))
|
||||
return false;
|
||||
|
||||
recordError(matcher, eoParser);
|
||||
|
|
Loading…
Add table
Reference in a new issue