Skip to content
Permalink
Browse files

8244078: ProcessTools executeTestJvm and createJavaProcessBuilder hav…

…e inconsistent handling of test.*.opts

Reviewed-by: dholmes, cjplummer
  • Loading branch information
stefank committed May 4, 2020
1 parent a8edd11 commit 81597d9f8fbc40bb1a26ca9fe66ece3caf1c9dda
Showing with 169 additions and 204 deletions.
  1. +1 −1 test/hotspot/jtreg/compiler/aot/verification/ClassAndLibraryNotMatchTest.java
  2. +1 −1 test/hotspot/jtreg/compiler/aot/verification/vmflags/BasicFlagsChange.java
  3. +5 −6 test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java
  4. +1 −1 test/hotspot/jtreg/compiler/ciReplay/SABase.java
  5. +2 −3 test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java
  6. +2 −2 test/hotspot/jtreg/compiler/runtime/cr8015436/Driver8015436.java
  7. +1 −1 test/hotspot/jtreg/compiler/types/correctness/OffTest.java
  8. +1 −2 test/hotspot/jtreg/gc/TestAllocateHeapAt.java
  9. +1 −2 test/hotspot/jtreg/gc/TestAllocateHeapAtError.java
  10. +1 −1 test/hotspot/jtreg/gc/TestAllocateHeapAtMultiple.java
  11. +1 −2 test/hotspot/jtreg/gc/TestVerifyDuringStartup.java
  12. +7 −11 test/hotspot/jtreg/gc/arguments/GCArguments.java
  13. +1 −2 test/hotspot/jtreg/gc/arguments/TestUseNUMAInterleaving.java
  14. +1 −1 test/hotspot/jtreg/gc/g1/TestShrinkAuxiliaryData.java
  15. +1 −2 test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java
  16. +1 −2 test/hotspot/jtreg/gc/logging/TestMetaSpaceLog.java
  17. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAt.java
  18. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtError.java
  19. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestAllocateOldGenAtMultiple.java
  20. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestHumongousObjectsOnNvdimm.java
  21. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestOldObjectsOnNvdimm.java
  22. +1 −1 test/hotspot/jtreg/gc/nvdimm/TestYoungObjectsOnDram.java
  23. +1 −2 test/hotspot/jtreg/gc/whitebox/TestWBGC.java
  24. +1 −1 test/hotspot/jtreg/runtime/7162488/TestUnrecognizedVmOption.java
  25. +1 −1 test/hotspot/jtreg/runtime/BootstrapMethod/BSMCalledTwice.java
  26. +1 −1 test/hotspot/jtreg/runtime/ClassFile/UnsupportedClassFileVersion.java
  27. +1 −1 test/hotspot/jtreg/runtime/InvocationTests/invocationC1Tests.java
  28. +1 −1 test/hotspot/jtreg/runtime/InvocationTests/invocationGraalTests.java
  29. +1 −1 test/hotspot/jtreg/runtime/InvocationTests/invokeinterfaceTests.java
  30. +1 −1 test/hotspot/jtreg/runtime/InvocationTests/invokespecialTests.java
  31. +1 −1 test/hotspot/jtreg/runtime/InvocationTests/invokevirtualTests.java
  32. +1 −1 test/hotspot/jtreg/runtime/StackTrace/LargeClassTest.java
  33. +1 −2 test/hotspot/jtreg/runtime/Unsafe/RangeCheck.java
  34. +3 −3 test/hotspot/jtreg/runtime/cds/SharedArchiveFile.java
  35. +1 −2 test/hotspot/jtreg/runtime/cds/appcds/DumpClassList.java
  36. +2 −2 test/hotspot/jtreg/runtime/cds/appcds/GraalWithLimitedMetaspace.java
  37. +2 −2 test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java
  38. +1 −1 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/DynamicArchiveTestBase.java
  39. +1 −2 test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/NoClassToArchive.java
  40. +2 −2 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SharedStringsBasic.java
  41. +2 −2 test/hotspot/jtreg/runtime/cds/appcds/sharedStrings/SysDictCrash.java
  42. +1 −2 test/hotspot/jtreg/runtime/handshake/HandshakeTransitionTest.java
  43. +3 −6 test/hotspot/jtreg/runtime/modules/PatchModule/PatchModuleClassList.java
  44. +1 −2 test/hotspot/jtreg/runtime/os/AvailableProcessors.java
  45. +1 −2 test/hotspot/jtreg/runtime/os/TestUseCpuAllocPath.java
  46. +1 −1 test/hotspot/jtreg/runtime/verifier/OverriderMsg.java
  47. +3 −3 test/hotspot/jtreg/runtime/verifier/TestANewArray.java
  48. +1 −1 test/hotspot/jtreg/runtime/verifier/TestMultiANewArray.java
  49. +1 −1 test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeClass.java
  50. +1 −1 test/hotspot/jtreg/serviceability/jvmti/GetObjectSizeOverflow.java
  51. +1 −2 test/hotspot/jtreg/serviceability/logging/TestLogRotation.java
  52. +3 −3 test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java
  53. +1 −1 test/hotspot/jtreg/serviceability/sa/TestJmapCore.java
  54. +1 −3 test/hotspot/jtreg/testlibrary/ctw/src/sun/hotspot/tools/ctw/CtwRunner.java
  55. +1 −1 test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java
  56. +1 −1 test/hotspot/jtreg/testlibrary_tests/ctw/CtwTest.java
  57. +2 −2 test/hotspot/jtreg/vmTestbase/gc/huge/quicklook/largeheap/MemOptions/MemOptionsTest.java
  58. +2 −2 test/hotspot/jtreg/vmTestbase/jit/tiered/Test.java
  59. +2 −2 test/hotspot/jtreg/vmTestbase/metaspace/flags/maxMetaspaceSize/TestMaxMetaspaceSize.java
  60. +1 −2 test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java
  61. +1 −2 ...hotspot/jtreg/vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java
  62. +2 −2 test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfo/Test.java
  63. +1 −1 test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/Test.java
  64. +1 −1 test/jdk/com/sun/jdi/JITDebug.java
  65. +1 −1 test/jdk/com/sun/jdi/PrivateTransportTest.java
  66. +1 −1 test/jdk/com/sun/jdi/cds/CDSJDITest.java
  67. +1 −8 test/jdk/com/sun/jdi/lib/jdb/Debuggee.java
  68. +1 −1 test/jdk/java/io/File/MacPath.java
  69. +2 −2 test/jdk/java/io/Serializable/evolution/RenamePackage/RenamePackageTest.java
  70. +2 −2 test/jdk/java/lang/RuntimeTests/shutdown/ShutdownInterruptedMain.java
  71. +1 −1 test/jdk/java/lang/StackWalker/CallerFromMain.java
  72. +1 −1 test/jdk/java/lang/System/MacEncoding/MacJNUEncoding.java
  73. +1 −1 test/jdk/java/lang/instrument/DaemonThread/TestDaemonThreadLauncher.java
  74. +1 −1 test/jdk/java/nio/charset/Charset/DefaultCharsetTest.java
  75. +1 −1 test/jdk/java/nio/file/Path/MacPathTest.java
  76. +1 −1 test/jdk/jdk/jfr/api/consumer/streaming/TestCrossProcessStreaming.java
  77. +1 −1 test/jdk/jdk/jfr/api/consumer/streaming/TestProcess.java
  78. +1 −2 test/jdk/jdk/jfr/event/runtime/TestDumpReason.java
  79. +1 −1 test/jdk/jdk/jfr/event/runtime/TestShutdownEvent.java
  80. +1 −1 test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java
  81. +1 −1 test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java
  82. +1 −1 test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java
  83. +11 −13 test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java
  84. +4 −4 test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java
  85. +1 −1 test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java
  86. +2 −2 test/jdk/jdk/jfr/startupargs/TestStartDuration.java
  87. +1 −1 test/jdk/jdk/jfr/startupargs/TestStartName.java
  88. +1 −1 test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java
  89. +1 −1 test/jdk/sun/security/ssl/SSLSessionImpl/ResumptionUpdateBoundValues.java
  90. +1 −1 test/jdk/sun/security/ssl/SSLSocketImpl/SSLSocketKeyLimit.java
  91. +2 −2 test/lib/jdk/test/lib/cds/CDSTestUtils.java
  92. +1 −1 test/lib/jdk/test/lib/jfr/AppExecutorHelper.java
  93. +32 −30 test/lib/jdk/test/lib/process/ProcessTools.java
@@ -92,7 +92,7 @@ private void compileAotLibrary() {
private void runAndCheckHelloWorld(String checkString) {
ProcessBuilder pb;
try {
pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".",
pb = ProcessTools.createTestJvm("-cp", ".",
"-XX:+UnlockExperimentalVMOptions", "-XX:+UseAOT",
"-XX:AOTLibrary=./" + LIB_NAME, HELLO_WORLD_CLASS_NAME);
} catch (Exception e) {
@@ -87,7 +87,7 @@ private static void runAndCheck(String option, String libName,
so, a message like "skipped $pathTolibrary aot library" or
"loaded $pathToLibrary aot library" is present for cases of
incompatible or compatible flags respectively */
pb = ProcessTools.createJavaProcessBuilder(true, "-XX:+UnlockExperimentalVMOptions",
pb = ProcessTools.createTestJvm("-XX:+UnlockExperimentalVMOptions",
"-XX:+UseAOT", "-XX:+PrintAOT", "-XX:AOTLibrary=./" + libName, option,
HelloWorldPrinter.class.getName());
} catch (Exception ex) {
@@ -142,11 +142,10 @@ public boolean generateReplay(boolean needCoreDump, String... vmopts) {
options.add(needCoreDump ? ENABLE_COREDUMP_ON_CRASH : DISABLE_COREDUMP_ON_CRASH);
options.add(EmptyMain.class.getName());
if (needCoreDump) {
crashOut = ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
crashOut = ProcessTools.executeProcess(getTestJvmCommandlineWithPrefix(
RUN_SHELL_NO_LIMIT, options.toArray(new String[0])));
} else {
crashOut = ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder(true,
options));
crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(options));
}
crashOutputString = crashOut.getOutput();
Asserts.assertNotEquals(crashOut.getExitValue(), 0, "Crash JVM exits gracefully");
@@ -190,7 +189,7 @@ public int startTest(String... additionalVmOpts) {
List<String> allAdditionalOpts = new ArrayList<>();
allAdditionalOpts.addAll(Arrays.asList(REPLAY_OPTIONS));
allAdditionalOpts.addAll(Arrays.asList(additionalVmOpts));
OutputAnalyzer oa = ProcessTools.executeProcess(getTestJavaCommandlineWithPrefix(
OutputAnalyzer oa = ProcessTools.executeProcess(getTestJvmCommandlineWithPrefix(
RUN_SHELL_ZERO_LIMIT, allAdditionalOpts.toArray(new String[0])));
return oa.getExitValue();
} catch (Throwable t) {
@@ -290,9 +289,9 @@ private String getCoreFileLocation(String crashOutputString) {
return null;
}

private String[] getTestJavaCommandlineWithPrefix(String prefix, String... args) {
private String[] getTestJvmCommandlineWithPrefix(String prefix, String... args) {
try {
String cmd = ProcessTools.getCommandLine(ProcessTools.createJavaProcessBuilder(true, args));
String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm(args));
return new String[]{"sh", "-c", prefix
+ (Platform.isWindows() ? cmd.replace('\\', '/').replace(";", "\\;").replace("|", "\\|") : cmd)};
} catch(Throwable t) {
@@ -57,7 +57,7 @@ public void testAction() {
}
ProcessBuilder pb;
try {
pb = ProcessTools.createJavaProcessBuilder(true, "--add-modules", "jdk.hotspot.agent",
pb = ProcessTools.createTestJvm("--add-modules", "jdk.hotspot.agent",
"--add-exports=jdk.hotspot.agent/sun.jvm.hotspot=ALL-UNNAMED",
"sun.jvm.hotspot.CLHSDB", JDKToolFinder.getTestJDKTool("java"),
TEST_CORE_FILE_NAME);
@@ -113,7 +113,7 @@
String classPath = String.join(File.pathSeparator, System.getProperty("java.class.path"),
String.join(File.separator, libsDir, MXTOOL_JARFILE));

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false,
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
"-cp", classPath,
"com.oracle.mxtool.junit.FindClassesByAnnotatedMethods", graalUnitTestFilePath, testAnnotationName);

@@ -277,8 +277,7 @@ public static void main(String... args) throws Exception {

javaFlags.add("@"+GENERATED_TESTCLASSES_FILENAME);

ProcessBuilder javaPB = ProcessTools.createJavaProcessBuilder(true,
javaFlags);
ProcessBuilder javaPB = ProcessTools.createTestJvm(javaFlags);

// Some tests rely on MX_SUBPROCESS_COMMAND_FILE env variable which contains
// name of the file with java executable and java args used to launch the current process.
@@ -30,8 +30,8 @@
public static void main(String args[]) {
OutputAnalyzer oa;
try {
oa = ProcessTools.executeProcess(ProcessTools.createJavaProcessBuilder(
/* add test vm options */ true, Test8015436.class.getName()));
oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(
Test8015436.class.getName()));
} catch (Exception ex) {
throw new Error("TESTBUG: exception while running child process: " + ex, ex);
}
@@ -86,7 +86,7 @@ private static void runTest() throws Exception {
OPTIONS[TYPE_PROFILE_INDEX] = typeProfileLevel;
OPTIONS[USE_TYPE_SPECULATION_INDEX] = useTypeSpeculation;
OPTIONS[PROFILING_TYPE_INDEX] = type.name();
ProcessBuilder processBuilder = ProcessTools.createJavaProcessBuilder(/* addTestVmOptions= */ true, OPTIONS);
ProcessBuilder processBuilder = ProcessTools.createTestJvm(OPTIONS);
OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start());
outputAnalyzer.shouldHaveExitValue(0);
}
@@ -40,8 +40,7 @@

public class TestAllocateHeapAt {
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
true,
ProcessBuilder pb = ProcessTools.createTestJvm(
"-XX:AllocateHeapAt=" + System.getProperty("test.dir", "."),
"-Xlog:gc+heap=info",
"-Xmx32m",
@@ -46,8 +46,7 @@ public static void main(String args[]) throws Exception {
f = new File(test_dir, UUID.randomUUID().toString());
} while(f.exists());

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
true,
ProcessBuilder pb = ProcessTools.createTestJvm(
"-XX:AllocateHeapAt=" + f.getName(),
"-Xlog:gc+heap=info",
"-Xmx32m",
@@ -62,7 +62,7 @@ public static void main(String args[]) throws Exception {
"-Xlog:gc+heap=info",
"-version"});

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);
OutputAnalyzer output = new OutputAnalyzer(pb.start());

System.out.println("Output:\n" + output.getOutput());
@@ -38,8 +38,7 @@

public class TestVerifyDuringStartup {
public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
true,
ProcessBuilder pb = ProcessTools.createTestJvm(
"-XX:-UseTLAB",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+VerifyDuringStartup",
@@ -67,22 +67,18 @@ static private void addDefaults(List<String> arguments) {
}

static public ProcessBuilder createJavaProcessBuilder(List<String> arguments) {
return createJavaProcessBuilder(false, arguments);
return createJavaProcessBuilder(arguments.toArray(String[]::new));
}

static public ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions,
List<String> arguments) {
return createJavaProcessBuilder(addTestVmAndJavaOptions,
arguments.toArray(String[]::new));
static public ProcessBuilder createJavaProcessBuilder(String... arguments) {
return ProcessTools.createJavaProcessBuilder(withDefaults(arguments));
}

static public ProcessBuilder createJavaProcessBuilder(String... arguments) {
return createJavaProcessBuilder(false, arguments);
static public ProcessBuilder createTestJvm(List<String> arguments) {
return createTestJvm(arguments.toArray(String[]::new));
}

static public ProcessBuilder createJavaProcessBuilder(boolean addTestVmAndJavaOptions,
String... arguments) {
return ProcessTools.createJavaProcessBuilder(addTestVmAndJavaOptions,
withDefaults(arguments));
static public ProcessBuilder createTestJvm(String... arguments) {
return ProcessTools.createTestJvm(withDefaults(arguments));
}
}
@@ -41,8 +41,7 @@
public class TestUseNUMAInterleaving {

public static void main(String[] args) throws Exception {
ProcessBuilder pb = GCArguments.createJavaProcessBuilder(
true,
ProcessBuilder pb = GCArguments.createTestJvm(
"-XX:+UseNUMA",
"-XX:+PrintFlagsFinal",
"-version");
@@ -102,7 +102,7 @@ protected void test() throws Exception {
}

private void performTest(List<String> opts) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, opts);
ProcessBuilder pb = ProcessTools.createTestJvm(opts);

OutputAnalyzer output = new OutputAnalyzer(pb.start());
System.out.println(output.getStdout());
@@ -90,8 +90,7 @@ private static OutputAnalyzer spawnMixedGCProvoker(String... extraFlags)
Collections.addAll(testOpts, extraFlags);
testOpts.add(RunMixedGC.class.getName());
System.out.println(testOpts);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false,
testOpts);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(testOpts);
return new OutputAnalyzer(pb.start());
}
}
@@ -84,8 +84,7 @@ private static void testMetaSpaceUpdate() throws Exception {
String testSrc= "-Dtest.src=" + System.getProperty("test.src", ".");

ProcessBuilder pb =
ProcessTools.createJavaProcessBuilder(
true,
ProcessTools.createTestJvm(
"-Xlog:gc*",
"-Xbootclasspath/a:.",
"-XX:+UnlockDiagnosticVMOptions",
@@ -59,7 +59,7 @@ private static void runTest(String... extraFlags) throws Exception {
ArrayList<String> flags = new ArrayList<>();
Collections.addAll(flags, commonFlags);
Collections.addAll(flags, extraFlags);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);
OutputAnalyzer output = new OutputAnalyzer(pb.start());

output.shouldHaveExitValue(0);
@@ -89,7 +89,7 @@ private static OutputAnalyzer runTest(String... extraFlags) throws Exception {
Collections.addAll(flags, commonFlags);
Collections.addAll(flags, extraFlags);

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
return output;
}
@@ -63,7 +63,7 @@ public static void main(String args[]) throws Exception {
Collections.addAll(flags, new String[] {"-XX:+UnlockExperimentalVMOptions",
"-XX:AllocateOldGenAt=" + test_dir,
"-version"});
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);
OutputAnalyzer output = new OutputAnalyzer(pb.start());

System.out.println("Output:\n" + output.getOutput());
@@ -72,7 +72,7 @@ private static void runTest(String... extraFlags) throws Exception {
Collections.addAll(flags, extraFlags);
flags.add(HumongousObjectTest.class.getName());

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);

OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
@@ -71,7 +71,7 @@ private static void runTest(String... extraFlags) throws Exception {
Collections.addAll(flags, extraFlags);
flags.add(OldObjectTest.class.getName());

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);

OutputAnalyzer output = new OutputAnalyzer(pb.start());
System.out.println(output.getStdout());
@@ -72,7 +72,7 @@ private static void runTest(String... extraFlags) throws Exception {
Collections.addAll(flags, extraFlags);
flags.add(YoungObjectTest.class.getName());

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, flags);
ProcessBuilder pb = ProcessTools.createTestJvm(flags);

OutputAnalyzer output = new OutputAnalyzer(pb.start());
System.out.println(output.getStdout());
@@ -43,8 +43,7 @@
public class TestWBGC {

public static void main(String args[]) throws Exception {
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
true,
ProcessBuilder pb = ProcessTools.createTestJvm(
"-Xbootclasspath/a:.",
"-XX:+UnlockDiagnosticVMOptions",
"-XX:+WhiteBoxAPI",
@@ -36,7 +36,7 @@

public static void main(String[] args) throws Exception {
ProcessBuilder pb =
ProcessTools.createJavaProcessBuilder(true, "-showversion", "-XX:" + OPTION);
ProcessTools.createTestJvm("-showversion", "-XX:" + OPTION);
new OutputAnalyzer(pb.start())
.shouldNotHaveExitValue(0)
.shouldContain("Unrecognized VM option")
@@ -97,7 +97,7 @@ public static void main(String[] args) throws Exception {
};

cl.loadClass(classTestCName);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", classTestCName);
ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", classTestCName);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
String test_output = output.getOutput();
if (test_output == null) {
@@ -42,7 +42,7 @@
public class UnsupportedClassFileVersion implements Opcodes {
public static void main(String... args) throws Exception {
writeClassFile();
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", "ClassFile");
ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "ClassFile");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldContain("ClassFile has been compiled by a more recent version of the " +
"Java Runtime (class file version 99.0), this version of " +
@@ -48,7 +48,7 @@
public static void runTest(String whichTests, String classFileVersion) throws Throwable {
System.out.println("\nC1 invocation tests, Tests: " + whichTests +
", class file version: " + classFileVersion);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M",
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M",
"-Xcomp", "-XX:TieredStopAtLevel=1",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
whichTests, "--classfile_version=" + classFileVersion);
@@ -49,7 +49,7 @@
public static void runTest(String whichTests, String classFileVersion) throws Throwable {
System.out.println("\nGraal invocation tests, Tests: " + whichTests +
", class file version: " + classFileVersion);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M",
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M",
"-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", "-XX:+UseJVMCICompiler",
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
whichTests, "--classfile_version=" + classFileVersion);
@@ -47,7 +47,7 @@
public static void runTest(String classFileVersion, String option) throws Throwable {
System.out.println("\ninvokeinterface invocation tests, option: " + option +
", class file version: " + classFileVersion);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option,
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"invokeinterface.Generator", "--classfile_version=" + classFileVersion);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
@@ -46,7 +46,7 @@
public static void runTest(String classFileVersion, String option) throws Throwable {
System.out.println("\ninvokespecial invocation tests, option: " + option +
", class file version: " + classFileVersion);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option,
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"invokespecial.Generator", "--classfile_version=" + classFileVersion);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
@@ -46,7 +46,7 @@
public static void runTest(String classFileVersion, String option) throws Throwable {
System.out.println("\ninvokevirtual invocation tests, option: " + option +
", class file version: " + classFileVersion);
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, "-Xmx128M", option,
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xmx128M", option,
"--add-exports", "java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED",
"invokevirtual.Generator", "--classfile_version=" + classFileVersion);
OutputAnalyzer output = new OutputAnalyzer(pb.start());
@@ -46,7 +46,7 @@
public class LargeClassTest implements Opcodes {
public static void main(String... args) throws Exception {
writeClassFile();
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, "-cp", ".", "Large");
ProcessBuilder pb = ProcessTools.createTestJvm("-cp", ".", "Large");
OutputAnalyzer output = new OutputAnalyzer(pb.start());
output.shouldHaveExitValue(0);
}
@@ -44,8 +44,7 @@ public static void main(String args[]) throws Exception {
return;
}

ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
true,
ProcessBuilder pb = ProcessTools.createTestJvm(
"-Xmx128m",
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
"-XX:-CreateCoredumpOnCrash",

0 comments on commit 81597d9

Please sign in to comment.