mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
bug 323445: Generate cross linked message for redeclaration xlc error
This commit is contained in:
parent
4d3edd80a2
commit
8cdd50422c
4 changed files with 51 additions and 0 deletions
|
@ -33,6 +33,7 @@ public class AllXlcErrorParserTests {
|
|||
suite.addTestSuite(TestCompatibility.class);
|
||||
suite.addTestSuite(TestUnrecoverableError.class);
|
||||
suite.addTestSuite(TestMacroRedefinition.class);
|
||||
suite.addTestSuite(TestRedeclaration.class);
|
||||
suite.addTestSuite(TestLinkerUndefinedSymbol.class);
|
||||
suite.addTestSuite(TestLinkerDuplicateSymbol.class);
|
||||
suite.addTestSuite(TestLinkerSevereError.class);
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2006, 2010 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM Corporation - initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.errorparsers.xlc.tests;
|
||||
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
|
||||
public class TestRedeclaration extends TestCase {
|
||||
/**
|
||||
* This function tests parseLine function of the
|
||||
* XlcErrorParser class. The second message generated by
|
||||
* xlc compiler for symbol redeclaration problem is given as
|
||||
* input for testing.
|
||||
*/
|
||||
public void testparseLine()
|
||||
{
|
||||
XlcErrorParserTester aix = new XlcErrorParserTester();
|
||||
// Redeclaration warning generates 2 cross-referencing messages.
|
||||
String err_msg = "\"src/temp1.c\", line 6.6: 1506-343 (S) Redeclaration of fun differs from previous declaration on line 334 of \"include/temp1.h\".";
|
||||
aix.parseLine(err_msg);
|
||||
assertEquals(2, aix.getNumberOfMarkers());
|
||||
|
||||
assertEquals("Redeclaration of fun differs from another declaration on line 6 of \"src/temp1.c\".", aix.getMessage(0));
|
||||
assertEquals("temp1.h", aix.getFileName(0));
|
||||
assertEquals(334, aix.getLineNumber(0));
|
||||
assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
|
||||
|
||||
assertEquals("Redeclaration of fun differs from previous declaration on line 334 of \"include/temp1.h\".", aix.getMessage(1));
|
||||
assertEquals("temp1.c", aix.getFileName(1));
|
||||
assertEquals(6, aix.getLineNumber(1));
|
||||
assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(1));
|
||||
}
|
||||
public TestRedeclaration( String name)
|
||||
{
|
||||
super(name);
|
||||
}
|
||||
}
|
|
@ -28,6 +28,9 @@ CDTXLCErrorParser.pattern.macro=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[
|
|||
CDTXLCErrorParser.pattern.macro.replacement=Macro name $4 has been redefined on line $2 of $1
|
||||
CDTXLCErrorParser.pattern.macro.crossreference=Macro name $4 redefines macro originally defined on line $5 of $6
|
||||
CDTXLCErrorParser.pattern.macro.ignore=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*Macro name .* has been redefined\\.
|
||||
# "src/temp1.c", line 6.6: 1506-343 (S) Redeclaration of fun differs from previous declaration on line 334 of "include/temp1.h".
|
||||
CDTXLCErrorParser.pattern.redeclaration=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(S\\)\\s*Redeclaration of (\\w+) differs from previous declaration on line (\\d+) of "(.*)"\\.
|
||||
CDTXLCErrorParser.pattern.redeclaration.crossreference=Redeclaration of $4 differs from another declaration on line $2 of "$1".
|
||||
# "main.cpp", line 10.6: 1540-0064 (S) Syntax error: "name" was expected but "char" was found.
|
||||
CDTXLCErrorParser.pattern.error=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*)
|
||||
CDTXLCErrorParser.pattern.warning=["]?(.*?)["]?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*)
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
<pattern regex="%CDTXLCErrorParser.pattern.macro.ignore" severity="Ignore" file-expr="" line-expr="" description-expr="" eat-processed-line="true" />
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.macro" severity="Warning" file-expr="$6" line-expr="$5" description-expr="%CDTXLCErrorParser.pattern.macro.replacement" eat-processed-line="false" />
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.macro" severity="Warning" file-expr="$1" line-expr="$2" description-expr="%CDTXLCErrorParser.pattern.macro.crossreference" eat-processed-line="true" />
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.redeclaration" severity="Info" file-expr="$6" line-expr="$5" description-expr="%CDTXLCErrorParser.pattern.redeclaration.crossreference" eat-processed-line="false" />
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.error" severity="Error" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.warning" severity="Warning" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
|
||||
<pattern regex="%CDTXLCErrorParser.pattern.info" severity="Info" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
|
||||
|
|
Loading…
Add table
Reference in a new issue