Search in sources :

Example 1 with LaunchTestingOptions

use of org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions in project linuxtools by eclipse.

the class TestLaunching method testDefaultLaunch.

@Test
public void testDefaultLaunch() throws CoreException {
    TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
    ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    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) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Test(org.junit.Test) AbstractTest(org.eclipse.linuxtools.profiling.tests.AbstractTest)

Example 2 with LaunchTestingOptions

use of org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions in project linuxtools by eclipse.

the class TestLaunchingExternalProject method testLaunchExternalProject.

/**
 * Testcase for Eclipse BugZilla 321905/RedHat BZ
 *
 * @throws CoreException
 */
@Test
public void testLaunchExternalProject() throws CoreException {
    LaunchTestingOptions options = new LaunchTestingOptions();
    options.setOprofileProject(externalProject);
    options.loadConfiguration(config);
    TestingOprofileLaunchConfigurationDelegate delegate = new TestingOprofileLaunchConfigurationDelegate();
    ILaunch launch = new Launch(config, ILaunchManager.PROFILE_MODE, null);
    assertTrue(options.isValid());
    assertTrue(options.getBinaryImage().isEmpty());
    assertTrue(options.getKernelImageFile().isEmpty());
    assertEquals(OprofileDaemonOptions.SEPARATE_NONE, options.getSeparateSamples());
    OprofileProject.setProfilingBinary(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) Launch(org.eclipse.debug.core.Launch) ILaunch(org.eclipse.debug.core.ILaunch) Test(org.junit.Test) AbstractTest(org.eclipse.linuxtools.profiling.tests.AbstractTest)

Example 3 with LaunchTestingOptions

use of org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions 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)

Aggregations

ILaunch (org.eclipse.debug.core.ILaunch)3 Launch (org.eclipse.debug.core.Launch)3 LaunchTestingOptions (org.eclipse.linuxtools.oprofile.launch.tests.utils.LaunchTestingOptions)3 TestingOprofileLaunchConfigurationDelegate (org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate)3 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)3 Test (org.junit.Test)3 ILaunchConfigurationWorkingCopy (org.eclipse.debug.core.ILaunchConfigurationWorkingCopy)1