use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class OprofileLaunchShortcut method findLaunchConfiguration.
// need to have this here because a saved launch config will have the manual
// attribute left over, and a previous manual run will still run manually
// even if launched from the non-manual shortcut
@Override
protected ILaunchConfiguration findLaunchConfiguration(IBinary bin, String mode) {
ILaunchConfiguration config = super.findLaunchConfiguration(bin, mode);
try {
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.doSave();
} catch (CoreException e) {
e.printStackTrace();
}
return config;
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class LaunchConfigTabTest method testHistoryApprox.
@Test
public void testHistoryApprox() throws CoreException, URISyntaxException, IOException {
ILaunchConfigurationWorkingCopy wc = initConfig();
dynamicTab.getHistoryCombo().setText("approx");
tab.performApply(wc);
wc.doSave();
// $NON-NLS-1$
ILaunch launch = saveAndLaunch(wc, "testHelgrindGeneric");
IProcess[] p = launch.getProcesses();
assertTrue("process array should not be empty", p.length > 0);
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
assertEquals(0, p[0].getExitValue());
// $NON-NLS-1$
assertTrue(cmd.contains("--history-level=approx"));
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class ShortcutTest method compareWithDefaults.
private void compareWithDefaults(ILaunchConfiguration config) throws CoreException {
// tests launch in foreground, this is not typical
ILaunchConfiguration defaults = createConfiguration(proj.getProject());
ILaunchConfigurationWorkingCopy wc = defaults.getWorkingCopy();
wc.removeAttribute(IDebugUIConstants.ATTR_LAUNCH_IN_BACKGROUND);
wc.setAttribute(LaunchConfigurationConstants.ATTR_FULLPATH_AFTER, true);
wc.doSave();
// Compare launch config with defaults
assertEquals(config.getAttributes(), defaults.getAttributes());
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class LaunchConfigTabTest method testMaxSnapshots.
@Test
public void testMaxSnapshots() throws CoreException, URISyntaxException, IOException {
ILaunchConfigurationWorkingCopy wc = initConfig();
dynamicTab.getMaxSnapshotsSpinner().setSelection(200);
// $NON-NLS-1$
ILaunch launch = saveAndLaunch(wc, "testMaxSpapshots");
IProcess[] p = launch.getProcesses();
assertTrue("process array should not be empty", p.length > 0);
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
assertEquals(0, p[0].getExitValue());
// $NON-NLS-1$
assertTrue(cmd.contains("--max-snapshots=200"));
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class LaunchConfigTabTest method testAllocFn.
@Test
public void testAllocFn() throws CoreException, URISyntaxException, IOException {
ILaunchConfigurationWorkingCopy wc = initConfig();
// $NON-NLS-1$
dynamicTab.getAllocFnList().add("foo");
// $NON-NLS-1$
ILaunch launch = saveAndLaunch(wc, "testAllocFn");
IProcess[] p = launch.getProcesses();
assertTrue("process array should not be empty", p.length > 0);
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
assertEquals(0, p[0].getExitValue());
// $NON-NLS-1$
assertTrue(cmd.contains("--alloc-fn=foo"));
}
Aggregations