aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-01-29 12:04:39 (EST)
committerAlexander Kurtakov2013-01-29 12:22:17 (EST)
commit2d657e85ca761337a7d4b089d31c938ce04d57b4 (patch)
tree1b27eca2ea4bc700fcedee0edb141a7b625b904c
parent44d7f855cc53dc39c1b6baccee86803776512363 (diff)
downloadorg.eclipse.linuxtools-2d657e85ca761337a7d4b089d31c938ce04d57b4.zip
org.eclipse.linuxtools-2d657e85ca761337a7d4b089d31c938ce04d57b4.tar.gz
org.eclipse.linuxtools-2d657e85ca761337a7d4b089d31c938ce04d57b4.tar.bz2
Fix perf launch tests failures when perf is not available.refs/changes/10/10010/2
Check for perf before running perf launch tests. Change-Id: I3dd97c3497e04f7c056978d93f29f3aa42128d3f Reviewed-on: https://git.eclipse.org/r/10010 Reviewed-by: Alexander Kurtakov <akurtako@redhat.com> IP-Clean: Alexander Kurtakov <akurtako@redhat.com> Tested-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/LaunchTest.java29
1 files changed, 17 insertions, 12 deletions
diff --git a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/LaunchTest.java b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/LaunchTest.java
index 004d39e..9dc312f 100644
--- a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/LaunchTest.java
+++ b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/LaunchTest.java
@@ -20,6 +20,7 @@ import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.core.Launch;
+import org.eclipse.linuxtools.internal.perf.PerfCore;
import org.eclipse.linuxtools.internal.perf.PerfPlugin;
import org.eclipse.linuxtools.internal.perf.launch.PerfEventsTab;
import org.eclipse.linuxtools.internal.perf.launch.PerfLaunchConfigDelegate;
@@ -68,22 +69,26 @@ public class LaunchTest extends AbstractTest {
}
public void testDefaultRun () {
- try {
- delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
- } catch (CoreException e) {
- fail();
+ if (PerfCore.checkPerfInPath()) {
+ try {
+ delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
+ } catch (CoreException e) {
+ fail();
+ }
}
}
public void testClockEventRun () {
- try {
- ArrayList<String> list = new ArrayList<String>();
- list.addAll(Arrays.asList(new String [] {"cpu-clock", "task-clock", "cycles"}));
- wc.setAttribute(PerfPlugin.ATTR_DefaultEvent, false);
- wc.setAttribute(PerfPlugin.ATTR_SelectedEvents, list);
- delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
- } catch (CoreException e) {
- fail();
+ if (PerfCore.checkPerfInPath()) {
+ try {
+ ArrayList<String> list = new ArrayList<String>();
+ list.addAll(Arrays.asList(new String [] {"cpu-clock", "task-clock", "cycles"}));
+ wc.setAttribute(PerfPlugin.ATTR_DefaultEvent, false);
+ wc.setAttribute(PerfPlugin.ATTR_SelectedEvents, list);
+ delegate.launch(wc, ILaunchManager.PROFILE_MODE, launch, null);
+ } catch (CoreException e) {
+ fail();
+ }
}
}