Search in sources :

Example 31 with ILaunchConfigurationWorkingCopy

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);
    }
}
Also used : MassifSnapshot(org.eclipse.linuxtools.internal.valgrind.massif.MassifSnapshot) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) MassifOutput(org.eclipse.linuxtools.internal.valgrind.massif.MassifOutput) MassifViewPart(org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart) Test(org.junit.Test)

Example 32 with ILaunchConfigurationWorkingCopy

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());
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)

Example 33 with ILaunchConfigurationWorkingCopy

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");
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Before(org.junit.Before)

Example 34 with ILaunchConfigurationWorkingCopy

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"));
}
Also used : ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) IProcess(org.eclipse.debug.core.model.IProcess) Test(org.junit.Test)

Example 35 with ILaunchConfigurationWorkingCopy

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"));
}
Also used : ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) IProcess(org.eclipse.debug.core.model.IProcess) Test(org.junit.Test)

Aggregations

ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)119 Test (org.junit.Test)75 ILaunch (org.eclipse.debug.core.ILaunch)52 IProcess (org.eclipse.debug.core.model.IProcess)49 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)29 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)18 CoreException (org.eclipse.core.runtime.CoreException)16 IPath (org.eclipse.core.runtime.IPath)12 ILaunchManager (org.eclipse.debug.core.ILaunchManager)10 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)8 IProject (org.eclipse.core.resources.IProject)7 Shell (org.eclipse.swt.widgets.Shell)7 ArrayList (java.util.ArrayList)6 Path (org.eclipse.core.runtime.Path)6 ILaunchConfigurationTab (org.eclipse.debug.ui.ILaunchConfigurationTab)5 Version (org.osgi.framework.Version)5 IResource (org.eclipse.core.resources.IResource)4 Launch (org.eclipse.debug.core.Launch)3 MassifViewPart (org.eclipse.linuxtools.internal.valgrind.massif.MassifViewPart)3 Button (org.eclipse.swt.widgets.Button)3