Search in sources :

Example 36 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testBranchSim.

@Test
public void testBranchSim() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    dynamicTab.getBranchButton().setSelection(true);
    tab.performApply(wc);
    wc.doSave();
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testBranchSim");
    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("--branch-sim=yes"));
}
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 37 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testD1Cache.

@Test
public void testD1Cache() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    assertFalse(dynamicTab.getD1SizeSpinner().isEnabled());
    dynamicTab.getD1Button().setSelection(true);
    dynamicTab.getD1Button().notifyListeners(SWT.Selection, null);
    assertTrue(dynamicTab.getD1SizeSpinner().isEnabled());
    dynamicTab.getD1SizeSpinner().setSelection(16384);
    dynamicTab.getD1AssocSpinner().setSelection(1);
    dynamicTab.getD1LineSizeSpinner().setSelection(16);
    tab.performApply(wc);
    wc.doSave();
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testD1Cache");
    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("--D1=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 38 with ILaunchConfigurationWorkingCopy

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

the class MultiProcessTest method testNumFunctions.

@Test
public void testNumFunctions() 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();
    int pidIx = 0;
    CachegrindOutput output = view.getOutputs()[pidIx];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    if (file == null) {
        pidIx = 1;
        output = view.getOutputs()[pidIx];
        // $NON-NLS-1$
        file = getFileByName(output, "cpptest.cpp");
    }
    assertNotNull(file);
    assertEquals(8, file.getFunctions().length);
    // test other pid
    pidIx = (pidIx + 1) % 2;
    output = view.getOutputs()[pidIx];
    // $NON-NLS-1$
    file = getFileByName(output, "parent.cpp");
    assertNotNull(file);
    assertEquals(6, file.getFunctions().length);
}
Also used : CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 39 with ILaunchConfigurationWorkingCopy

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

the class MultiProcessTest method testFileNames.

@Test
public void testFileNames() 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();
    int pidIx = 0;
    CachegrindOutput output = view.getOutputs()[pidIx];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    if (file == null) {
        pidIx = 1;
        output = view.getOutputs()[pidIx];
        // $NON-NLS-1$
        file = getFileByName(output, "cpptest.cpp");
    }
    assertNotNull(file);
    // $NON-NLS-1$
    file = getFileByName(output, "cpptest.h");
    assertNotNull(file);
    // test other pid
    pidIx = (pidIx + 1) % 2;
    output = view.getOutputs()[pidIx];
    // $NON-NLS-1$
    file = getFileByName(output, "parent.cpp");
    assertNotNull(file);
}
Also used : CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) Test(org.junit.Test)

Example 40 with ILaunchConfigurationWorkingCopy

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

the class LaunchConfigTabTest method testRunFreeRes.

@Test
public void testRunFreeRes() throws Exception {
    ILaunchConfigurationWorkingCopy wc = initConfig();
    tab.getRunFreeresButton().setSelection(false);
    // $NON-NLS-1$
    ILaunch launch = saveAndLaunch(wc, "testRunFreeRes");
    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("--run-libc-freeres=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