Search in sources :

Example 66 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testNoSim.

@Test
public void testNoSim() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getCacheButton().setSelection(false);
    tab.performApply(wc);
    wc.doSave();
    assertFalse(tab.isValid(config));
}
Also used : ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Test(org.junit.Test)

Example 67 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testI1Cache.

@Test
public void testI1Cache() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    assertFalse(dynamicTab.getI1SizeSpinner().isEnabled());
    dynamicTab.getI1Button().setSelection(true);
    dynamicTab.getI1Button().notifyListeners(SWT.Selection, null);
    assertTrue(dynamicTab.getI1SizeSpinner().isEnabled());
    dynamicTab.getI1SizeSpinner().setSelection(16384);
    dynamicTab.getI1AssocSpinner().setSelection(1);
    dynamicTab.getI1LineSizeSpinner().setSelection(16);
    tab.performApply(wc);
    wc.doSave();
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testI1Cache");
    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("--I1=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 68 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method initConfig.

private ILaunchConfigurationWorkingCopy initConfig() throws CoreException {
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    tab.setDefaults(wc);
    tab.createControl(testShell);
    tab.initializeFrom(config);
    int ix = Arrays.asList(tab.getTools()).indexOf(CachegrindPlugin.TOOL_ID);
    tab.getToolsCombo().select(ix);
    ILaunchConfigurationTab dynamicTab = tab.getDynamicTab();
    this.dynamicTab = (CachegrindToolPage) dynamicTab;
    return wc;
}
Also used : ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) ILaunchConfigurationTab(org.eclipse.debug.ui.ILaunchConfigurationTab)

Example 69 with ILaunchConfigurationWorkingCopy

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

the class MultiProcessTest method testNumPids.

@Test
public void testNumPids() throws Exception {
    ILaunchConfigurationWorkingCopy config = createConfiguration(proj.getProject()).getWorkingCopy();
    config.setAttribute(LaunchConfigurationConstants.ATTR_GENERAL_TRACECHILD, true);
    config.doSave();
    // $NON-NLS-1$
    doLaunch(config, "testExec");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    assertEquals(2, view.getOutputs().length);
}
Also used : ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 70 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)

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