Search in sources :

Example 91 with ILaunchConfigurationWorkingCopy

use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.

the class LaunchConfigTabTest method testDepth.

@Test
public void testDepth() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getDepthSpinner().setSelection(50);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testDepth");
    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("--depth=50"));
}
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 92 with ILaunchConfigurationWorkingCopy

use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.

the class LaunchConfigTabTest method testAllocFnSpace.

@Test
public void testAllocFnSpace() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    // $NON-NLS-1$
    dynamicTab.getAllocFnList().add("operator new(unsigned)");
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testAllocFnSpace");
    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=operator new(unsigned)"));
}
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 93 with ILaunchConfigurationWorkingCopy

use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.

the class LaunchConfigTabTest method testTimeUnitMilliseconds.

@Test
public void testTimeUnitMilliseconds() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    String[] items = dynamicTab.getTimeUnitCombo().getItems();
    int ix = -1;
    for (int i = 0; i < items.length; i++) {
        if (items[i].equals(MassifToolPage.TIME_MS_STRING)) {
            ix = i;
        }
    }
    dynamicTab.getTimeUnitCombo().select(ix);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testTimeUnitMilliseconds");
    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("--time-unit=ms"));
}
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 94 with ILaunchConfigurationWorkingCopy

use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.

the class LaunchConfigTabTest method testStacks.

@Test
public void testStacks() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getStacksButton().setSelection(true);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testStacks");
    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("--stacks=yes"));
}
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 95 with ILaunchConfigurationWorkingCopy

use of org.eclipse.debug.core.ILaunchConfigurationWorkingCopy in project linuxtools by eclipse.

the class LaunchConfigTabTest method testAllocFnMultiple.

@Test
public void testAllocFnMultiple() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    // $NON-NLS-1$
    dynamicTab.getAllocFnList().add("foo");
    // $NON-NLS-1$
    dynamicTab.getAllocFnList().add("bar");
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testAllocFnMultiple");
    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"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--alloc-fn=bar"));
}
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