From a857bb18673cd47926e83d4efcd044df2a2bd29a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Norbert=20Pl=F6tt?= Date: Thu, 14 Dec 2006 13:19:24 +0000 Subject: [PATCH] bug #165205 - error parser test cases integrated in automated suite GCCErrorParserTests modified to provide at least basic functioning tests --- .../tests/GCCErrorParserTests.java | 32 +++++++++++++++++++ .../core/suite/AutomatedIntegrationSuite.java | 4 ++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java index 3398a994d76..569f28b6413 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/internal/errorparsers/tests/GCCErrorParserTests.java @@ -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}); + } } diff --git a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java index 73e5de4db48..39b16eb1b30 100644 --- a/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java +++ b/core/org.eclipse.cdt.core.tests/suite/org/eclipse/cdt/core/suite/AutomatedIntegrationSuite.java @@ -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());