--- old/test/lib/jdk/test/lib/Platform.java 2020-01-30 20:31:17.000000000 -0800 +++ new/test/lib/jdk/test/lib/Platform.java 2020-01-30 20:31:17.000000000 -0800 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,8 @@ import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.regex.Pattern; import java.security.AccessController; import java.security.PrivilegedAction; @@ -45,6 +47,7 @@ private static final String osArch = privilegedGetProperty("os.arch"); private static final String userName = privilegedGetProperty("user.name"); private static final String compiler = privilegedGetProperty("sun.management.compiler"); + private static final String testJdk = privilegedGetProperty("test.jdk"); private static String privilegedGetProperty(String key) { return AccessController.doPrivileged(( @@ -334,6 +337,35 @@ } } + /** + * Returns absolute path to directory containing JVM shared library. + */ + public static Path jvmLibDir() { + Path dir = Paths.get(testJdk); + if (Platform.isWindows()) { + return dir.resolve("bin") + .resolve(variant()) + .toAbsolutePath(); + } else { + return dir.resolve("lib") + .resolve(variant()) + .toAbsolutePath(); + } + } + + private static String variant() { + if (Platform.isServer()) { + return "server"; + } else if (Platform.isClient()) { + return "client"; + } else if (Platform.isMinimal()) { + return "minimal"; + } else { + throw new Error("TESTBUG: unsupported vm variant"); + } + } + + public static boolean isDefaultCDSArchiveSupported() { return (is64bit() && isServer() &&