Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] New Managed Build Tests


Hi All,
I just committed a patch that solves a team problem where the project file was being overwritten too often. This patch contains an update to the managed build tests that exercise this. It also corrects a target definition that was improperly flagged as release instead of test. Tested on Linux and Win32.

It isn't Friday ....

Sean Evoy
Rational Software - IBM Software Group
Ottawa, Ontario, Canada

Index: ChangeLog
===================================================================
retrieving revision 1.209
diff -u -r1.209 ChangeLog
--- ChangeLog	16 Mar 2004 21:23:45 -0000	1.209
+++ ChangeLog	16 Mar 2004 22:08:27 -0000
@@ -1,3 +1,12 @@
+2004-03-12 Sean Evoy
+	Corrected a target definition in the plugin manifest that was flagged 
+	as release when it should have been flagged as test. Also updated the 
+	tests to save the build information after changes that make the build 
+	information dirty.
+	
+	* plugin.xml
+	* build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
+
 2004-03-16 Alain Magloire
 
 	Test from Thomas Fletcher for the Error Parser
Index: plugin.xml
===================================================================
retrieving revision 1.25
diff -u -r1.25 plugin.xml
--- plugin.xml	15 Mar 2004 16:01:12 -0000	1.25
+++ plugin.xml	16 Mar 2004 22:08:27 -0000
@@ -33,12 +33,12 @@
          point="org.eclipse.cdt.managedbuilder.core.ManagedBuildInfo">
       <tool
             natureFilter="both"
-            name="Target Independent Tool"
             sources="rc"
+            name="Target Independent Tool"
             headerExtensions="h"
             outputFlag="/fo"
-            command="RC.EXE"
             outputs="free"
+            command="RC.EXE"
             id="target.independent.tool">
          <optionCategory
                owner="target.independent.tool"
@@ -49,8 +49,8 @@
                defaultValue="Live free or die"
                name="String in Free"
                category="indy.cat.free"
-               valueType="string"
-               id="org.eclipse.cdt.core.tests.option1">
+               id="org.eclipse.cdt.core.tests.option1"
+               valueType="string">
          </option>
          <optionCategory
                owner="indy.cat.free"
@@ -61,8 +61,8 @@
                defaultValue="false"
                name="Boolean in Chained"
                category="indy.cat.chained"
-               valueType="boolean"
-               id="org.eclipse.cdt.core.tests.option2">
+               id="org.eclipse.cdt.core.tests.option2"
+               valueType="boolean">
          </option>
       </tool>
       <target
@@ -73,17 +73,17 @@
             defaultExtension="toor"
             isAbstract="false"
             makeCommand="make"
-            binaryParser="org.eclipse.cdt.core.PE"
             makeFlags="-k"
+            binaryParser="org.eclipse.cdt.core.PE"
             osList="win32">
          <tool
                natureFilter="cnature"
-               sources="foo,bar"
                name="Root Tool"
+               sources="foo,bar"
                headerExtensions="baz"
                outputFlag="-r"
-               outputs="toor"
                command="doIt"
+               outputs="toor"
                id="root.tool">
             <optionCategory
                   owner="root.tool"
@@ -93,39 +93,39 @@
             <option
                   name="List Option in Top"
                   command="-L"
-                  valueType="stringList"
-                  id="list.option">
+                  id="list.option"
+                  valueType="stringList">
                <listOptionValue
                      value="a">
                </listOptionValue>
                <listOptionValue
-                     value="b"
-                     builtIn="false">
+                     builtIn="false"
+                     value="b">
                </listOptionValue>
                <listOptionValue
-                     value="c"
-                     builtIn="true">
+                     builtIn="true"
+                     value="c">
                </listOptionValue>
             </option>
             <option
                   defaultValue="false"
                   name="Boolean Option in Top"
                   command="-b"
-                  valueType="boolean"
-                  id="boolean.option">
+                  id="boolean.option"
+                  valueType="boolean">
             </option>
             <option
                   defaultValue="x"
                   name="String Option in Category"
                   category="category"
-                  valueType="string"
-                  id="string.option">
+                  id="string.option"
+                  valueType="string">
             </option>
             <option
                   name="Enumerated Option in Category"
                   category="category"
-                  valueType="enumerated"
-                  id="enumerated.option">
+                  id="enumerated.option"
+                  valueType="enumerated">
                <enumeratedOptionValue
                      name="Default Enum"
                      isDefault="true"
@@ -198,17 +198,17 @@
          </configuration>
          <tool
                natureFilter="both"
-               sources="yarf"
                name="Sub Tool"
+               sources="yarf"
                headerExtensions="arf,barf"
-               outputs="bus"
                outputPrefix="lib"
+               outputs="bus"
                id="tool.sub">
             <option
                   name="Include Paths"
                   command="-I"
-                  valueType="includePath"
-                  id="sub.tool.opt.inc.paths">
+                  id="sub.tool.opt.inc.paths"
+                  valueType="includePath">
                <listOptionValue
                      value="/usr/include">
                </listOptionValue>
@@ -216,45 +216,45 @@
                      value="/opt/gnome/include">
                </listOptionValue>
                <listOptionValue
-                     value="/usr/gnu/include"
-                     builtIn="true">
+                     builtIn="true"
+                     value="/usr/gnu/include">
                </listOptionValue>
             </option>
             <option
                   name="Defined Symbols"
                   command="-D"
-                  valueType="definedSymbols"
-                  id="sub.tool.opt.def.symbols">
+                  id="sub.tool.opt.def.symbols"
+                  valueType="definedSymbols">
                <listOptionValue
-                     value="BUILTIN"
-                     builtIn="true">
+                     builtIn="true"
+                     value="BUILTIN">
                </listOptionValue>
             </option>
             <option
                   name="More Includes"
                   command="-I"
-                  valueType="includePath"
-                  id="sub.tool.opts.inc.paths.more">
+                  id="sub.tool.opts.inc.paths.more"
+                  valueType="includePath">
                <listOptionValue
-                     value="C:\home\tester/include"
-                     builtIn="false">
+                     builtIn="false"
+                     value="C:\home\tester/include">
                </listOptionValue>
                <listOptionValue
-                     value="&quot;../includes&quot;"
-                     builtIn="false">
+                     builtIn="false"
+                     value="&quot;../includes&quot;">
                </listOptionValue>
             </option>
             <option
                   name="User Objects"
-                  valueType="userObjs"
-                  id="sub.tool.opt.objs">
+                  id="sub.tool.opt.objs"
+                  valueType="userObjs">
                <listOptionValue
-                     value="obj1.o"
-                     builtIn="false">
+                     builtIn="false"
+                     value="obj1.o">
                </listOptionValue>
                <listOptionValue
-                     value="obj2.o"
-                     builtIn="false">
+                     builtIn="false"
+                     value="obj2.o">
                </listOptionValue>
             </option>
          </tool>
@@ -262,8 +262,8 @@
       <target
             isTest="true"
             name="Test Sub Sub"
-            parent="test.sub"
             binaryParser="org.eclipse.cdt.core.ELF"
+            parent="test.sub"
             defaultExtension="tss"
             makeCommand="nmake"
             id="test.sub.sub">
@@ -272,9 +272,10 @@
          </toolReference>
       </target>
       <target
+            isTest="true"
             name="Forward Grandchild"
-            parent="test.forward.child.target"
             binaryParser="org.eclipse.cdt.core.tests.target1"
+            parent="test.forward.child.target"
             id="test.forward.grandchild.target">
          <toolReference
                command="newcommand"
@@ -285,8 +286,8 @@
             isTest="true"
             osList="win32,solaris,linux"
             name="Forward Child"
-            binaryParser="org.eclipse.cdt.core.tests.target2"
             parent="test.forward.parent.target"
+            binaryParser="org.eclipse.cdt.core.tests.target2"
             id="test.forward.child.target">
          <toolReference
                id="test.forward.tool">
Index: build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java
===================================================================
retrieving revision 1.21
diff -u -r1.21 ManagedBuildTests.java
--- build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java	15 Mar 2004 16:01:12 -0000	1.21
+++ build/org/eclipse/cdt/core/build/managed/tests/ManagedBuildTests.java	16 Mar 2004 22:08:28 -0000
@@ -41,7 +41,6 @@
 import org.eclipse.cdt.managedbuilder.core.IOptionCategory;
 import org.eclipse.cdt.managedbuilder.core.ITarget;
 import org.eclipse.cdt.managedbuilder.core.ITool;
-import org.eclipse.cdt.managedbuilder.core.IToolReference;
 import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
 import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
 import org.eclipse.cdt.managedbuilder.internal.core.OptionReference;
@@ -176,6 +175,8 @@
 		targets[0].resetMakeCommand();
 		assertFalse(targets[0].hasOverridenMakeCommand());
 		assertEquals(oldMakeCmd, targets[0].getMakeCommand());
+		
+		ManagedBuildManager.saveBuildInfo(project, false);
 	}
 	
 	
@@ -219,13 +220,15 @@
 		for (int i = 0; i < baseConfigs.length; ++i) {
 			newTarget.createConfiguration(baseConfigs[i], baseConfigs[i].getId() + "." + i);
 		}
-				
 		// Change the default configuration to the sub config
 		IConfiguration[] configs = newTarget.getConfigurations();
 		assertEquals(4, configs.length);
 		IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
 		buildInfo.setDefaultConfiguration(newTarget.getConfiguration(configs[0].getId()));
 
+		// Save the build info
+		ManagedBuildManager.saveBuildInfo(project, false);		
+
 		// Use the plugin mechanism to discover the supplier of the path information
 		IExtensionPoint extensionPoint = CCorePlugin.getDefault().getDescriptor().getExtensionPoint("ScannerInfoProvider");
 		if (extensionPoint == null) {
@@ -315,7 +318,7 @@
 		// Open the test project
 		IProject project = createProject(projectName);
 		
-		// Make sure there is one and only one target with 2 configs
+		// Make sure there is one and only one target with 3 configs
 		ITarget[] definedTargets = ManagedBuildManager.getTargets(project);
 		assertEquals(1, definedTargets.length);
 		ITarget rootTarget = definedTargets[0];
@@ -359,7 +362,7 @@
 		ManagedBuildManager.setOption(newConfig, options[1], enumVal);
 
 		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
+		ManagedBuildManager.saveBuildInfo(project, false);
 		project.close(null);
 		ManagedBuildManager.removeBuildInfo(project);
 		project.open(null);
@@ -378,6 +381,7 @@
 		assertEquals(3, definedConfigs.length);
 		assertEquals(definedConfigs[0].getName(), rootName);
 		assertEquals(definedConfigs[1].getName(), overrideName);
+		ManagedBuildManager.saveBuildInfo(project, false);
 	}
 	
 	public void testConfigurationReset() {
@@ -406,6 +410,7 @@
 		
 		// Reset the config and retest
 		ManagedBuildManager.resetConfiguration(project, defaultConfig);
+		ManagedBuildManager.saveBuildInfo(project, false);
 		try {
 			checkRootTarget(defaultTarget);
 		} catch (BuildException e2) {
@@ -474,7 +479,7 @@
 		assertEquals("z", options[0].getStringValue());
 		
 		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
+		ManagedBuildManager.saveBuildInfo(project, true);
 		try {
 			project.close(null);
 		} catch (CoreException e) {
@@ -1202,7 +1207,7 @@
 		rootTarget.setArtifactName(name);
 		
 		// Save, close, reopen and test again
-		ManagedBuildManager.saveBuildInfo(project);
+		ManagedBuildManager.saveBuildInfo(project, false);
 		project.close(null);
 		ManagedBuildManager.removeBuildInfo(project);
 		project.open(null);

Back to the top