Search in sources :

Example 21 with ILaunchConfigurationWorkingCopy

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

the class ChartTests method byteScalingHelper.

private void byteScalingHelper(int ix, long times, long bytes, String testName) throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, // $NON-NLS-1$
    String.valueOf(bytes) + " " + String.valueOf(times));
    wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_TIMEUNIT, MassifLaunchConstants.TIME_B);
    config = wc.doSave();
    doLaunch(config, testName);
    IAction chartAction = getChartAction();
    assertNotNull(chartAction);
    chartAction.run();
    IEditorPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
    assertTrue(part.getEditorInput() instanceof ChartEditorInput);
    ChartEditorInput input = (ChartEditorInput) part.getEditorInput();
    HeapChart chart = input.getChart();
    assertEquals(HeapChart.getByteUnits()[ix], chart.getXUnits());
}
Also used : HeapChart(org.eclipse.linuxtools.internal.valgrind.massif.charting.HeapChart) ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IAction(org.eclipse.jface.action.IAction) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) IEditorPart(org.eclipse.ui.IEditorPart) ChartEditorInput(org.eclipse.linuxtools.internal.valgrind.massif.charting.ChartEditorInput)

Example 22 with ILaunchConfigurationWorkingCopy

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

the class DoubleClickTest method testDoubleClickFile.

@Test
public void testDoubleClickFile() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
    wc.doSave();
    // $NON-NLS-1$
    doLaunch(config, "testDoubleClickFile");
    doDoubleClick();
    checkFile(proj.getProject(), node);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Test(org.junit.Test)

Example 23 with ILaunchConfigurationWorkingCopy

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

the class DoubleClickTest method testDoubleClickLine.

@Test
public void testDoubleClickLine() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_DETAILEDFREQ, 2);
    wc.doSave();
    // $NON-NLS-1$
    doLaunch(config, "testDoubleClickLine");
    doDoubleClick();
    checkLine(node);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Test(org.junit.Test)

Example 24 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testHeap.

@Test
public void testHeap() throws CoreException, URISyntaxException, IOException {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getHeapButton().setSelection(false);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testHeap");
    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("--heap=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)

Example 25 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testTimeUnitBytes.

@Test
public void testTimeUnitBytes() 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_B_STRING)) {
            ix = i;
        }
    }
    dynamicTab.getTimeUnitCombo().select(ix);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testTimeUnitBytes");
    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=B"));
}
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