use of org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate 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);
}
use of org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate 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);
}
use of org.eclipse.linuxtools.oprofile.launch.tests.utils.TestingOprofileLaunchConfigurationDelegate 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);
}
Aggregations