diff options
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); + } +} |