diff options
author | Andrew Ferguson | 2008-01-16 11:20:05 +0000 |
---|---|---|
committer | Andrew Ferguson | 2008-01-16 11:20:05 +0000 |
commit | c76ee9c9805df5b7a5ccaafb5660c7ea323c39a2 (patch) | |
tree | 929eb7eeb57ddfb5fd36fdfde64878bb4bba3736 /build/org.eclipse.cdt.managedbuilder.core.tests | |
parent | 6fbc58a2e227d10d606520eeaa49f2e661a4d13d (diff) | |
download | org.eclipse.cdt-c76ee9c9805df5b7a5ccaafb5660c7ea323c39a2.tar.gz org.eclipse.cdt-c76ee9c9805df5b7a5ccaafb5660c7ea323c39a2.tar.xz org.eclipse.cdt-c76ee9c9805df5b7a5ccaafb5660c7ea323c39a2.zip |
197468: tighten test success conditions
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core.tests')
-rw-r--r-- | build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TestProcesses.java | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TestProcesses.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TestProcesses.java index f444b912dd8..c7370df3589 100644 --- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TestProcesses.java +++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/templateengine/tests/TestProcesses.java @@ -10,7 +10,7 @@ *******************************************************************************/ package org.eclipse.cdt.managedbuilder.templateengine.tests; -import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -62,23 +62,6 @@ public class TestProcesses extends TestCase { } } - /** - * @return a sensible number of arbitrary IConfiguration objects - */ - private List/*<IConfiguration>*/ getConfigurations() { - List/*<IConfiguration>*/ result= new ArrayList/*<IConfiguration>*/(); - IConfiguration[] configs= ManagedBuildManager.getExtensionConfigurations(); - for(int i=0; i<configs.length; i++) { - if(configs[i].getToolChain()!=null && configs[i].getBuilder()!=null) { - result.add(configs[i]); - } - } - if(result.size()>5) { - result= result.subList(0, 4); - } - return result; - } - public void testCreateIncludeFolder() { TemplateCore template = TemplateEngine.getDefault().getFirstTemplate(PROJECT_TYPE, null, ".*CreateIncludeFolder"); //$NON-NLS-1$ template.getTemplateInfo().setConfigurations(getConfigurations()); @@ -306,22 +289,26 @@ public class TestProcesses extends TestCase { private void assertSetMBSOptionValues(IProject project, String id, int optionType, boolean append) throws BuildException { IConfiguration[] projectConfigs = ManagedBuildManager.getBuildInfo(project).getManagedProject().getConfigurations(); + boolean foundCandidate= false; for(int i=0; i<projectConfigs.length; i++) { IConfiguration config = projectConfigs[i]; IOption[] globalOptions = config.getToolChain().getOptions(); - assertMBSOptionValues(id.toLowerCase(), globalOptions, optionType, append); + foundCandidate |= assertMBSOptionValues(id.toLowerCase(), globalOptions, optionType, append); ITool[] tools = config.getTools(); for(int j=0; j<tools.length; j++) { - assertMBSOptionValues(id.toLowerCase(), tools[j].getOptions(), optionType, append); + foundCandidate |= assertMBSOptionValues(id.toLowerCase(), tools[j].getOptions(), optionType, append); } } + assertTrue(foundCandidate); } - public void assertMBSOptionValues(String id, IOption[] options, int optionType, boolean append) throws BuildException { + public boolean assertMBSOptionValues(String id, IOption[] options, int optionType, boolean append) throws BuildException { + boolean foundCandidate= false; for (int i = 0; i < options.length; i++) { IOption option = options[i]; if (option.getId().toLowerCase().matches(id)) { + foundCandidate= true; if (option.getValueType() == optionType) { switch (optionType) { case IOption.BOOLEAN: @@ -360,6 +347,14 @@ public class TestProcesses extends TestCase { } } } + return foundCandidate; } + /** + * @return the gnu mingw exe debug configuration + */ + private List/*<IConfiguration>*/ getConfigurations() { + IConfiguration config= ManagedBuildManager.getExtensionConfiguration("cdt.managedbuild.config.gnu.mingw.exe.debug"); + return Collections.singletonList(config); + } } |