Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Khouzam2016-03-21 14:03:31 +0000
committerGerrit Code Review @ Eclipse.org2016-04-07 19:40:26 +0000
commitddf2dea0aa40b1e6738db783173df801af3a36ae (patch)
treed1ff203b12cff4306589a2c5838056fc770b9d0a /dsf-gdb/org.eclipse.cdt.tests.dsf.gdb
parente44726097ce0c3ae808136206ace4e789c2ab4d8 (diff)
downloadorg.eclipse.cdt-ddf2dea0aa40b1e6738db783173df801af3a36ae.tar.gz
org.eclipse.cdt-ddf2dea0aa40b1e6738db783173df801af3a36ae.tar.xz
org.eclipse.cdt-ddf2dea0aa40b1e6738db783173df801af3a36ae.zip
Provide Supported and Unsupported lists of GDB versions
Allow to easily run only Supported or Unsupported tests Only run Supported versions in test suites Change-Id: I0d628c8aea28dad77df7943b8b1ee18df5bb6bcf
Diffstat (limited to 'dsf-gdb/org.eclipse.cdt.tests.dsf.gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java6
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllRemoteSuites.java2
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java2
-rw-r--r--dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/ITestConstants.java47
4 files changed, 38 insertions, 19 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
index 6ffc04ccba6..5909edb2bf6 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/framework/BaseParametrizedTestCase.java
@@ -53,6 +53,12 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
} else if (gdbVersions.equals("all")) {
gdbVersions = String.join(",", ITestConstants.ALL_KNOWN_VERSIONS);
gdbVersions += ",gdbserver." + String.join(",gdbserver.", ITestConstants.ALL_KNOWN_VERSIONS);
+ } else if (gdbVersions.equals("supported")) {
+ gdbVersions = String.join(",", ITestConstants.ALL_SUPPORTED_VERSIONS);
+ gdbVersions += ",gdbserver." + String.join(",gdbserver.", ITestConstants.ALL_SUPPORTED_VERSIONS);
+ } else if (gdbVersions.equals("unsupported") || gdbVersions.equals("un-supported")) {
+ gdbVersions = String.join(",", ITestConstants.ALL_UNSUPPORTED_VERSIONS);
+ gdbVersions += ",gdbserver." + String.join(",gdbserver.", ITestConstants.ALL_UNSUPPORTED_VERSIONS);
}
String[] versions = gdbVersions.split(",");
return Arrays.asList(versions);
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllRemoteSuites.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllRemoteSuites.java
index 1bf9762152b..7502d5ae933 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllRemoteSuites.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllRemoteSuites.java
@@ -23,7 +23,7 @@ import junit.framework.TestSuite;
@RunWith(AllTests.class)
public class AllRemoteSuites {
public static junit.framework.Test suite() {
- String gdbVersions = "gdbserver."+String.join(",gdbserver.", ITestConstants.ALL_KNOWN_VERSIONS);
+ String gdbVersions = "gdbserver."+String.join(",gdbserver.", ITestConstants.ALL_SUPPORTED_VERSIONS);
System.setProperty("cdt.tests.dsf.gdb.versions", gdbVersions);
TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(SuiteGdb.class));
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java
index 03b657810d7..6b6f11df232 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/AllSuites.java
@@ -23,7 +23,7 @@ import junit.framework.TestSuite;
@RunWith(AllTests.class)
public class AllSuites {
public static junit.framework.Test suite() {
- String gdbVersions = String.join(",", ITestConstants.ALL_KNOWN_VERSIONS);
+ String gdbVersions = String.join(",", ITestConstants.ALL_SUPPORTED_VERSIONS);
System.setProperty("cdt.tests.dsf.gdb.versions", gdbVersions);
TestSuite suite = new TestSuite();
suite.addTest(new JUnit4TestAdapter(SuiteGdb.class));
diff --git a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/ITestConstants.java b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/ITestConstants.java
index 4d3d6319504..2c6abae7c29 100644
--- a/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/ITestConstants.java
+++ b/dsf-gdb/org.eclipse.cdt.tests.dsf.gdb/src/org/eclipse/cdt/tests/dsf/gdb/tests/ITestConstants.java
@@ -13,7 +13,7 @@ package org.eclipse.cdt.tests.dsf.gdb.tests;
import org.eclipse.cdt.tests.dsf.gdb.launching.TestsPlugin;
-public interface ITestConstants {
+public class ITestConstants {
public static final String SUFFIX_GDB_6_6 = "6.6";
public static final String SUFFIX_GDB_6_7 = "6.7";
public static final String SUFFIX_GDB_6_8 = "6.8";
@@ -29,24 +29,37 @@ public interface ITestConstants {
public static final String SUFFIX_GDB_7_9 = "7.9";
public static final String SUFFIX_GDB_7_10 = "7.10";
public static final String SUFFIX_GDB_7_11 = "7.11";
- public static String[] ALL_KNOWN_VERSIONS = new String[] {
- ITestConstants.SUFFIX_GDB_6_6,
- ITestConstants.SUFFIX_GDB_6_7,
- ITestConstants.SUFFIX_GDB_6_8,
- ITestConstants.SUFFIX_GDB_7_0,
- ITestConstants.SUFFIX_GDB_7_1,
- ITestConstants.SUFFIX_GDB_7_2,
- ITestConstants.SUFFIX_GDB_7_3,
- ITestConstants.SUFFIX_GDB_7_4,
- ITestConstants.SUFFIX_GDB_7_5,
- ITestConstants.SUFFIX_GDB_7_6,
- ITestConstants.SUFFIX_GDB_7_7,
- ITestConstants.SUFFIX_GDB_7_8,
- ITestConstants.SUFFIX_GDB_7_9,
- ITestConstants.SUFFIX_GDB_7_10,
+
+ public static String[] ALL_SUPPORTED_VERSIONS = new String[] {
+ // add new versions here
ITestConstants.SUFFIX_GDB_7_11,
- // add versions here
+ ITestConstants.SUFFIX_GDB_7_10,
+ ITestConstants.SUFFIX_GDB_7_9,
+ ITestConstants.SUFFIX_GDB_7_8,
+ ITestConstants.SUFFIX_GDB_7_7,
+ ITestConstants.SUFFIX_GDB_7_6,
+ ITestConstants.SUFFIX_GDB_7_5,
+ ITestConstants.SUFFIX_GDB_7_4,
+ ITestConstants.SUFFIX_GDB_7_3,
+ ITestConstants.SUFFIX_GDB_7_2,
+ ITestConstants.SUFFIX_GDB_7_1,
+ };
+
+ public static String[] ALL_UNSUPPORTED_VERSIONS = new String[] {
+ ITestConstants.SUFFIX_GDB_7_0,
+ ITestConstants.SUFFIX_GDB_6_8,
+ ITestConstants.SUFFIX_GDB_6_7,
+ ITestConstants.SUFFIX_GDB_6_6,
+ };
+
+ public static String[] ALL_KNOWN_VERSIONS;
+ static {
+ // Initialize all known version based on the other arrays to avoid code duplication
+ ALL_KNOWN_VERSIONS = new String[ALL_SUPPORTED_VERSIONS.length + ALL_UNSUPPORTED_VERSIONS.length];
+ System.arraycopy(ALL_SUPPORTED_VERSIONS, 0, ALL_KNOWN_VERSIONS, 0, ALL_SUPPORTED_VERSIONS.length);
+ System.arraycopy(ALL_UNSUPPORTED_VERSIONS, 0, ALL_KNOWN_VERSIONS, ALL_SUPPORTED_VERSIONS.length, ALL_UNSUPPORTED_VERSIONS.length);
};
+
// Attribute that allows a test to request not to start gdbserver even if the session is a remote one
public static final String LAUNCH_GDB_SERVER = TestsPlugin.PLUGIN_ID + ".launchGdbServer";
}

Back to the top