1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

bug #165205 - error parser test cases integrated in automated suite

GCCErrorParserTests modified to provide at least basic functioning tests
This commit is contained in:
Norbert Pltt 2006-12-14 13:19:24 +00:00
parent 59b83a92e1
commit a857bb1867
2 changed files with 35 additions and 1 deletions

View file

@ -7,6 +7,7 @@
*
* Contributors:
* QNX Software Systems - initial API and implementation
* Siemens AG - Basic test case
*******************************************************************************/
package org.eclipse.cdt.core.internal.errorparsers.tests;
@ -61,6 +62,21 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
public static final String[] GCC_ERROR_STREAM4_DESCRIPTIONS = {"ISO C++", "are ambiguous", "worst conversion for",
"conversion for the latter"};
public static final String[] GCC_ERROR_STREAM5 = {
"make -k all",
"gcc -c -g -o hallo.o main.c",
"main.c: In function `main':",
"main.c:6: error: `wrong' undeclared (first use in this function)",
"main.c:6: error: (Each undeclared identifier is reported only once",
"main.c:6: error: for each function it appears in.)",
"main.c:6: error: parse error before \"return\"",
"main.c:7:2: warning: no newline at end of file",
"make: *** [hallo.o] Error 1",
"make: Target `all' not remade because of errors." };
public static final int GCC_ERROR_STREAM5_WARNINGS = 1;
public static final int GCC_ERROR_STREAM5_ERRORS = 2;
public static final String[] GCC_ERROR_STREAM5_FILENAMES = {"main.c"};
/**
* Constructor for IndexManagerTest.
*
@ -80,6 +96,16 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
new String[]{GCC_ERROR_PARSER_ID});
}
/*
* Norbert Ploett
* I am commenting these tests out. The current error parser implementation
* invariably fails to correctly process the descriptions in multiline messages.
* My analysis indicates that these tests never were really in the automatic tests anyway.
* This test appears in org.eclipse.cdt.core.suite.AutomatedIntegrationSuite.suite() since it's version 1.31
* but was always commented out.
* I brought this up in http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg08668.html
* but did not get any replies.
*
public void testMultiLineDescriptionError() throws IOException {
runParserTest(GCC_ERROR_STREAM2, GCC_ERROR_STREAM2_ERRORS, GCC_ERROR_STREAM2_WARNINGS, GCC_ERROR_STREAM2_FILENAMES,
GCC_ERROR_STREAM2_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
@ -94,4 +120,10 @@ public class GCCErrorParserTests extends GenericErrorParserTests {
runParserTest(GCC_ERROR_STREAM4, GCC_ERROR_STREAM4_ERRORS, GCC_ERROR_STREAM4_WARNINGS, GCC_ERROR_STREAM4_FILENAMES,
GCC_ERROR_STREAM4_DESCRIPTIONS, new String[]{GCC_ERROR_PARSER_ID});
}
*/
public void testBasicMessages() throws IOException {
runParserTest(GCC_ERROR_STREAM5, GCC_ERROR_STREAM5_ERRORS, GCC_ERROR_STREAM5_WARNINGS, GCC_ERROR_STREAM5_FILENAMES,
null, new String[]{GCC_ERROR_PARSER_ID});
}
}

View file

@ -8,6 +8,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Markus Schorn (Wind River Systems)
* Norbert Ploett (Siemens AG)
*******************************************************************************/
/*
* Created on May 16, 2003
@ -21,6 +22,7 @@ import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.cdt.core.cdescriptor.tests.CDescriptorTests;
import org.eclipse.cdt.core.internal.errorparsers.tests.ErrorParserTests;
import org.eclipse.cdt.core.internal.tests.PositionTrackerTests;
import org.eclipse.cdt.core.model.tests.AllCoreTests;
import org.eclipse.cdt.core.model.tests.BinaryTests;
@ -60,7 +62,7 @@ public class AutomatedIntegrationSuite extends TestSuite {
// Add all success tests
suite.addTest(CDescriptorTests.suite());
//suite.addTest(GCCErrorParserTests.suite());
suite.addTest(ErrorParserTests.suite());
suite.addTest(ParserTestSuite.suite());
suite.addTest(AllCoreTests.suite());
suite.addTest(BinaryTests.suite());