1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

bug 398681: CDT does not understand some of xlC diagnostic messages

This commit is contained in:
Andrew Gvozdev 2013-01-21 15:18:25 -05:00
parent 911f69b92e
commit 90353a19c1
9 changed files with 255 additions and 0 deletions

View file

@ -22,6 +22,8 @@ public class AllXlcErrorParserTests {
TestSuite suite = new TestSuite("Testsuite for xlc compiler error parser"); TestSuite suite = new TestSuite("Testsuite for xlc compiler error parser");
//$JUnit-BEGIN$ //$JUnit-BEGIN$
suite.addTestSuite(TestInformationalMessage_1.class); suite.addTestSuite(TestInformationalMessage_1.class);
suite.addTestSuite(TestInformationalMessage_2.class);
suite.addTestSuite(TestInformationalMessage_3.class);
suite.addTestSuite(TestWarning_1.class); suite.addTestSuite(TestWarning_1.class);
suite.addTestSuite(TestError_1.class); suite.addTestSuite(TestError_1.class);
suite.addTestSuite(TestSevereError_1.class); suite.addTestSuite(TestSevereError_1.class);
@ -30,15 +32,21 @@ public class AllXlcErrorParserTests {
suite.addTestSuite(TestSevereError_4.class); suite.addTestSuite(TestSevereError_4.class);
suite.addTestSuite(TestSevereError_5.class); suite.addTestSuite(TestSevereError_5.class);
suite.addTestSuite(TestUnrecoverableError_1.class); suite.addTestSuite(TestUnrecoverableError_1.class);
suite.addTestSuite(TestUnrecoverableError_2.class);
suite.addTestSuite(TestUnrecoverableError_3.class);
suite.addTestSuite(TestCompatibility.class); suite.addTestSuite(TestCompatibility.class);
suite.addTestSuite(TestRedefinition.class); suite.addTestSuite(TestRedefinition.class);
suite.addTestSuite(TestRedeclaration.class); suite.addTestSuite(TestRedeclaration.class);
suite.addTestSuite(TestCommandOptionNotRecognized.class);
suite.addTestSuite(TestLinkerCommandOptionNotRecognized.class);
suite.addTestSuite(TestLinkerUndefinedSymbol.class); suite.addTestSuite(TestLinkerUndefinedSymbol.class);
suite.addTestSuite(TestLinkerDuplicateSymbol.class); suite.addTestSuite(TestLinkerDuplicateSymbol.class);
suite.addTestSuite(TestLinkerSevereError.class); suite.addTestSuite(TestLinkerSevereError.class);
suite.addTestSuite(TestLinkerErrorWhileReading.class); suite.addTestSuite(TestLinkerErrorWhileReading.class);
suite.addTestSuite(TestLinkerInfo.class); suite.addTestSuite(TestLinkerInfo.class);
//$JUnit-END$ //$JUnit-END$
return suite; return suite;
} }

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev 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:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestCommandOptionNotRecognized extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A warning message generated by
* xlc compiler about command options is given as
* input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
assertEquals("command option 9 is not recognized - passed to ld",aix.getMessage(0));
}
public TestCommandOptionNotRecognized(String name)
{
super(name);
err_msg = "/usr/vacpp/bin/xlc: 1501-216 command option 9 is not recognized - passed to ld";
}
}

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev 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:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestInformationalMessage_2 extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A variant of informational message generated by
* xlc compiler with no file or line is given as
* input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
assertEquals("clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192.",aix.getMessage(0));
}
public TestInformationalMessage_2( String name)
{
super(name);
err_msg = " 1500-030: (I) INFORMATION: clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192.";
}
}

View file

@ -0,0 +1,38 @@
/*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev 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:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestInformationalMessage_3 extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A variant of informational message generated by
* xlc compiler is given as input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_INFO, aix.getSeverity(0));
assertEquals("Global variable \"__td __td__Q2_3std13runtime_error\" is not used.",aix.getMessage(0));
}
public TestInformationalMessage_3( String name)
{
super(name);
err_msg = "1540-5336 (I) Global variable \"__td __td__Q2_3std13runtime_error\" is not used.";
}
}

View file

@ -0,0 +1,40 @@
/*******************************************************************************
* Copyright (c) 2006, 2009 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 TestLinkerCommandOptionNotRecognized extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A warning message generated by
* xlc linker about command options is given as
* input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_WARNING, aix.getSeverity(0));
assertEquals("The -9 flag is not recognized.",aix.getMessage(0));
}
public TestLinkerCommandOptionNotRecognized(String name)
{
super(name);
err_msg = "ld: 0706-012 The -9 flag is not recognized.";
}
}

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev 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:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestUnrecoverableError_2 extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A variant of error message generated by
* xlc compiler with unrecoverable severity (U) is given as
* input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
assertEquals("An error occurred during code generation. The code generation return code was 1.",aix.getMessage(0));
}
public TestUnrecoverableError_2( String name)
{
super(name);
err_msg = "1586-346 (U) An error occurred during code generation. The code generation return code was 1.";
}
}

View file

@ -0,0 +1,39 @@
/*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev 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:
* Andrew Gvozdev - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.errorparsers.xlc.tests;
import junit.framework.TestCase;
import org.eclipse.cdt.core.IMarkerGenerator;
public class TestUnrecoverableError_3 extends TestCase {
String err_msg;
/**
* This function tests parseLine function of the
* XlcErrorParser class. A variant of error message generated by
* xlc compiler with unrecoverable severity (U) is given as
* input for testing.
*/
public void testparseLine()
{
XlcErrorParserTester aix = new XlcErrorParserTester();
aix.parseLine(err_msg);
assertEquals("", aix.getFileName(0));
assertEquals(0, aix.getLineNumber(0));
assertEquals(IMarkerGenerator.SEVERITY_ERROR_RESOURCE, aix.getSeverity(0));
assertEquals("INTERNAL COMPILER ERROR while compiling ----. Compilation ended. Contact your Service Representative and provide the following information: Internal abort. For more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810",aix.getMessage(0));
}
public TestUnrecoverableError_3( String name)
{
super(name);
err_msg = " 1500-004: (U) INTERNAL COMPILER ERROR while compiling ----. Compilation ended. Contact your Service Representative and provide the following information: Internal abort. For more information visit: http://www.ibm.com/support/docview.wss?uid=swg21110810";
}
}

View file

@ -35,10 +35,19 @@ CDTXLCErrorParser.pattern.redeclaration.crossreference=Redeclaration of $4 diffe
CDTXLCErrorParser.pattern.error="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\([USE]\\)\\s*(.*) 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*(.*) CDTXLCErrorParser.pattern.warning="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(W\\)\\s*(.*)
CDTXLCErrorParser.pattern.info="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*) CDTXLCErrorParser.pattern.info="?([^"]*)"?, line ([0-9]+)\\.[0-9]+:( [0-9]*-[0-9]*)? \\(I\\)\\s*(.*)
# 1586-346 (U) An error occurred during code generation. The code generation return code was 1.
CDTXLCErrorParser.pattern.error2=\\s*([0-9]*-[0-9]*:?)? \\([USE]\\)\\s*(.*)
# /usr/vacpp/bin/xlc: 1501-216 command option 9 is not recognized - passed to ld
CDTXLCErrorParser.pattern.warning2=/[/\\w]+: [0-9]+-[0-9]+\\s*(.*)
# 1500-030: (I) INFORMATION: clazz::fun(): Additional optimization may be attained by recompiling and specifying MAXMEM option with a value greater than 8192.
# 1540-5336 (I) Global variable "__td __td__Q2_3std13runtime_error" is not used.
CDTXLCErrorParser.pattern.info2=\\s*([0-9]*-[0-9]*:?)? \\(I\\)( INFORMATION:)?\\s*(.*)
# ld: 0711-224 WARNING: Duplicate symbol: symboldupe # ld: 0711-224 WARNING: Duplicate symbol: symboldupe
# WARNING, ERROR, SEVERE ERROR etc. # WARNING, ERROR, SEVERE ERROR etc.
CDTXLCErrorParser.pattern.ld.error=ld: ([0-9]+-[0-9]+).*ERROR:\\s*(.*) CDTXLCErrorParser.pattern.ld.error=ld: ([0-9]+-[0-9]+).*ERROR:\\s*(.*)
CDTXLCErrorParser.pattern.ld.warning=ld: ([0-9]+-[0-9]+)\\s*WARNING:\\s*(.*) CDTXLCErrorParser.pattern.ld.warning=ld: ([0-9]+-[0-9]+)\\s*WARNING:\\s*(.*)
# ld: 0706-012 The -9 flag is not recognized.
CDTXLCErrorParser.pattern.ld.warning2=ld: 0706-012\\s*(.*)
# ld: 0711-987 Error occurred while reading file # ld: 0711-987 Error occurred while reading file
CDTXLCErrorParser.pattern.ld.error2=ld: ([0-9]+-[0-9]+)\\s*(Error .*) CDTXLCErrorParser.pattern.ld.error2=ld: ([0-9]+-[0-9]+)\\s*(Error .*)
# ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information. # ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.

View file

@ -11,11 +11,15 @@
<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.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="Error" file-expr="$6" line-expr="$5" description-expr="%CDTXLCErrorParser.pattern.redeclaration.crossreference" eat-processed-line="false" /> <pattern regex="%CDTXLCErrorParser.pattern.redeclaration" severity="Error" 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.error" severity="Error" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.error2" severity="Error" file-expr="" line-expr="" description-expr="$2" 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.warning" severity="Warning" file-expr="$1" line-expr="$2" description-expr="$4" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.warning2" severity="Warning" file-expr="" line-expr="" description-expr="$1" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.info" severity="Info" 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"/>
<pattern regex="%CDTXLCErrorParser.pattern.info2" severity="Info" file-expr="" line-expr="" description-expr="$3" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.error" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/> <pattern regex="%CDTXLCErrorParser.pattern.ld.error" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.error2" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/> <pattern regex="%CDTXLCErrorParser.pattern.ld.error2" severity="Error" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.warning" severity="Warning" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/> <pattern regex="%CDTXLCErrorParser.pattern.ld.warning" severity="Warning" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.warning2" severity="Warning" file-expr="" line-expr="" description-expr="$1" eat-processed-line="true"/>
<pattern regex="%CDTXLCErrorParser.pattern.ld.info" severity="Info" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/> <pattern regex="%CDTXLCErrorParser.pattern.ld.info" severity="Info" file-expr="" line-expr="" description-expr="$2" eat-processed-line="true"/>
</errorparser> </errorparser>
</extension> </extension>