1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

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
This commit is contained in:
Marc Khouzam 2016-03-21 10:03:31 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent e44726097c
commit ddf2dea0aa
4 changed files with 38 additions and 19 deletions

View file

@ -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);

View file

@ -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));

View file

@ -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));

View file

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