Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-01-18 11:36:34 -0500
committerMarkus Schorn2008-01-18 11:36:34 -0500
commitd8ed4e7b9674858b46c2802bcf364c4b2a3af892 (patch)
tree8d765e409fd5bd046f617566288b6cb190f6cbea /build/org.eclipse.cdt.make.core.tests
parent06ad4b31a5cf220af4f7e815dcf9f2c7571c691d (diff)
downloadorg.eclipse.cdt-d8ed4e7b9674858b46c2802bcf364c4b2a3af892.tar.gz
org.eclipse.cdt-d8ed4e7b9674858b46c2802bcf364c4b2a3af892.tar.xz
org.eclipse.cdt-d8ed4e7b9674858b46c2802bcf364c4b2a3af892.zip
Allow to configure empty macro definitions, bug 215789.
Diffstat (limited to 'build/org.eclipse.cdt.make.core.tests')
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java4
-rw-r--r--build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java58
2 files changed, 31 insertions, 31 deletions
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
index 915aeb253c..c35167cf6f 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/builder/tests/StandardBuildTests.java
@@ -1,6 +1,5 @@
-package org.eclipse.cdt.make.builder.tests;
/*******************************************************************************
- * Copyright (c) 2002, 2007 QNX Software Systems and others.
+ * Copyright (c) 2002, 2008 QNX Software Systems 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
@@ -10,6 +9,7 @@ package org.eclipse.cdt.make.builder.tests;
* QNX Software Systems - initial API and implementation
* Markus Schorn (Wind River Systems)
*******************************************************************************/
+package org.eclipse.cdt.make.builder.tests;
import junit.framework.Test;
import junit.framework.TestCase;
diff --git a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
index 48a82db70c..56f95aaf0a 100644
--- a/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
+++ b/build/org.eclipse.cdt.make.core.tests/src/org/eclipse/cdt/make/scannerdiscovery/BaseBOPConsoleParserTests.java
@@ -1,14 +1,14 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 IBM Corporation and others.
+ * Copyright (c) 2004, 2008 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 - Initial API and implementation
- * Anton Leherbauer (Wind River Systems)
- * Markus Schorn (Wind River Systems)
+ * IBM - Initial API and implementation
+ * Anton Leherbauer (Wind River Systems)
+ * Markus Schorn (Wind River Systems)
*******************************************************************************/
package org.eclipse.cdt.make.scannerdiscovery;
@@ -51,7 +51,7 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
public void testParsingSymbolDefinitions() {
fOutputParser.processLine("gcc -DMACRO1 -D MACRO2=value2 -c test.c"); // simple definitions //$NON-NLS-1$
- fOutputParser.processLine("gcc -D -DMACRO3 -c test.c"); // empty -D //$NON-NLS-1$
+ fOutputParser.processLine("gcc -D -DMACRO3= -c test.c"); // empty -D //$NON-NLS-1$
fOutputParser.processLine("gcc -D MACRO4='value4' -D 'MACRO5=value5' '-D MACRO6 = value6' -c test.c"); // single quotes //$NON-NLS-1$
fOutputParser.processLine("gcc -D'MACRO7=\"value 7\"' -D MACRO8='\"value 8\"' -c test.c"); // single quotes //$NON-NLS-1$
fOutputParser.processLine("gcc -DMACRO9=\"value9\" -D \"MACRO10=value10\" \"-D MACRO11 = value11\" -c test.c"); // double quotes //$NON-NLS-1$
@@ -62,9 +62,9 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("gcc -D 'SUM(x, y) = (x) + (y)' -c test.c"); // more complex macro definition //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("MACRO1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("MACRO1=1")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO2=value2")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("MACRO3")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("MACRO3=")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO4=value4")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO5=value5")); //$NON-NLS-1$
assertTrue(sumSymbols.contains("MACRO6 = value6")); //$NON-NLS-1$
@@ -84,7 +84,7 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("gcc -DMACRO1 -I ..\\inc -c ..\\perfilescdtest\\source.c"); // PR 80271 //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("MACRO1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("MACRO1=1")); //$NON-NLS-1$
assertTrue(sumSymbols.size() == 1);
}
@@ -93,7 +93,7 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("gcc -DBUG186065_IS_FIXED test.c"); //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("BUG186065_IS_FIXED")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("BUG186065_IS_FIXED=1")); //$NON-NLS-1$
assertTrue(sumSymbols.size() == 1);
}
@@ -106,12 +106,12 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("/usr/gcc/something_else -DF test6.c"); //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("A")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("B")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("C")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("D")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("E")); //$NON-NLS-1$
- assertFalse(sumSymbols.contains("F")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("C=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("D=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("E=1")); //$NON-NLS-1$
+ assertFalse(sumSymbols.contains("F=1")); //$NON-NLS-1$
assertEquals(5, sumSymbols.size());
}
@@ -120,10 +120,10 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("nix -DC; gcc -DD test2.c"); //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("A")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("B")); //$NON-NLS-1$
- assertFalse(sumSymbols.contains("C")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("D")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
+ assertFalse(sumSymbols.contains("C=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("D=1")); //$NON-NLS-1$
assertEquals(3, sumSymbols.size());
}
@@ -140,16 +140,16 @@ public abstract class BaseBOPConsoleParserTests extends BaseTestCase {
fOutputParser.processLine("sh -c 'nix -DCC; gcc -DDD test2.c'"); //$NON-NLS-1$
List sumSymbols = fCollector.getCollectedScannerInfo(null, ScannerInfoTypes.SYMBOL_DEFINITIONS);
- assertTrue(sumSymbols.contains("A")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("B")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("C")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("D")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("E")); //$NON-NLS-1$
- assertFalse(sumSymbols.contains("F")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("AA")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("BB")); //$NON-NLS-1$
- assertFalse(sumSymbols.contains("CC")); //$NON-NLS-1$
- assertTrue(sumSymbols.contains("DD")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("A=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("B=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("C=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("D=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("E=1")); //$NON-NLS-1$
+ assertFalse(sumSymbols.contains("F=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("AA=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("BB=1")); //$NON-NLS-1$
+ assertFalse(sumSymbols.contains("CC=1")); //$NON-NLS-1$
+ assertTrue(sumSymbols.contains("DD=1")); //$NON-NLS-1$
assertEquals(8, sumSymbols.size());
}

Back to the top