use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class MultiProcessTest method testExec.
@Test
public void testExec() throws CoreException, URISyntaxException, IOException {
ILaunchConfigurationWorkingCopy config = createConfiguration(proj.getProject()).getWorkingCopy();
config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
config.doSave();
// $NON-NLS-1$
doLaunch(config, "testExec");
MassifViewPart view = (MassifViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
MassifOutput output = view.getOutput();
Integer[] pids = output.getPids();
assertEquals(2, pids.length);
// child not necessarily higher PID than parent
MassifSnapshot[] snapshots1 = output.getSnapshots(pids[0]);
assertTrue(snapshots1.length == 8 || snapshots1.length == 14);
MassifSnapshot[] snapshots2 = output.getSnapshots(pids[1]);
assertTrue(snapshots2.length == 8 || snapshots2.length == 14);
assertNotEquals(snapshots1.length, snapshots2.length);
if (snapshots1.length == 8) {
checkSnapshots(snapshots1, 400, 8);
checkSnapshots(snapshots2, 40, 16);
} else {
checkSnapshots(snapshots1, 40, 16);
checkSnapshots(snapshots2, 400, 8);
}
}
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 SortTest method prep.
@Before
public void prep() throws Exception {
// $NON-NLS-1$
proj = createProjectAndBuild("alloctest");
ILaunchConfiguration config = createConfiguration(proj.getProject());
ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, true);
wc.doSave();
// $NON-NLS-1$
doLaunch(config, "testStacks");
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class LaunchConfigTabTest method testL2Cache.
@Test
public void testL2Cache() throws Exception {
ILaunchConfigurationWorkingCopy wc = initConfig();
assertFalse(dynamicTab.getL2SizeSpinner().isEnabled());
dynamicTab.getL2Button().setSelection(true);
dynamicTab.getL2Button().notifyListeners(SWT.Selection, null);
assertTrue(dynamicTab.getL2SizeSpinner().isEnabled());
dynamicTab.getL2SizeSpinner().setSelection(16384);
dynamicTab.getL2AssocSpinner().setSelection(1);
dynamicTab.getL2LineSizeSpinner().setSelection(16);
tab.performApply(wc);
wc.doSave();
// $NON-NLS-1$
ILaunch launch = saveAndLaunch(wc, "testL2Cache");
IProcess[] p = launch.getProcesses();
assertTrue("process array should not be empty", p.length > 0);
String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
// $NON-NLS-1$
assertTrue(cmd.contains("--L2=16384,1,16"));
}
use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.
the class LaunchConfigTabTest method testDefaults.
@Test
public void testDefaults() throws Exception {
ILaunchConfigurationWorkingCopy wc = initConfig();
// $NON-NLS-1$
ILaunch launch = saveAndLaunch(wc, "testDefaults");
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("--tool=cachegrind"));
// $NON-NLS-1$
assertFalse(cmd.contains("--xml=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("-q"));
// $NON-NLS-1$
assertTrue(cmd.contains("--trace-children=no"));
// $NON-NLS-1$
assertTrue(cmd.contains("--child-silent-after-fork=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("--demangle=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("--num-callers=12"));
// $NON-NLS-1$
assertTrue(cmd.contains("--error-limit=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("--show-below-main=no"));
// $NON-NLS-1$
assertFalse(cmd.contains("--suppressions"));
// $NON-NLS-1$
assertTrue(cmd.contains("--max-stackframe=2000000"));
// $NON-NLS-1$
assertTrue(cmd.contains("--run-libc-freeres=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("--cache-sim=yes"));
// $NON-NLS-1$
assertTrue(cmd.contains("--branch-sim=no"));
}
Aggregations