mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
autotools: Make tests fragments.
This allows direct access to everything in the bundles and doesn't require exporting the packages. Update test to directly call methods. Change-Id: I58ecdb68ba5058caf6c7baaa3ff22eb539d296cd Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
e061d97881
commit
375b162ea2
3 changed files with 15 additions and 35 deletions
|
@ -7,21 +7,17 @@ Bundle-Vendor: %provider
|
|||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.cdt.autotools.core;bundle-version="1.0.2",
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.cdt.managedbuilder.core,
|
||||
org.eclipse.cdt.ui,
|
||||
org.junit,
|
||||
org.eclipse.ui.ide,
|
||||
org.eclipse.jface.text,
|
||||
org.eclipse.ui.editors,
|
||||
org.eclipse.cdt.make.core,
|
||||
org.eclipse.cdt.make.ui,
|
||||
org.eclipse.ui.workbench.texteditor,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.autotools.ui;bundle-version="1.0.0",
|
||||
org.eclipse.cdt.core.tests
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Fragment-Host: org.eclipse.cdt.autotools.core
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Export-Package: org.eclipse.cdt.autotools.tests,
|
||||
org.eclipse.cdt.autotools.tests.autoconf,
|
||||
|
|
|
@ -26,10 +26,10 @@ import javax.xml.parsers.DocumentBuilderFactory;
|
|||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
|
||||
import org.eclipse.cdt.autotools.core.IAutotoolsOption;
|
||||
import org.eclipse.cdt.core.model.CoreModel;
|
||||
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
|
||||
import org.eclipse.cdt.internal.autotools.core.configure.AutotoolsConfigurationManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.IConfiguration;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
|
||||
import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
|
||||
|
@ -80,13 +80,13 @@ public class UpdateConfigureTest {
|
|||
ICConfigurationDescription cfgDes = CoreModel.getDefault().getProjectDescription(testProject).getActiveConfiguration();
|
||||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
|
||||
assertTrue(cfg.getName().equals("Build (GNU)"));
|
||||
Map<String, IAutotoolsOption> opts = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
Map<String, IAutotoolsOption> opts = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
|
||||
IAutotoolsOption k = opts.get(AutotoolsOptionConstants.OPT_CFLAGS_GPROF);
|
||||
k.setValue("true");
|
||||
|
||||
// Now update the options we changed
|
||||
AutotoolsPlugin.getDefault().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
AutotoolsConfigurationManager.getInstance().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
|
||||
// Rebuild project
|
||||
assertTrue(ProjectTools.build());
|
||||
|
@ -106,7 +106,7 @@ public class UpdateConfigureTest {
|
|||
}
|
||||
|
||||
// Reset gprof opt and set gcov opt
|
||||
opts = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
opts = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
k = opts.get(AutotoolsOptionConstants.OPT_CFLAGS_GPROF);
|
||||
k.setValue("false");
|
||||
|
||||
|
@ -114,7 +114,7 @@ public class UpdateConfigureTest {
|
|||
k.setValue("true");
|
||||
|
||||
// Now update the options we changed
|
||||
AutotoolsPlugin.getDefault().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
AutotoolsConfigurationManager.getInstance().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
|
||||
// Rebuild project
|
||||
assertTrue(ProjectTools.build());
|
||||
|
@ -130,7 +130,7 @@ public class UpdateConfigureTest {
|
|||
}
|
||||
|
||||
// Reset gcov opt and set debug opt
|
||||
opts = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
opts = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
k = opts.get(AutotoolsOptionConstants.OPT_CFLAGS_GCOV);
|
||||
k.setValue("false");
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class UpdateConfigureTest {
|
|||
k.setValue("true");
|
||||
|
||||
// Now update the options we changed
|
||||
AutotoolsPlugin.getDefault().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
AutotoolsConfigurationManager.getInstance().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
|
||||
// Rebuild project
|
||||
assertTrue(ProjectTools.build());
|
||||
|
@ -168,7 +168,7 @@ public class UpdateConfigureTest {
|
|||
ICConfigurationDescription cfgDes = CoreModel.getDefault().getProjectDescription(testProject).getActiveConfiguration();
|
||||
IConfiguration cfg = ManagedBuildManager.getConfigurationForDescription(cfgDes);
|
||||
assertTrue(cfg.getName().equals("Build (GNU)"));
|
||||
Map<String, IAutotoolsOption> opts = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
Map<String, IAutotoolsOption> opts = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
IAutotoolsOption configdir = opts.get(AutotoolsOptionConstants.OPT_CONFIGDIR);
|
||||
assertEquals(configdir.getType(), IAutotoolsOption.INTERNAL);
|
||||
assertTrue(configdir.getValue().equals("src"));
|
||||
|
@ -412,13 +412,13 @@ public class UpdateConfigureTest {
|
|||
// Verify last option changed has changed in our copy, but not
|
||||
// in the actual options
|
||||
assertEquals(k.getValue(), "true");
|
||||
Map<String, IAutotoolsOption> opts2 = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
Map<String, IAutotoolsOption> opts2 = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
IAutotoolsOption k2 = opts2.get(AutotoolsOptionConstants.OPT_VERSION);
|
||||
assertEquals(k2.getValue(), "false");
|
||||
|
||||
// Now update the options we changed
|
||||
AutotoolsPlugin.getDefault().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
opts2 = AutotoolsPlugin.getDefault().getAutotoolCfgOptions(testProject, cfg.getId());
|
||||
AutotoolsConfigurationManager.getInstance().updateAutotoolCfgOptions(testProject, cfg.getId(), opts);
|
||||
opts2 = AutotoolsConfigurationManager.getInstance().getAutotoolsCfgOptions(testProject, cfg.getId());
|
||||
|
||||
// Verify new option values
|
||||
k = opts2.get(AutotoolsOptionConstants.TOOL_AUTOGEN);
|
||||
|
|
|
@ -4,26 +4,10 @@ Bundle-Name: %bundleName
|
|||
Bundle-SymbolicName: org.eclipse.cdt.autotools.ui.tests
|
||||
Bundle-Version: 1.0.0.qualifier
|
||||
Bundle-Localization: plugin
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
org.eclipse.swtbot.eclipse.core,
|
||||
org.eclipse.swtbot.eclipse.finder,
|
||||
org.eclipse.swtbot.junit4_x,
|
||||
org.eclipse.swtbot.swt.finder,
|
||||
org.eclipse.swtbot.go,
|
||||
org.apache.log4j,
|
||||
Require-Bundle: org.eclipse.swtbot.go,
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.cdt.autotools.core,
|
||||
org.eclipse.cdt.autotools.ui,
|
||||
org.eclipse.cdt.core,
|
||||
org.eclipse.cdt.core.native,
|
||||
org.eclipse.cdt.launch,
|
||||
org.eclipse.cdt.make.core,
|
||||
org.eclipse.cdt.make.ui,
|
||||
org.eclipse.cdt.managedbuilder.core,
|
||||
org.eclipse.cdt.managedbuilder.gnu.ui,
|
||||
org.eclipse.cdt.managedbuilder.ui,
|
||||
org.eclipse.cdt.ui
|
||||
org.eclipse.cdt.core
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Fragment-Host: org.eclipse.cdt.autotools.ui
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
|
||||
Bundle-Vendor: %provider
|
||||
|
|
Loading…
Add table
Reference in a new issue