1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 01:36:01 +02:00

Bug 572581: Run tests on all newer GDBs

Change-Id: I10e89dae366278ab4535921f2a69e0b7806db583
This commit is contained in:
Jonah Graham 2021-04-04 17:00:10 -04:00
parent 48de9319c6
commit 4df00fd345
2 changed files with 28 additions and 10 deletions

View file

@ -217,8 +217,20 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
String[] expectedParts = expected.split("\\."); //$NON-NLS-1$
String[] actualParts = actual.split("\\."); //$NON-NLS-1$
String comparableActualString = actual;
// Starting in GDB 9 the versions are MAJOR.PATCH so we only care about first number
int majorVersion = Integer.parseInt(expectedParts[0]);
if (majorVersion >= 9) {
if (expectedParts.length == 1 // If the expected version does not care about the maintenance number
&& actualParts.length > 1) { // and the actual version has a maintenance number (and possibly more)
// We should ignore the maintenance number.
// For example, if we expect 11, then the actual
// version we should accept can be 11.1 or 11.0.50 or 11.0.50.20210303-git, etc.
int firstDot = actual.indexOf('.');
comparableActualString = actual.substring(0, firstDot);
}
} else {
if (expectedParts.length == 2 // If the expected version does not care about the maintenance number
&& actualParts.length > 2) { // and the actual version has a maintenance number (and possibly more)
// We should ignore the maintenance number.
@ -228,6 +240,7 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
int secondDot = actual.indexOf('.', firstDot + 1);
comparableActualString = actual.substring(0, secondDot);
}
}
assertTrue("Unexpected GDB version. Expected " + expected + " actual " + actual,
LaunchUtils.compareVersions(expected, comparableActualString) == 0);

View file

@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2010, 2015 Ericsson and others.
* Copyright (c) 2010, 2021 Ericsson and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@ -36,9 +36,14 @@ public class ITestConstants {
public static final String SUFFIX_GDB_8_0 = "8.0";
public static final String SUFFIX_GDB_8_1 = "8.1";
public static final String SUFFIX_GDB_8_2 = "8.2";
public static final String SUFFIX_GDB_8_3 = "8.3";
// From GDB 9 the number scheme changed to MAJOR.PATCH so 9.2 is a patch for 9.1 release
public static final String SUFFIX_GDB_9 = "9";
public static final String SUFFIX_GDB_10 = "10";
public static String[] ALL_SUPPORTED_VERSIONS = new String[] {
// add new versions here
ITestConstants.SUFFIX_GDB_10, ITestConstants.SUFFIX_GDB_9, ITestConstants.SUFFIX_GDB_8_3,
ITestConstants.SUFFIX_GDB_8_2, ITestConstants.SUFFIX_GDB_8_1, ITestConstants.SUFFIX_GDB_8_0,
ITestConstants.SUFFIX_GDB_7_12, ITestConstants.SUFFIX_GDB_7_11, ITestConstants.SUFFIX_GDB_7_10,
ITestConstants.SUFFIX_GDB_7_9, ITestConstants.SUFFIX_GDB_7_8, ITestConstants.SUFFIX_GDB_7_7,