Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamilo Bernal2013-04-08 17:29:32 -0400
committerSami Wagiaalla2013-04-10 13:01:23 -0400
commit0b2d9a5e9cc49dedcd00b1504f97ecd536140c8f (patch)
tree7489b8f7d066017e390f921fcf16728f2c0e7263 /systemtap/org.eclipse.linuxtools.systemtap.ui.tests
parent1634aa95b7e7d6c1644bd6c1abcb25fb1b4606e6 (diff)
downloadorg.eclipse.linuxtools-0b2d9a5e9cc49dedcd00b1504f97ecd536140c8f.tar.gz
org.eclipse.linuxtools-0b2d9a5e9cc49dedcd00b1504f97ecd536140c8f.tar.xz
org.eclipse.linuxtools-0b2d9a5e9cc49dedcd00b1504f97ecd536140c8f.zip
Assume stap is installed in tests dealing with stap processes.
* Skip tests that depend on stap when the tool is unavailable. * Move stap installation check to o.e.l.systemtap.ui.tests. * Remove plugin.xml and activator from o.e.l.systemtap.ui.tests. Change-Id: I18ba65d8f903dd6018bb669750f415902b27629a Reviewed-on: https://git.eclipse.org/r/11737 Tested-by: Hudson CI Reviewed-by: Sami Wagiaalla <swagiaal@redhat.com> IP-Clean: Sami Wagiaalla <swagiaal@redhat.com> Tested-by: Sami Wagiaalla <swagiaal@redhat.com>
Diffstat (limited to 'systemtap/org.eclipse.linuxtools.systemtap.ui.tests')
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF8
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml16
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java85
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapTest.java34
5 files changed, 40 insertions, 106 deletions
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF
index 418455853f..9d7512bebd 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/META-INF/MANIFEST.MF
@@ -1,13 +1,15 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
-Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.tests;singleton:=true
+Bundle-SymbolicName: org.eclipse.linuxtools.systemtap.ui.tests
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: %Bundle-Vendor.0
Bundle-Localization: plugin
Bundle-ActivationPolicy: lazy
-Bundle-Activator: org.eclipse.linuxtools.systemtap.ui.tests.SystemTapGuiTestsPlugin
Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.linuxtools.systemtap.ui.tests
+Import-Package: org.eclipse.linuxtools.tools.launch.core.factory,
+ org.junit;version="4.10.0"
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties
index 3d29bf7613..1c8ddd3eab 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/build.properties
@@ -1,8 +1,7 @@
bin.includes = META-INF/,\
about.html,\
plugin.properties,\
- .,\
- plugin.xml
+ .
jars.compile.order = .
source.. = src/
output.. = bin/
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml
deleted file mode 100644
index a8be1517f3..0000000000
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/plugin.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
- <extension
- point="org.eclipse.debug.core.launchDelegates">
- <launchDelegate
- delegate="org.eclipse.linuxtools.systemtap.ui.tests.SystemtapGuiTestLaunchDelegate"
- id="org.eclipse.linuxtools.systemtap.ui.tests.launchDelegate"
- modes="profile"
- sourceLocatorId="org.eclipse.cdt.debug.core.sourceLocator"
- sourcePathComputerId="org.eclipse.cdt.debug.core.sourcePathComputer"
- type="org.eclipse.linuxtools.systemtap.ui.launch.systemtapguiLaunch">
- </launchDelegate>
- </extension>
-
-</plugin>
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java
deleted file mode 100644
index 47651af609..0000000000
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapGuiTestsPlugin.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Elliott Baron <ebaron@redhat.com> - initial API and implementation
- *******************************************************************************/
-package org.eclipse.linuxtools.systemtap.ui.tests;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-public class SystemtapGuiTestsPlugin extends AbstractUIPlugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.linuxtools.systemtap.ui.tests"; //$NON-NLS-1$
-
- // Test Launch Delegate ID
- public static final String DELEGATE_ID = PLUGIN_ID + ".launchDelegate"; //$NON-NLS-1$
-
- // Java Runtime System Properties
-
- /**
- * usage: -Declipse.valgrind.tests.generateFiles=<yes|no> [default: no]
- * if yes, will run Valgrind and store its output files for each test under
- * <plugin root>/valgrindFiles
- * no, will use default output directory for valgrind's output
- */
- public static final String SYSTEM_PROPERTY_GENERATE_FILES = "eclipse.valgrind.tests.generateFiles"; //$NON-NLS-1$
- public static final boolean GENERATE_FILES = System.getProperty(SYSTEM_PROPERTY_GENERATE_FILES, "no").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
-
- /**
- * usage: -Declipse.valgrind.tests.runValgrind=<yes|no> [default: yes]
- * if yes, will run Valgrind as in a normal launch
- * no, will simulate Valgrind execution with pregenerated log files
- */
- public static final String SYSTEM_PROPERTY_RUN_VALGRIND = "eclipse.valgrind.tests.runValgrind"; //$NON-NLS-1$
- // generateFiles implies runValgrind
- public static final boolean RUN_VALGRIND = GENERATE_FILES || System.getProperty(SYSTEM_PROPERTY_RUN_VALGRIND, "yes").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
-
- // Launch config attribute to mock valgrind's exit code
- public static final String ATTR_MOCK_EXIT_CODE = PLUGIN_ID + ".MOCK_EXIT_CODE"; //$NON-NLS-1$
-
- // The shared instance
- private static SystemtapGuiTestsPlugin plugin;
-
- /**
- * The constructor
- */
- public SystemtapGuiTestsPlugin() {
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static SystemtapGuiTestsPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapTest.java
new file mode 100644
index 0000000000..e159299d2b
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.tests/src/org/eclipse/linuxtools/systemtap/ui/tests/SystemtapTest.java
@@ -0,0 +1,34 @@
+package org.eclipse.linuxtools.systemtap.ui.tests;
+
+import java.io.IOException;
+
+import org.eclipse.linuxtools.tools.launch.core.factory.RuntimeProcessFactory;
+import org.junit.BeforeClass;
+
+/**
+ * Generic utilities for systemtap tests.
+ */
+public class SystemtapTest {
+ public static boolean stapInstalled;
+
+ @BeforeClass
+ public static void checkStapInstalled() {
+ stapInstalled = SystemtapTest.stapInstalled();
+ }
+
+ /**
+ * Check that stap is installed
+ *
+ * @return true if stap is installed, false otherwise.
+ */
+ public static boolean stapInstalled() {
+ try {
+ Process process = RuntimeProcessFactory.getFactory().exec(
+ new String[] { "stap", "-V" }, null);
+ return (process != null);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return false;
+ }
+}

Back to the top