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"; }