use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class GprofShortcutTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest2");
ProjectScope ps = new ProjectScope(proj.getProject());
ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, ProviderProfileConstants.PLUGIN_ID);
scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
scoped.setValue(ProviderProfileConstants.PREFS_KEY + GPROF_CATEGORY, GPROF_PROVIDER_ID);
scoped.setValue(ProviderProfileConstants.USE_PROJECT_SETTINGS + GPROF_CATEGORY, true);
scoped.save();
IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LAUNCH_SHORT_EXTPT);
IConfigurationElement[] configs = extPoint.getConfigurationElements();
for (IConfigurationElement cfg : configs) {
if (cfg.getAttribute("id").equals(ID)) {
// $NON-NLS-1$
try {
// $NON-NLS-1$
shortcut = (ProviderLaunchShortcut) cfg.createExecutableExtension("class");
// $NON-NLS-1$
launchConfigTypeId = cfg.getChildren("class")[0].getChildren("parameter")[1].getAttribute("value");
} catch (Exception e) {
fail(e.getMessage());
}
}
}
config = createConfiguration(proj.getProject());
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class TestLaunching method testEventLaunch.
@Test
public void testEventLaunch() throws CoreException {
TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(OprofileLaunchPlugin.ATTR_USE_DEFAULT_EVENT, false);
wc.setAttribute(OprofileLaunchPlugin.attrConterEnabled(0), true);
wc.setAttribute(OprofileLaunchPlugin.attrCounterCount(0), 100000);
// $NON-NLS-1$
wc.setAttribute(OprofileLaunchPlugin.attrConterEvent(0, 0), "FAKE_EVENT");
wc.setAttribute(OprofileLaunchPlugin.attrCounterProfileKernel(0), true);
wc.setAttribute(OprofileLaunchPlugin.attrCounterProfileUser(0), true);
wc.setAttribute(OprofileLaunchPlugin.attrCounterUnitMask(0), 0);
wc.doSave();
LaunchTestingOptions options = new LaunchTestingOptions();
options.setOprofileProject(proj.getProject());
options.loadConfiguration(config);
assertTrue(options.isValid());
assertTrue(options.getBinaryImage().isEmpty());
assertTrue(options.getKernelImageFile().isEmpty());
assertEquals(OprofileDaemonOptions.SEPARATE_NONE, options.getSeparateSamples());
Oprofile.OprofileProject.setProfilingBinary(Oprofile.OprofileProject.OPERF_BINARY);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class LaunchRemoteTest method setUp.
@Before
public void setUp() throws Exception {
if ((!(AbstractRemoteTest.USERNAME.isEmpty()))) {
project = null;
config = createConfiguration(project);
delegate = new PerfLaunchConfigDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
setProfileAttributes(wc);
}
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class LaunchTest method setUp.
@Before
public void setUp() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest");
config = createConfiguration(proj.getProject());
delegate = new PerfLaunchConfigDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
wc = config.getWorkingCopy();
setProfileAttributes(wc);
}
use of org.eclipse.debug.core.Launch in project linuxtools by eclipse.
the class AbstractValgrindTest method doLaunch.
protected ILaunch doLaunch(ILaunchConfiguration config, String testName) throws URISyntaxException, IOException, CoreException {
ILaunch launch;
IPath pathToFiles = getPathToFiles(testName);
if (!ValgrindTestsPlugin.RUN_VALGRIND) {
bindLocation(pathToFiles);
}
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(LaunchConfigurationConstants.ATTR_INTERNAL_OUTPUT_DIR, pathToFiles.toOSString());
wc.doSave();
ValgrindTestLaunchDelegate delegate = new ValgrindTestLaunchDelegate();
launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
launches.add(launch);
delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
if (ValgrindTestsPlugin.RUN_VALGRIND) {
unbindLocation(pathToFiles);
}
return launch;
}
Aggregations