Search in sources :

Example 41 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testTrackOrigins.

@Test
public void testTrackOrigins() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    IProject project = CDebugUtils.verifyCProject(config).getProject();
    Version ver = ValgrindLaunchPlugin.getDefault().getValgrindVersion(project);
    if (ver.compareTo(ValgrindLaunchPlugin.VER_3_4_0) >= 0) {
        dynamicTab.getTrackOriginsButton().setSelection(true);
        // $NON-NLS-1$
        ILaunch launch = saveAndLaunch(wc, "testTrackOrigins");
        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("--track-origins=yes"));
    } else {
        assertNull(dynamicTab.getTrackOriginsButton());
    }
}
Also used : Version(org.osgi.framework.Version) ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) IProcess(org.eclipse.debug.core.model.IProcess) IProject(org.eclipse.core.resources.IProject) Test(org.junit.Test)

Example 42 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testAlignmentBad.

@Test
public void testAlignmentBad() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    assertFalse(dynamicTab.getAlignmentSpinner().getEnabled());
    dynamicTab.getAlignmentButton().setSelection(true);
    dynamicTab.getAlignmentButton().notifyListeners(SWT.Selection, null);
    assertTrue(dynamicTab.getAlignmentSpinner().getEnabled());
    dynamicTab.getAlignmentSpinner().setSelection(63);
    tab.performApply(wc);
    config = wc.doSave();
    assertFalse(tab.isValid(config));
}
Also used : ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Test(org.junit.Test)

Example 43 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testFreeListVol.

@Test
public void testFreeListVol() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getFreelistSpinner().setSelection(2000000);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testFreeListVol");
    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("--freelist-vol=2000000"));
}
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 44 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testExtraOptions.

@Test
public void testExtraOptions() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    tab.getExtraOptionsText().setText(" -v  -v");
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testExtraOptions");
    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("-v -v"));
}
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 45 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testDemangle.

@Test
public void testDemangle() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    tab.getDemangleButton().setSelection(false);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testDemangle");
    IProcess[] p = launch.getProcesses();
    assertTrue(p.length > 0);
    String cmd = p[0].getAttribute(IProcess.ATTR_CMDLINE);
    assertEquals(0, p[0].getExitValue());
    // $NON-NLS-1$
    assertTrue(cmd.contains("--demangle=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