Search in sources :

Example 86 with ILaunchConfigurationWorkingCopy

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

Example 87 with ILaunchConfigurationWorkingCopy

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"));
}
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 88 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 89 with ILaunchConfigurationWorkingCopy

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"));
}
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 90 with ILaunchConfigurationWorkingCopy

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"));
}
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