< prev index next >

test/hotspot/jtreg/gtest/GTestWrapper.java

Print this page
rev 49499 : Set LD_LIBRARY_PATH or LIBPATH to find the right libjvm.

*** 28,37 **** --- 28,38 ---- * @run main/native GTestWrapper */ import java.util.Arrays; import java.util.List; + import java.util.Map; import java.util.stream.Stream; import java.util.stream.Collectors; import java.nio.file.Paths; import java.nio.file.Path;
*** 57,72 **** .resolve(jvmVariantDir); } if (!path.toFile().exists()) { throw new Error("TESTBUG: the library has not been found in " + nativePath); } ! path = path.resolve("gtestLauncher" + (Platform.isWindows() ? ".exe" : "")); ! ProcessTools.executeCommand(new String[] { ! path.toString(), "-jdk", System.getProperty("test.jdk") ! }).shouldHaveExitValue(0); } private static String getJVMVariantSubDir() { if (Platform.isServer()) { return "server"; --- 58,88 ---- .resolve(jvmVariantDir); } if (!path.toFile().exists()) { throw new Error("TESTBUG: the library has not been found in " + nativePath); } ! ! Path execPath = path.resolve("gtestLauncher" + (Platform.isWindows() ? ".exe" : "")); ! ProcessBuilder pb = new ProcessBuilder(); ! Map<String, String> env = pb.environment(); ! ! String ldLibraryPath = System.getenv("LD_LIBRARY_PATH"); ! if (ldLibraryPath != null) { ! env.put("LD_LIBRARY_PATH", path + ":" + ldLibraryPath); ! } ! ! String libPath = System.getenv("LIBPATH"); ! if (libPath != null) { ! env.put("LIBPATH", path + ":" + libPath); ! } ! ! pb.command(new String[] { ! execPath.toString(), "-jdk", System.getProperty("test.jdk") ! }); ! ProcessTools.executeCommand( pb ).shouldHaveExitValue(0); } private static String getJVMVariantSubDir() { if (Platform.isServer()) { return "server";
< prev index next >