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:
parent
48de9319c6
commit
4df00fd345
2 changed files with 28 additions and 10 deletions
|
@ -217,16 +217,29 @@ public abstract class BaseParametrizedTestCase extends BaseTestCase {
|
||||||
|
|
||||||
String[] expectedParts = expected.split("\\."); //$NON-NLS-1$
|
String[] expectedParts = expected.split("\\."); //$NON-NLS-1$
|
||||||
String[] actualParts = actual.split("\\."); //$NON-NLS-1$
|
String[] actualParts = actual.split("\\."); //$NON-NLS-1$
|
||||||
|
|
||||||
String comparableActualString = actual;
|
String comparableActualString = actual;
|
||||||
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)
|
// Starting in GDB 9 the versions are MAJOR.PATCH so we only care about first number
|
||||||
// We should ignore the maintenance number.
|
int majorVersion = Integer.parseInt(expectedParts[0]);
|
||||||
// For example, if we expect 7.12, then the actual
|
if (majorVersion >= 9) {
|
||||||
// version we should accept can be 7.12 or 7.12.1 or 7.12.2, 7.12.50.20170214, etc.
|
if (expectedParts.length == 1 // If the expected version does not care about the maintenance number
|
||||||
int firstDot = actual.indexOf('.');
|
&& actualParts.length > 1) { // and the actual version has a maintenance number (and possibly more)
|
||||||
int secondDot = actual.indexOf('.', firstDot + 1);
|
// We should ignore the maintenance number.
|
||||||
comparableActualString = actual.substring(0, secondDot);
|
// 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.
|
||||||
|
// For example, if we expect 7.12, then the actual
|
||||||
|
// version we should accept can be 7.12 or 7.12.1 or 7.12.2, 7.12.50.20170214, etc.
|
||||||
|
int firstDot = actual.indexOf('.');
|
||||||
|
int secondDot = actual.indexOf('.', firstDot + 1);
|
||||||
|
comparableActualString = actual.substring(0, secondDot);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assertTrue("Unexpected GDB version. Expected " + expected + " actual " + actual,
|
assertTrue("Unexpected GDB version. Expected " + expected + " actual " + actual,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2010, 2015 Ericsson and others.
|
* Copyright (c) 2010, 2021 Ericsson and others.
|
||||||
*
|
*
|
||||||
* This program and the accompanying materials
|
* This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License 2.0
|
* 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_0 = "8.0";
|
||||||
public static final String SUFFIX_GDB_8_1 = "8.1";
|
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_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[] {
|
public static String[] ALL_SUPPORTED_VERSIONS = new String[] {
|
||||||
// add new versions here
|
// 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_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_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,
|
ITestConstants.SUFFIX_GDB_7_9, ITestConstants.SUFFIX_GDB_7_8, ITestConstants.SUFFIX_GDB_7_7,
|
||||||
|
|
Loading…
Add table
Reference in a new issue