Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Overholt2011-06-03 16:36:37 +0000
committerAndrew Overholt2011-06-03 16:36:37 +0000
commitb5dab03479a9d38f70fffc936e8276c9e51f858a (patch)
treeb9ec706599d0b3b502866203455efbe14de2b844
parentc52408b33c68541c7a2f74e30e56083c972c38fd (diff)
downloadorg.eclipse.linuxtools-b5dab03479a9d38f70fffc936e8276c9e51f858a.tar.gz
org.eclipse.linuxtools-b5dab03479a9d38f70fffc936e8276c9e51f858a.tar.xz
org.eclipse.linuxtools-b5dab03479a9d38f70fffc936e8276c9e51f858a.zip
Don't run OProfile core tests on Hudson.
The OProfile core tests require the OProfile kernel module to be loaded. Since we can't guarantee this will be the case on the Eclipse build infrastructure, we don't run these tests by default. The mechanism for excluding them is the same as the OProfile launch test suite.
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.tests/pom.xml3
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/AllCoreTests.java4
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/CoreTestsPlugin.java11
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/TestDummy.java22
4 files changed, 39 insertions, 1 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/pom.xml b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/pom.xml
index cd4fced905..4e7ed81904 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/pom.xml
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/pom.xml
@@ -33,6 +33,9 @@
<useUIHarness>true</useUIHarness>
<useUIThread>false</useUIThread>
<product>org.eclipse.sdk.ide</product>
+ <argLine>-Dorg.eclipse.linuxtools.oprofile.core.tests.runOprofile=no</argLine>
+ <testSuite>org.eclipse.linuxtools.oprofile.core.tests</testSuite>
+ <testClass>org.eclipse.linuxtools.oprofile.core.tests.AllCoreTests</testClass>
</configuration>
</plugin>
<plugin>
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/AllCoreTests.java b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/AllCoreTests.java
index f89f6aa5fd..abba7d4491 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/AllCoreTests.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/AllCoreTests.java
@@ -18,11 +18,15 @@ public class AllCoreTests {
public static Test suite() {
TestSuite suite = new TestSuite("Test for org.eclipse.linuxtools.oprofile.core.tests"); //$NON-NLS-1$
+ if (CoreTestsPlugin.RUN_OPROFILE) {
suite.addTestSuite(TestModelDataParse.class);
suite.addTestSuite(TestSessionsParse.class);
suite.addTestSuite(TestCheckEventsParse.class);
suite.addTestSuite(TestInfoParse.class);
suite.addTestSuite(TestDataModel.class);
+ }
+
+ suite.addTestSuite(TestDummy.class);
return suite;
}
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/CoreTestsPlugin.java b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/CoreTestsPlugin.java
index dfc0de866f..551145de93 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/CoreTestsPlugin.java
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/CoreTestsPlugin.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
+ * Copyright (c) 2009, 2011 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
@@ -18,6 +18,15 @@ import org.osgi.framework.BundleContext;
*/
public class CoreTestsPlugin extends Plugin {
+ /**
+ * Java system properties.
+ * usage: -Dorg.eclipse.linuxtools.oprofile.core.tests.runOprofile=<yes|no> [default: yes]
+ * if yes, will run the core tests
+ * no, will skip the core tests (they all require oOProfile to be set up)
+ */
+ public static final String SYSTEM_PROPERTY_RUN_OPROFILE = "org.eclipse.linuxtools.oprofile.core.tests.runOprofile"; //$NON-NLS-1$
+ public static final boolean RUN_OPROFILE = System.getProperty(SYSTEM_PROPERTY_RUN_OPROFILE, "yes").equals("yes"); //$NON-NLS-1$ //$NON-NLS-2$
+
// The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.linuxtools.oprofile.core.tests"; //$NON-NLS-1$
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/TestDummy.java b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/TestDummy.java
new file mode 100644
index 0000000000..b361c8bdd2
--- /dev/null
+++ b/oprofile/org.eclipse.linuxtools.oprofile.core.tests/src/org/eclipse/linuxtools/oprofile/core/tests/TestDummy.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * 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:
+ * Kent Sebastian <ksebasti@redhat.com> - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.linuxtools.oprofile.core.tests;
+
+import junit.framework.TestCase;
+
+// Dummy test just so that the launch tests have something
+// running when oprofile does not
+public class TestDummy extends TestCase {
+ public void testPass() {
+ assertTrue(true);
+ }
+}

Back to the top