Search in sources :

Example 26 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testAlignmentBad.

@Test
public void testAlignmentBad() throws CoreException {
    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 27 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testThreshold.

@Test
public void testThreshold() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getThresholdSpinner().setSelection(20);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testThreshold");
    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("--threshold=2.0"));
}
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 28 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testPeakInaccuracy.

@Test
public void testPeakInaccuracy() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getPeakInaccuracySpinner().setSelection(0);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testPeakInaccuracy");
    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("--peak-inaccuracy=0.0"));
}
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 29 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testDefaults.

@Test
public void testDefaults() throws CoreException, URISyntaxException, IOException {
    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=massif"));
    // $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("--heap=yes"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--heap-admin=8"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--stacks=no"));
    // $NON-NLS-1$
    assertFalse(cmd.contains("--alloc-fn"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--threshold=1.0"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--peak-inaccuracy=1.0"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--time-unit=i"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--detailed-freq=10"));
    // $NON-NLS-1$
    assertTrue(cmd.contains("--max-snapshots=100"));
    // $NON-NLS-1$
    assertFalse(cmd.contains("--alignment="));
}
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 30 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(MassifPlugin.TOOL_ID);
    tab.getToolsCombo().select(ix);
    ILaunchConfigurationTab dynamicTab = tab.getDynamicTab();
    this.dynamicTab = (MassifToolPage) dynamicTab;
    return wc;
}
Also used : ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) ILaunchConfigurationTab(org.eclipse.debug.ui.ILaunchConfigurationTab)

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