Search in sources :

Example 6 with Launch

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

the class GprofShortcutTest method setUp.

@Before
public void setUp() throws Exception {
    // $NON-NLS-1$
    proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest2");
    ProjectScope ps = new ProjectScope(proj.getProject());
    ScopedPreferenceStore scoped = new ScopedPreferenceStore(ps, ProviderProfileConstants.PLUGIN_ID);
    scoped.setSearchContexts(new IScopeContext[] { ps, InstanceScope.INSTANCE });
    scoped.setValue(ProviderProfileConstants.PREFS_KEY + GPROF_CATEGORY, GPROF_PROVIDER_ID);
    scoped.setValue(ProviderProfileConstants.USE_PROJECT_SETTINGS + GPROF_CATEGORY, true);
    scoped.save();
    IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LAUNCH_SHORT_EXTPT);
    IConfigurationElement[] configs = extPoint.getConfigurationElements();
    for (IConfigurationElement cfg : configs) {
        if (cfg.getAttribute("id").equals(ID)) {
            // $NON-NLS-1$
            try {
                // $NON-NLS-1$
                shortcut = (ProviderLaunchShortcut) cfg.createExecutableExtension("class");
                // $NON-NLS-1$
                launchConfigTypeId = cfg.getChildren("class")[0].getChildren("parameter")[1].getAttribute("value");
            } catch (Exception e) {
                fail(e.getMessage());
            }
        }
    }
    config = createConfiguration(proj.getProject());
    launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    wc = config.getWorkingCopy();
}
Also used : ProjectScope(org.eclipse.core.resources.ProjectScope) IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) ScopedPreferenceStore(org.eclipse.ui.preferences.ScopedPreferenceStore) CModelException(org.eclipse.cdt.core.model.CModelException) Before(org.junit.Before)

Example 7 with Launch

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

the class TestLaunching method testEventLaunch.

@Test
public void testEventLaunch() throws CoreException {
    TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
    ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(OprofileLaunchPlugin.ATTR_USE_DEFAULT_EVENT, false);
    wc.setAttribute(OprofileLaunchPlugin.attrConterEnabled(0), true);
    wc.setAttribute(OprofileLaunchPlugin.attrCounterCount(0), 100000);
    // $NON-NLS-1$
    wc.setAttribute(OprofileLaunchPlugin.attrConterEvent(0, 0), "FAKE_EVENT");
    wc.setAttribute(OprofileLaunchPlugin.attrCounterProfileKernel(0), true);
    wc.setAttribute(OprofileLaunchPlugin.attrCounterProfileUser(0), true);
    wc.setAttribute(OprofileLaunchPlugin.attrCounterUnitMask(0), 0);
    wc.doSave();
    LaunchTestingOptions options = new LaunchTestingOptions();
    options.setOprofileProject(proj.getProject());
    options.loadConfiguration(config);
    assertTrue(options.isValid());
    assertTrue(options.getBinaryImage().isEmpty());
    assertTrue(options.getKernelImageFile().isEmpty());
    assertEquals(OprofileDaemonOptions.SEPARATE_NONE, options.getSeparateSamples());
    Oprofile.OprofileProject.setProfilingBinary(Oprofile.OprofileProject.OPERF_BINARY);
    delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
}
Also used : LaunchTestingOptions(org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions) TestingOprofileLaunchConfigurationDelegate(org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate) ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Test(org.junit.Test) AbstractTest(org.eclipse.linuxtools.profiling.tests.AbstractTest)

Example 8 with Launch

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

the class LaunchRemoteTest method setUp.

@Before
public void setUp() throws Exception {
    if ((!(AbstractRemoteTest.USERNAME.isEmpty()))) {
        project = null;
        config = createConfiguration(project);
        delegate = new PerfLaunchConfigDelegate();
        launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
        wc = config.getWorkingCopy();
        setProfileAttributes(wc);
    }
}
Also used : PerfLaunchConfigDelegate(org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Before(org.junit.Before)

Example 9 with Launch

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

the class LaunchTest method setUp.

@Before
public void setUp() throws Exception {
    // $NON-NLS-1$
    proj = createProjectAndBuild(FrameworkUtil.getBundle(this.getClass()), "fibTest");
    config = createConfiguration(proj.getProject());
    delegate = new PerfLaunchConfigDelegate();
    launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    wc = config.getWorkingCopy();
    setProfileAttributes(wc);
}
Also used : PerfLaunchConfigDelegate(org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Before(org.junit.Before)

Example 10 with Launch

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

the class AbstractValgrindTest method doLaunch.

protected ILaunch doLaunch(ILaunchConfiguration config, String testName) throws URISyntaxException, IOException, CoreException {
    ILaunch launch;
    IPath pathToFiles = getPathToFiles(testName);
    if (!ValgrindTestsPlugin.RUN_VALGRIND) {
        bindLocation(pathToFiles);
    }
    ILaunchConfigurationWorkingCopy wc = config.getWorkingCopy();
    wc.setAttribute(LaunchConfigurationConstants.ATTR_INTERNAL_OUTPUT_DIR, pathToFiles.toOSString());
    wc.doSave();
    ValgrindTestLaunchDelegate delegate = new ValgrindTestLaunchDelegate();
    launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    DebugPlugin.getDefault().getLaunchManager().addLaunch(launch);
    launches.add(launch);
    delegate.launch(config, ILaunchManager.PROFILE_MODE, launch, null);
    if (ValgrindTestsPlugin.RUN_VALGRIND) {
        unbindLocation(pathToFiles);
    }
    return launch;
}
Also used : IPath(org.eclipse.core.runtime.IPath) ILaunch(org.eclipse.debug.core.ILaunch) ILaunchConfigurationWorkingCopy(org.eclipse.debug.core.ILaunchConfigurationWorkingCopy) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch)

Aggregations

ILaunch (org.eclipse.debug.core.ILaunch)10 Launch (org.eclipse.debug.core.Launch)10 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)4 Before (org.junit.Before)4 Test (org.junit.Test)4 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)3 LaunchTestingOptions (org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions)3 TestingOprofileLaunchConfigurationDelegate (org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate)3 ProjectScope (org.eclipse.core.resources.ProjectScope)2 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)2 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)2 PerfLaunchConfigDelegate (org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate)2 ScopedPreferenceStore (org.eclipse.ui.preferences.ScopedPreferenceStore)2 CModelException (org.eclipse.cdt.core.model.CModelException)1 CoreException (org.eclipse.core.runtime.CoreException)1 IPath (org.eclipse.core.runtime.IPath)1 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)1 IProcess (org.eclipse.debug.core.model.IProcess)1 DockerCommandNotFoundException (org.eclipse.linuxtools.docker.core.DockerCommandNotFoundException)1 DockerException (org.eclipse.linuxtools.docker.core.DockerException)1