diff --git a/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/UsedVersion.java b/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/UsedVersion.java index a64a97ee..fb3977f0 100644 --- a/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/UsedVersion.java +++ b/testsuite/src/it/java/org/graalvm/tests/integration/utils/versions/UsedVersion.java @@ -26,6 +26,7 @@ import java.io.IOException; import java.util.Arrays; import java.util.List; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -69,6 +70,12 @@ * GraalVM Runtime Environment GraalVM CE (build 20+34-jvmci-23.0-b10) * Substrate VM GraalVM CE (build 20+34, serial gc) * + * or + * + * native-image 22 2024-03-19 + * GraalVM Runtime Environment GraalVM CE 22-dev+15.1 (build 22+15-jvmci-b01) + * Substrate VM GraalVM CE 22-dev+15.1 (build 22+15, serial gc) + * * @author Michal Karm Babacek */ public class UsedVersion { @@ -97,6 +104,11 @@ public static int jdkUpdate(boolean inContainer) { // Implements version parsing after https://github.com/oracle/graal/pull/6302 static final class VersionParseHelper { + private static final Map GRAAL_MAPPING = Map.of(22, "24.0", + 23, "24.1", + 24, "25.0", + 25, "25.1"); + private static final String JVMCI_BUILD_PREFIX = "jvmci-"; private static final String MANDREL_VERS_PREFIX = "Mandrel-"; @@ -145,7 +157,7 @@ static MVersion parse(List lines) { String vendorVersion = secondMatcher.group(VENDOR_VERSION_GROUP); String buildInfo = secondMatcher.group(BUILD_INFO_GROUP); - String graalVersion = graalVersion(buildInfo); + String graalVersion = graalVersion(buildInfo, v.feature()); String mandrelVersion = mandrelVersion(vendorVersion); String versNum = (isMandrel(vendorVersion) ? mandrelVersion : graalVersion); Version vers = versionParse(versNum); @@ -191,7 +203,11 @@ private static String matchVersion(String version) { return null; } - private static String graalVersion(String buildInfo) { + private static String graalVersion(String buildInfo, int jdkFeatureVers) { + if (jdkFeatureVers >= 22) { + // short-circuit new version scheme with a mapping + return GRAAL_MAPPING.get(Integer.valueOf(jdkFeatureVers)); + } if (buildInfo == null) { return null; }