Search in sources :

Example 26 with ILaunchConfiguration

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

the class ExportWizardTest method testExportNotDir.

@Test
public void testExportNotDir() throws CoreException, URISyntaxException, IOException {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    ILaunch launch = doLaunch(config, "testExport");
    IProcess p = launch.getProcesses()[0];
    assertEquals(0, p.getExitValue());
    createWizard();
    // set the output path, should trigger modify listener
    IPath pathToFiles = proj.getProject().getLocation();
    // $NON-NLS-1$
    pathToFiles = pathToFiles.append("alloctest.c");
    assertTrue(pathToFiles.toFile().exists());
    page.getDestText().setText(pathToFiles.toOSString());
    assertNotNull(page.getErrorMessage());
    assertFalse(page.isPageComplete());
    assertFalse(wizard.canFinish());
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IPath(org.eclipse.core.runtime.IPath) ILaunch(org.eclipse.debug.core.ILaunch) IProcess(org.eclipse.debug.core.model.IProcess) Test(org.junit.Test)

Example 27 with ILaunchConfiguration

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

the class ExportWizardTest method testExportBoth.

@Test
public void testExportBoth() throws CoreException, URISyntaxException, IOException {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    ILaunch launch = doLaunch(config, "testExport");
    IProcess p = launch.getProcesses()[0];
    assertEquals(0, p.getExitValue());
    createWizard();
    // set the output path, should trigger modify listener
    File[] selectedFiles = page.getSelectedFiles();
    IPath pathToFiles = proj.getProject().getLocation();
    page.getDestText().setText(pathToFiles.toOSString());
    assertTrue(page.isPageComplete());
    assertTrue(wizard.canFinish());
    assertTrue(wizard.performFinish());
    // check files were copied
    for (File log : selectedFiles) {
        File copy = new File(pathToFiles.toFile(), log.getName());
        assertTrue(copy.exists());
    }
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) IPath(org.eclipse.core.runtime.IPath) ILaunch(org.eclipse.debug.core.ILaunch) IProcess(org.eclipse.debug.core.model.IProcess) File(java.io.File) Test(org.junit.Test)

Example 28 with ILaunchConfiguration

use of org.eclipse.debug.core.ILaunchConfiguration 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 29 with ILaunchConfiguration

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

the class SortTest method prep.

@Before
public void prep() throws Exception {
    // $NON-NLS-1$
    proj = createProjectAndBuild("alloctest");
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(MassifLaunchConstants.ATTR_MASSIF_STACKS, true);
    wc.doSave();
    // $NON-NLS-1$
    doLaunch(config, "testStacks");
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Before(org.junit.Before)

Example 30 with ILaunchConfiguration

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

the class CModelLabelsTest method testNestedMethodLabel.

@Test
public void testNestedMethodLabel() throws Exception {
    ILaunchConfiguration config = createConfiguration(proj.getProject());
    // $NON-NLS-1$
    doLaunch(config, "testNestedMethodLabel");
    CachegrindViewPart view = (CachegrindViewPart) ValgrindUIPlugin.getDefault().getView().getDynamicView();
    CachegrindOutput output = view.getOutputs()[0];
    // $NON-NLS-1$
    CachegrindFile file = getFileByName(output, "cpptest.cpp");
    // $NON-NLS-1$
    CachegrindFunction func = getFunctionByName(file, "A::B::e()");
    assertTrue(func.getModel() instanceof IMethod);
    checkLabelProvider(func, file);
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) CachegrindOutput(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindOutput) CachegrindFile(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFile) CachegrindFunction(org.eclipse.linuxtools.internal.valgrind.cachegrind.model.CachegrindFunction) CachegrindViewPart(org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart) IMethod(org.eclipse.cdt.core.model.IMethod) Test(org.junit.Test)

Aggregations

ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)266 CoreException (org.eclipse.core.runtime.CoreException)96 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)76 Test (org.junit.Test)72 ILaunchConfigurationType (org.eclipse.debug.core.ILaunchConfigurationType)50 ILaunchManager (org.eclipse.debug.core.ILaunchManager)40 ArrayList (java.util.ArrayList)37 ILaunch (org.eclipse.debug.core.ILaunch)35 IProject (org.eclipse.core.resources.IProject)20 IPath (org.eclipse.core.runtime.IPath)20 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)16 IEditorPart (org.eclipse.ui.IEditorPart)15 IStatus (org.eclipse.core.runtime.IStatus)14 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)14 IFile (org.eclipse.core.resources.IFile)13 IProcess (org.eclipse.debug.core.model.IProcess)13 CachegrindViewPart (org.eclipse.linuxtools.internal.valgrind.cachegrind.CachegrindViewPart)13 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)11 Shell (org.eclipse.swt.widgets.Shell)10 ElementListSelectionDialog (org.eclipse.ui.dialogs.ElementListSelectionDialog)10