8315097: Rename createJavaProcessBuilder
Reviewed-by: lmesnik, dholmes, rriggs, stefank
This commit is contained in:
parent
957703b1f9
commit
d52a995f35
@ -69,7 +69,7 @@ public class JcstressRunner {
|
||||
}
|
||||
Path out = Paths.get("jcstress.out").toAbsolutePath();
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(getCmd(args))
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(getCmd(args))
|
||||
.redirectErrorStream(true)
|
||||
.redirectOutput(out.toFile());
|
||||
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
|
||||
|
@ -109,7 +109,7 @@ public class TestGenerator {
|
||||
Path output;
|
||||
try {
|
||||
output = Files.createTempFile("jcstress", ".out");
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-jar",
|
||||
path.toAbsolutePath().toString(),
|
||||
"-l");
|
||||
|
@ -48,7 +48,7 @@ public class Scimark {
|
||||
|
||||
System.setProperty("test.noclasspath", "true");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJvm(
|
||||
OutputAnalyzer output = new OutputAnalyzer(ProcessTools.createTestJavaProcessBuilder(
|
||||
"-cp", artifacts.get("gov.nist.math.scimark-2.0").toString(),
|
||||
"jnt.scimark2.commandline", "-large")
|
||||
.start());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -190,7 +190,7 @@ public class CheckCICompilerCount {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
try {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -338,7 +338,7 @@ public class CheckCompileThresholdScaling {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
try {
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -61,7 +61,7 @@ public class TestCodeEntryAlignment {
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
}
|
||||
|
@ -62,14 +62,14 @@ public class TestOptoLoopAlignment {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldNotHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -51,7 +51,7 @@ public class TestPrintOptoAssemblyLineNumbers {
|
||||
CheckC2OptoAssembly.class.getName()
|
||||
};
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer oa = new OutputAnalyzer(pb.start());
|
||||
oa.shouldHaveExitValue(0);
|
||||
|
||||
|
@ -173,7 +173,7 @@ public class TestStressArrayCopy {
|
||||
for (String className : classNames) {
|
||||
// Start a new job
|
||||
{
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(mix(c, "-Xmx256m", className));
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(mix(c, "-Xmx256m", className));
|
||||
Process p = pb.start();
|
||||
OutputAnalyzer oa = new OutputAnalyzer(p);
|
||||
forks.add(new Fork(p, oa));
|
||||
|
@ -65,14 +65,14 @@ public class BlackholeExistingIntrinsicWarningTest {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -65,14 +65,14 @@ public class BlackholeExperimentalUnlockTest {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -134,7 +134,7 @@ public class BlackholeIntrinsicTest {
|
||||
cmdline.add("compiler.blackhole.BlackholeIntrinsicTest");
|
||||
cmdline.add(test);
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.stderrShouldBeEmpty();
|
||||
|
@ -64,14 +64,14 @@ public class BlackholeNonEmptyWarningTest {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -64,14 +64,14 @@ public class BlackholeNonStaticWarningTest {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -64,14 +64,14 @@ public class BlackholeNonVoidWarningTest {
|
||||
}
|
||||
|
||||
public static void shouldFail(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldContain(MSG);
|
||||
}
|
||||
|
||||
public static void shouldPass(String... args) throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmdline(args));
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmdline(args));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
output.shouldNotContain(MSG);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -54,7 +54,7 @@ public class TestRangeCheckEliminated {
|
||||
test_constant_array.class.getName()
|
||||
};
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
String output = new OutputAnalyzer(pb.start()).getOutput();
|
||||
// should have 2 "can be fully eliminated"
|
||||
System.out.println(output);
|
||||
@ -74,7 +74,7 @@ public class TestRangeCheckEliminated {
|
||||
test_multi_constant_array.class.getName()
|
||||
};
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
output = new OutputAnalyzer(pb.start()).getOutput();
|
||||
// should have 1 "can be fully eliminated"
|
||||
System.out.println(output);
|
||||
@ -94,7 +94,7 @@ public class TestRangeCheckEliminated {
|
||||
test_multi_new_array.class.getName()
|
||||
};
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
output = new OutputAnalyzer(pb.start()).getOutput();
|
||||
// should have 2 "can be fully eliminated"
|
||||
System.out.println(output);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -49,7 +49,7 @@ public class TestBit {
|
||||
"-XX:CompileCommand=compileonly," + className + "::tst*",
|
||||
className, testName};
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
String expectedTestBitInstruction =
|
||||
|
@ -95,7 +95,7 @@ public class TestFarJump {
|
||||
"-XX:+PrintAssembly",
|
||||
className};
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
List<String> lines = output.asLines();
|
||||
|
||||
|
@ -1,27 +1,27 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, Arm Limited. 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, Arm Limited. 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* @test
|
||||
@ -79,7 +79,7 @@ public class TestSVEWithJNI {
|
||||
Collections.addAll(vmopts, "-Dtest.jdk=" + testjdkPath);
|
||||
Collections.addAll(vmopts, args);
|
||||
Collections.addAll(vmopts, TestSVEWithJNI.class.getName(), mode);
|
||||
return ProcessTools.createJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()]));
|
||||
return ProcessTools.createLimitedTestJavaProcessBuilder(vmopts.toArray(new String[vmopts.size()]));
|
||||
}
|
||||
|
||||
public static void main(String [] args) throws Exception {
|
||||
|
@ -57,7 +57,7 @@ public class TestTrampoline {
|
||||
command.add("-XX:ReservedCodeCacheSize=130M");
|
||||
command.add("-XX:+SegmentedCodeCache");
|
||||
command.add(testClassName);
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command);
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
analyzer.shouldHaveExitValue(0);
|
||||
System.out.println(analyzer.getOutput());
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -132,7 +132,7 @@ public class TestVolatiles {
|
||||
|
||||
|
||||
public void runtest(String classname, String testType, boolean useCompressedOops, String[] procArgs) throws Throwable {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
output.stderrShouldBeEmptyIgnoreVMWarnings();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -177,11 +177,11 @@ public abstract class CiReplayBase {
|
||||
options.add("'" + getTestClass() + "'");
|
||||
crashOut = ProcessTools.executeProcess(
|
||||
CoreUtils.addCoreUlimitCommand(
|
||||
ProcessTools.createTestJvm(options.toArray(new String[0]))));
|
||||
ProcessTools.createTestJavaProcessBuilder(options.toArray(new String[0]))));
|
||||
} else {
|
||||
options.add("-XX:CompileOnly=" + getTestClass() + "::" + getTestMethod());
|
||||
options.add(getTestClass());
|
||||
crashOut = ProcessTools.executeProcess(ProcessTools.createTestJvm(options));
|
||||
crashOut = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options));
|
||||
}
|
||||
crashOutputString = crashOut.getOutput();
|
||||
Asserts.assertNotEquals(crashOut.getExitValue(), 0, "Crash JVM exits gracefully");
|
||||
@ -288,7 +288,7 @@ public abstract class CiReplayBase {
|
||||
|
||||
private String[] getTestJvmCommandlineWithPrefix(String prefix, String... args) {
|
||||
try {
|
||||
String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJvm(args));
|
||||
String cmd = ProcessTools.getCommandLine(ProcessTools.createTestJavaProcessBuilder(args));
|
||||
return new String[]{"sh", "-c", prefix
|
||||
+ (Platform.isWindows() ? cmd.replace('\\', '/').replace(";", "\\;").replace("|", "\\|") : cmd)};
|
||||
} catch(Throwable t) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -79,7 +79,7 @@ public abstract class DumpReplayBase extends CiReplayBase {
|
||||
options.add("-XX:CompileCommand=compileonly," + getTestClass() + "::" + getTestMethod());
|
||||
options.add("-Xbatch");
|
||||
options.add(getTestClass());
|
||||
oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(options));
|
||||
oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(options));
|
||||
Asserts.assertEquals(oa.getExitValue(), 0, "Crash JVM exits gracefully");
|
||||
replayFiles = Files.list(Paths.get("."))
|
||||
.map(Path::toFile)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -71,7 +71,7 @@ public class SABase extends CiReplayBase {
|
||||
}
|
||||
ProcessBuilder pb;
|
||||
try {
|
||||
pb = ProcessTools.createTestJvm("--add-modules", "jdk.hotspot.agent",
|
||||
pb = ProcessTools.createTestJavaProcessBuilder("--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);
|
||||
|
@ -54,7 +54,7 @@ public class TestInvalidReplayFile {
|
||||
w.flush();
|
||||
w.close();
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-Xmx100M",
|
||||
"-XX:+ReplayCompiles", "-XX:ReplayDataFile=./bogus-replay-file.txt");
|
||||
|
@ -66,7 +66,7 @@ public class CheckCodeCacheInfo {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb;
|
||||
|
||||
pb = ProcessTools.createTestJvm("-XX:+PrintCodeCache",
|
||||
pb = ProcessTools.createTestJavaProcessBuilder("-XX:+PrintCodeCache",
|
||||
"-XX:+Verbose",
|
||||
"-version");
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
|
@ -50,7 +50,7 @@ public class CheckLargePages {
|
||||
final boolean largePages = WHITE_BOX.getBooleanVMFlag("UseLargePages");
|
||||
final long largePageSize = WHITE_BOX.getVMLargePageSize();
|
||||
if (largePages && (largePageSize == 1024 * 1024 * 1024)) {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UseLargePages",
|
||||
"-XX:+SegmentedCodeCache",
|
||||
"-XX:InitialCodeCacheSize=2g",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -42,8 +42,8 @@ public class CheckReservedInitialCodeCacheSizeArgOrder {
|
||||
ProcessBuilder pb1, pb2;
|
||||
OutputAnalyzer out1, out2;
|
||||
|
||||
pb1 = ProcessTools.createJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
|
||||
pb2 = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
|
||||
pb1 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:InitialCodeCacheSize=4m", "-XX:ReservedCodeCacheSize=8m", "-version");
|
||||
pb2 = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=8m", "-XX:InitialCodeCacheSize=4m", "-version");
|
||||
|
||||
out1 = new OutputAnalyzer(pb1.start());
|
||||
out2 = new OutputAnalyzer(pb2.start());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -89,31 +89,31 @@ public class CheckSegmentedCodeCache {
|
||||
ProcessBuilder pb;
|
||||
|
||||
// Disabled with ReservedCodeCacheSize < 240MB
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=239m",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifySegmentedCodeCache(pb, false);
|
||||
|
||||
// Disabled without TieredCompilation
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:-TieredCompilation",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-TieredCompilation",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifySegmentedCodeCache(pb, false);
|
||||
|
||||
// Enabled with TieredCompilation and ReservedCodeCacheSize >= 240MB
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation",
|
||||
"-XX:ReservedCodeCacheSize=240m",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifySegmentedCodeCache(pb, true);
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+TieredCompilation",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+TieredCompilation",
|
||||
"-XX:ReservedCodeCacheSize=400m",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifySegmentedCodeCache(pb, true);
|
||||
|
||||
// Always enabled if SegmentedCodeCache is set
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-XX:-TieredCompilation",
|
||||
"-XX:ReservedCodeCacheSize=239m",
|
||||
"-XX:+PrintCodeCache",
|
||||
@ -122,7 +122,7 @@ public class CheckSegmentedCodeCache {
|
||||
|
||||
// The profiled and non-profiled code heaps should not be available in
|
||||
// interpreter-only mode
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-Xint",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
@ -130,24 +130,24 @@ public class CheckSegmentedCodeCache {
|
||||
|
||||
// If we stop compilation at CompLevel_none or CompLevel_simple we
|
||||
// don't need a profiled code heap.
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-XX:TieredStopAtLevel=0",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifyCodeHeapNotExists(pb, PROFILED);
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-XX:TieredStopAtLevel=1",
|
||||
"-XX:+PrintCodeCache",
|
||||
"-version");
|
||||
verifyCodeHeapNotExists(pb, PROFILED);
|
||||
|
||||
// Fails with too small non-nmethod code heap size
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:NonNMethodCodeHeapSize=100K",
|
||||
"-version");
|
||||
failsWith(pb, "Invalid NonNMethodCodeHeapSize");
|
||||
|
||||
// Fails if code heap sizes do not add up
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-XX:ReservedCodeCacheSize=10M",
|
||||
"-XX:NonNMethodCodeHeapSize=5M",
|
||||
"-XX:ProfiledCodeHeapSize=5M",
|
||||
@ -159,7 +159,7 @@ public class CheckSegmentedCodeCache {
|
||||
long minUseSpace = WHITE_BOX.getUintxVMFlag("CodeCacheMinimumUseSpace");
|
||||
// minimum size: CodeCacheMinimumUseSpace DEBUG_ONLY(* 3)
|
||||
long minSize = (Platform.isDebugBuild() ? 3 : 1) * minUseSpace;
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+SegmentedCodeCache",
|
||||
"-XX:ReservedCodeCacheSize=" + minSize,
|
||||
"-XX:InitialCodeCacheSize=100K",
|
||||
"-version");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -41,7 +41,7 @@ public class CheckUpperLimit {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=2049m", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldContain("Invalid ReservedCodeCacheSize=");
|
||||
out.shouldHaveExitValue(1);
|
||||
|
@ -63,7 +63,7 @@ public class CodeCacheFullCountTest {
|
||||
}
|
||||
|
||||
public static void runTest() throws Throwable {
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
|
||||
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
|
||||
// Ignore adapter creation failures
|
||||
|
@ -39,7 +39,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
public class TestConflictInlineCommands {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:CompileCommand=inline,*TestConflictInlineCommands::caller",
|
||||
"-XX:CompileCommand=dontinline,*TestConflictInlineCommands::caller",
|
||||
"-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly,*Launcher::main",
|
||||
@ -51,7 +51,7 @@ public class TestConflictInlineCommands {
|
||||
analyzer.shouldContain("disallowed by CompileCommand");
|
||||
analyzer.shouldNotContain("force inline by CompileCommand");
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-Xbatch",
|
||||
"-XX:CompileCommand=dontinline,*TestConflictInlineCommands::*caller",
|
||||
"-XX:CompileCommand=inline,*TestConflictInlineCommands::caller",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -41,7 +41,7 @@ public class RestoreMXCSR {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+RestoreMXCSROnJNICalls", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -58,7 +58,7 @@ public class TestGenerateStressSeed {
|
||||
"-Xcomp", "-XX:-TieredCompilation", "-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:CompileOnly=" + className + "::sum", "-XX:+" + stressOpt,
|
||||
"-XX:+LogCompilation", "-XX:LogFile=" + log, className, "10"};
|
||||
new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(procArgs).start())
|
||||
new OutputAnalyzer(ProcessTools.createLimitedTestJavaProcessBuilder(procArgs).start())
|
||||
.shouldHaveExitValue(0);
|
||||
new OutputAnalyzer(Paths.get(log))
|
||||
.shouldContain("stress_test seed");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -48,7 +48,7 @@ public class TestStressCM {
|
||||
"-XX:CompileOnly=" + className + "::sum",
|
||||
"-XX:+TraceOptoPipelining", "-XX:+" + stressOpt,
|
||||
"-XX:StressSeed=" + stressSeed, className, "10"};
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
// Extract the trace of our method (the last one after those of all
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -48,7 +48,7 @@ public class TestStressIGVNAndCCP {
|
||||
"-XX:CompileOnly=" + className + "::sum", "-XX:+" + traceOption,
|
||||
"-XX:+" + stressOption, "-XX:StressSeed=" + stressSeed,
|
||||
className, "10"};
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(procArgs);
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
return out.getStdout();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -42,7 +42,7 @@ public class VerifyAdapterSharing {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xcomp", "-XX:+IgnoreUnrecognizedVMOptions",
|
||||
"-XX:+VerifyAdapterSharing", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -39,7 +39,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
public class TestIterativeEA {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:+PrintEliminateAllocations",
|
||||
Launcher.class.getName());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -38,7 +38,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
|
||||
public class InlineAccessors {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-server", "-XX:-TieredCompilation", "-Xbatch",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -40,7 +40,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
public class PrintInlining {
|
||||
|
||||
static void test(String option) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-server", "-XX:-TieredCompilation", "-Xbatch", "-XX:-UseOnStackReplacement",
|
||||
"-XX:CompileCommand=dontinline,*::bar",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -42,7 +42,7 @@ import java.io.IOException;
|
||||
public class ResolvedClassTest {
|
||||
/* ======================================================================== */
|
||||
static void testStatic() throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
"-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStatic.class.getName() + "::test",
|
||||
@ -78,7 +78,7 @@ public class ResolvedClassTest {
|
||||
|
||||
/* ======================================================================== */
|
||||
static void testStaticInit() throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
"-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestStaticInit.class.getName() + "::test",
|
||||
@ -115,7 +115,7 @@ public class ResolvedClassTest {
|
||||
|
||||
/* ======================================================================== */
|
||||
static void testIndy() throws IOException {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
"-Xbatch", "-XX:CompileCommand=quiet", "-XX:CompileCommand=compileonly," + TestIndy.class.getName() + "::test",
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2021, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -127,7 +127,7 @@ public class TestChaCha20 {
|
||||
for (String className : classNames) {
|
||||
// Start a new job
|
||||
{
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
mix(c, "-Xmx256m", className));
|
||||
Process p = pb.start();
|
||||
OutputAnalyzer oa = new OutputAnalyzer(p);
|
||||
|
@ -61,7 +61,7 @@ public class ContinuousCallSiteTargetChange {
|
||||
argsList.add(test.getName());
|
||||
argsList.add(Integer.toString(ITERATIONS));
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(argsList);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(argsList);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -47,7 +47,7 @@ import static jdk.test.lib.Asserts.assertEquals;
|
||||
|
||||
public class MHInlineTest {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:-TieredCompilation", "-Xbatch",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintInlining",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -43,7 +43,7 @@ import java.lang.invoke.MethodType;
|
||||
|
||||
public class PollutedTrapCounts {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions",
|
||||
"-XX:-TieredCompilation", "-Xbatch",
|
||||
"-XX:PerBytecodeRecompilationCutoff=10", "-XX:PerMethodRecompilationCutoff=10",
|
||||
|
@ -84,7 +84,7 @@ public class TestEnableJVMCIProduct {
|
||||
String[] flags = {"-XX:+EnableJVMCIProduct", "-XX:+UseGraalJIT"};
|
||||
String cwd = System.getProperty("user.dir");
|
||||
for (String flag : flags) {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions", flag, "-XX:-UnlockExperimentalVMOptions",
|
||||
explicitFlag,
|
||||
"-XX:+PrintFlagsFinal",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -38,7 +38,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
public class TestInvalidJVMCIOption {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+EagerJVMCI",
|
||||
"-XX:+UseJVMCICompiler",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -42,7 +42,7 @@ public class TestJVMCIPrintProperties {
|
||||
}
|
||||
|
||||
static void test(String enableFlag) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
enableFlag, "-Djvmci.Compiler=null",
|
||||
"-XX:+JVMCIPrintProperties");
|
||||
|
@ -45,7 +45,7 @@ public class TestJVMCISavedProperties {
|
||||
System.out.println("DONE IN MAIN");
|
||||
return;
|
||||
}
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+EagerJVMCI",
|
||||
"-XX:+UseJVMCICompiler",
|
||||
|
@ -83,7 +83,7 @@ public class TestUncaughtErrorInCompileMethod extends JVMCIServiceLocator {
|
||||
}
|
||||
|
||||
static void testSubprocess(boolean fatalError) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UseJVMCICompiler", "-Djvmci.Compiler=ErrorCompiler",
|
||||
"-XX:-TieredCompilation",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -63,7 +63,7 @@ public class GetFlagValueTest {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+EnableJVMCI",
|
||||
"-XX:+PrintFlagsFinal",
|
||||
|
@ -167,7 +167,7 @@ public class TestHotSpotJVMCIRuntime {
|
||||
}
|
||||
String[] names = {"translate", "attachCurrentThread", "registerNativeMethods"};
|
||||
for (String name : names) {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+EnableJVMCI",
|
||||
"-XX:-UseJVMCICompiler",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2023, 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
|
||||
@ -146,7 +146,7 @@ public class TestVMProcess {
|
||||
}
|
||||
|
||||
private void start() {
|
||||
ProcessBuilder process = ProcessTools.createJavaProcessBuilder(cmds);
|
||||
ProcessBuilder process = ProcessTools.createLimitedTestJavaProcessBuilder(cmds);
|
||||
try {
|
||||
// Calls 'main' of TestVM to run all specified tests with commands 'cmds'.
|
||||
// Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -41,7 +41,7 @@ public class TestLinkageErrorInGenerateOopMap {
|
||||
public static void main(String args[]) throws Exception {
|
||||
if (args.length == 0) {
|
||||
// Spawn new VM instance to execute test
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:-BytecodeVerificationRemote",
|
||||
"-XX:-BytecodeVerificationLocal",
|
||||
|
@ -37,7 +37,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
public class CheckLoopStripMiningIterShortLoop {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version");
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version");
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
|
@ -94,7 +94,7 @@ public class TestNoWarningLoopStripMiningIterSet {
|
||||
System.arraycopy(args, 0, cmds, 1, args.length);
|
||||
cmds[args.length + 1] = "-XX:+PrintFlagsFinal";
|
||||
cmds[args.length + 2] = "-version";
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(cmds);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(cmds);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2016 Azul Systems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -43,7 +43,7 @@ public class TestOnSpinWait {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Test C2 compiler
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:-TieredCompilation", "-Xbatch",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions",
|
||||
|
@ -71,7 +71,7 @@ public class TestOnSpinWaitAArch64 {
|
||||
command.add("-XX:CompileCommand=compileonly," + Launcher.class.getName() + "::" + "test");
|
||||
command.add(Launcher.class.getName());
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -87,9 +87,9 @@ public class TestOnSpinWaitAArch64DefaultFlags {
|
||||
final String cpuModel = cpuFeatures.get(0);
|
||||
|
||||
if (isCPUModelNeoverseN1(cpuModel)) {
|
||||
checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"),
|
||||
checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:+PrintFlagsFinal", "-version"),
|
||||
"isb", "1");
|
||||
checkFinalFlagsEqualTo(ProcessTools.createJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"),
|
||||
checkFinalFlagsEqualTo(ProcessTools.createLimitedTestJavaProcessBuilder("-XX:+UnlockDiagnosticVMOptions", "-XX:OnSpinWaitInstCount=2", "-XX:+PrintFlagsFinal", "-version"),
|
||||
"isb", "2");
|
||||
} else {
|
||||
System.out.println("Skip because no defaults for CPU model: " + cpuModel);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright 2016 Azul Systems, Inc. All Rights Reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -45,7 +45,7 @@ public class TestOnSpinWaitC1 {
|
||||
public static void main(String[] args) throws Exception {
|
||||
|
||||
// Test C1 compiler
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-XX:+IgnoreUnrecognizedVMOptions", "-showversion",
|
||||
"-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-Xbatch",
|
||||
"-XX:+PrintCompilation", "-XX:+UnlockDiagnosticVMOptions",
|
||||
|
@ -54,7 +54,7 @@ public class TestOnSpinWaitNoneAArch64 {
|
||||
command.add(Launcher.class.getName());
|
||||
|
||||
// Test C2 compiler
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -64,7 +64,7 @@ public class TestOnSpinWaitRISCV64 {
|
||||
command.add("-Xbatch");
|
||||
command.add(Launcher.class.getName());
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(command);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -251,7 +251,7 @@ public class CheckCompileCommandOption {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
for (String expected_output : expected_outputs) {
|
||||
@ -266,7 +266,7 @@ public class CheckCompileCommandOption {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
out.shouldContain("CompileCommand: An error occurred during parsing");
|
||||
@ -277,7 +277,7 @@ public class CheckCompileCommandOption {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
for (String expected_output : expected_outputs) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2023, 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
|
||||
@ -56,7 +56,7 @@ public class TestCompileCommand {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
for (String expected_output : expected_outputs) {
|
||||
|
@ -83,7 +83,7 @@ public class TestInvalidCompileCommand {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder(arguments);
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder(arguments);
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
|
||||
for (String expected_output : expected_outputs) {
|
||||
|
@ -81,7 +81,7 @@ public class TestRangeCheckHoistingScaledIV {
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"--add-modules", "jdk.incubator.vector",
|
||||
"-Xbatch", "-XX:+TraceLoopPredicate", Launcher.class.getName());
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -30,7 +30,7 @@ public class Driver8015436 {
|
||||
public static void main(String args[]) {
|
||||
OutputAnalyzer oa;
|
||||
try {
|
||||
oa = ProcessTools.executeProcess(ProcessTools.createTestJvm(
|
||||
oa = ProcessTools.executeProcess(ProcessTools.createTestJavaProcessBuilder(
|
||||
Test8015436.class.getName()));
|
||||
} catch (Exception ex) {
|
||||
throw new Error("TESTBUG: exception while running child process: " + ex, ex);
|
||||
|
@ -67,7 +67,7 @@ public class SharedStubToInterpTest {
|
||||
command.add("-XX:CompileCommand=dontinline," + testClassName + "::" + "log02");
|
||||
command.add(testClassName);
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(command);
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(command);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -60,7 +60,7 @@ public class SharedTrampolineTest {
|
||||
command.add(testClassName);
|
||||
command.add("a");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(command);
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(command);
|
||||
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -42,7 +42,7 @@ import jdk.test.lib.process.ProcessTools;
|
||||
public class NumCompilerThreadsCheck {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:CICompilerCount=-1");
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:CICompilerCount=-1");
|
||||
OutputAnalyzer out = new OutputAnalyzer(pb.start());
|
||||
|
||||
String expectedOutput = "outside the allowed range";
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -44,7 +44,7 @@ import static jdk.test.lib.Asserts.assertTrue;
|
||||
|
||||
public class SmallCodeCacheStartup {
|
||||
public static void main(String[] args) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m",
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:ReservedCodeCacheSize=3m",
|
||||
"-XX:CICompilerCount=64",
|
||||
"-Xcomp",
|
||||
"-version");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -43,12 +43,12 @@ public class StartupOutput {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:+DisplayVMOutputToStdout", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
out.shouldNotContain("no space to run compilers");
|
||||
out.shouldHaveExitValue(0);
|
||||
|
||||
pb = ProcessTools.createJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version");
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xint", "-XX:ReservedCodeCacheSize=1770K", "-XX:InitialCodeCacheSize=4K", "-version");
|
||||
out = new OutputAnalyzer(pb.start());
|
||||
// The VM should not crash but may return an error message because we don't have enough space for adapters
|
||||
int exitCode = out.getExitValue();
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -63,7 +63,7 @@ public class RTMTestBase {
|
||||
public static OutputAnalyzer executeRTMTest(CompilableTest test,
|
||||
String... options) throws Exception {
|
||||
ProcessBuilder processBuilder
|
||||
= ProcessTools.createJavaProcessBuilder(
|
||||
= ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
RTMTestBase.prepareTestOptions(test, options));
|
||||
OutputAnalyzer outputAnalyzer
|
||||
= new OutputAnalyzer(processBuilder.start());
|
||||
@ -83,7 +83,7 @@ public class RTMTestBase {
|
||||
public static OutputAnalyzer executeRTMTest(String logFileName,
|
||||
CompilableTest test, String... options) throws Exception {
|
||||
ProcessBuilder processBuilder
|
||||
= ProcessTools.createJavaProcessBuilder(
|
||||
= ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
RTMTestBase.prepareTestOptions(logFileName, test, options));
|
||||
OutputAnalyzer outputAnalyzer
|
||||
= new OutputAnalyzer(processBuilder.start());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -86,7 +86,7 @@ public class OffTest {
|
||||
OPTIONS[TYPE_PROFILE_INDEX] = typeProfileLevel;
|
||||
OPTIONS[USE_TYPE_SPECULATION_INDEX] = useTypeSpeculation;
|
||||
OPTIONS[PROFILING_TYPE_INDEX] = type.name();
|
||||
ProcessBuilder processBuilder = ProcessTools.createTestJvm(OPTIONS);
|
||||
ProcessBuilder processBuilder = ProcessTools.createTestJavaProcessBuilder(OPTIONS);
|
||||
OutputAnalyzer outputAnalyzer = new OutputAnalyzer(processBuilder.start());
|
||||
outputAnalyzer.shouldHaveExitValue(0);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2023, 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
|
||||
@ -224,7 +224,7 @@ public class TestBufferVectorization {
|
||||
ProcessBuilder pb;
|
||||
OutputAnalyzer out;
|
||||
try {
|
||||
pb = ProcessTools.createJavaProcessBuilder("-XX:-BackgroundCompilation",
|
||||
pb = ProcessTools.createLimitedTestJavaProcessBuilder("-XX:-BackgroundCompilation",
|
||||
"-XX:+TraceNewVectors",
|
||||
"compiler.vectorization.TestBufferVectorization",
|
||||
testName,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -67,7 +67,7 @@ public class PlainRead {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
WhiteBox wb = WhiteBox.getWhiteBox();
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder("-Xlog:os+container=trace", "-version");
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder("-Xlog:os+container=trace", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
if (wb.isContainerized()) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -66,7 +66,7 @@ public class TestAgeOutput {
|
||||
}
|
||||
|
||||
public static void runTest(String gcArg) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-Xbootclasspath/a:.",
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -36,7 +36,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class TestAllocateHeapAt {
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"-XX:AllocateHeapAt=" + System.getProperty("test.dir", "."),
|
||||
"-Xlog:gc+heap=info",
|
||||
"-Xmx32m",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -45,7 +45,7 @@ public class TestAllocateHeapAtError {
|
||||
f = new File(test_dir, UUID.randomUUID().toString());
|
||||
} while(f.exists());
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"-XX:AllocateHeapAt=" + f.getName(),
|
||||
"-Xlog:gc+heap=info",
|
||||
"-Xmx32m",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2023, 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
|
||||
@ -60,7 +60,7 @@ public class TestAllocateHeapAtMultiple {
|
||||
"-Xlog:gc+heap=info",
|
||||
"-version"});
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(flags);
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(flags);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
System.out.println("Output:\n" + output.getOutput());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -42,7 +42,7 @@ public class TestCardTablePageCommits {
|
||||
// because of 8kB pages, assume 4 KB pages for all other CPUs.
|
||||
String Xmx = "-Xmx4m";
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
Xmx,
|
||||
"-XX:NativeMemoryTracking=detail",
|
||||
"-XX:+UseParallelGC",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -58,7 +58,7 @@ public class TestNumWorkerOutput {
|
||||
}
|
||||
|
||||
public static void runTest(String gcArg) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
"-Xbootclasspath/a:.",
|
||||
"-XX:+UnlockExperimentalVMOptions",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2023, 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
|
||||
@ -48,7 +48,7 @@ public class TestPLABAdaptToMinTLABSize {
|
||||
Collections.addAll(testArguments, extraArgs);
|
||||
testArguments.add("-version");
|
||||
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(testArguments);
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(testArguments);
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -96,7 +96,7 @@ public class TestSmallHeap {
|
||||
|
||||
private static void verifySmallHeapSize(String gc, long expectedMaxHeap) throws Exception {
|
||||
long minMaxHeap = 4 * 1024 * 1024;
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(
|
||||
gc,
|
||||
"-Xmx" + minMaxHeap,
|
||||
"-XX:+PrintFlagsFinal",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2013, 2023, 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
|
||||
@ -37,7 +37,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
|
||||
public class TestVerifyDuringStartup {
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = ProcessTools.createTestJvm(
|
||||
ProcessBuilder pb = ProcessTools.createTestJavaProcessBuilder(
|
||||
"-XX:-UseTLAB",
|
||||
"-XX:+UnlockDiagnosticVMOptions",
|
||||
"-XX:+VerifyDuringStartup",
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2023, 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
|
||||
@ -57,7 +57,7 @@ public class TestVerifySilently {
|
||||
"-XX:+VerifyAfterGC",
|
||||
(verifySilently ? "-Xlog:gc":"-Xlog:gc+verify=debug"),
|
||||
TestVerifySilentlyRunSystemGC.class.getName()});
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
System.out.println("Output:\n" + output.getOutput());
|
||||
|
@ -59,7 +59,7 @@ public class TestVerifySubSet {
|
||||
"-Xlog:gc+verify=debug",
|
||||
"-XX:VerifySubSet="+subset,
|
||||
TestVerifySubSetRunSystemGC.class.getName()});
|
||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(vmOpts);
|
||||
ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(vmOpts);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
System.out.println("Output:\n" + output.getOutput());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2023, 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
|
||||
@ -66,19 +66,19 @@ public final class GCArguments {
|
||||
return augmented.toArray(new String[augmented.size()]);
|
||||
}
|
||||
|
||||
static public ProcessBuilder createJavaProcessBuilder(List<String> arguments) {
|
||||
return createJavaProcessBuilder(arguments.toArray(String[]::new));
|
||||
static public ProcessBuilder createLimitedTestJavaProcessBuilder(List<String> arguments) {
|
||||
return createLimitedTestJavaProcessBuilder(arguments.toArray(String[]::new));
|
||||
}
|
||||
|
||||
static public ProcessBuilder createJavaProcessBuilder(String... arguments) {
|
||||
return ProcessTools.createJavaProcessBuilder(withDefaults(arguments));
|
||||
static public ProcessBuilder createLimitedTestJavaProcessBuilder(String... arguments) {
|
||||
return ProcessTools.createLimitedTestJavaProcessBuilder(withDefaults(arguments));
|
||||
}
|
||||
|
||||
static public ProcessBuilder createTestJvm(List<String> arguments) {
|
||||
return createTestJvm(arguments.toArray(String[]::new));
|
||||
static public ProcessBuilder createTestJavaProcessBuilder(List<String> arguments) {
|
||||
return createTestJavaProcessBuilder(arguments.toArray(String[]::new));
|
||||
}
|
||||
|
||||
static public ProcessBuilder createTestJvm(String... arguments) {
|
||||
return ProcessTools.createTestJvm(withDefaults(arguments));
|
||||
static public ProcessBuilder createTestJavaProcessBuilder(String... arguments) {
|
||||
return ProcessTools.createTestJavaProcessBuilder(withDefaults(arguments));
|
||||
}
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class TestAggressiveHeap {
|
||||
" *bool +UseParallelGC *= *true +\\{product\\} *\\{command line\\}";
|
||||
|
||||
private static void testFlag() throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(
|
||||
option, heapSizeOption, "-XX:+PrintFlagsFinal", "-version");
|
||||
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
@ -51,7 +51,7 @@ public class TestCompressedClassFlags {
|
||||
}
|
||||
|
||||
private static OutputAnalyzer runJava(String ... args) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(args);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(args);
|
||||
return new OutputAnalyzer(pb.start());
|
||||
}
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
public class TestDisableDefaultGC {
|
||||
public static void main(String[] args) throws Exception {
|
||||
// Start VM, disabling all possible default GCs
|
||||
ProcessBuilder pb = GCArguments.createTestJvm("-XX:-UseSerialGC",
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:-UseSerialGC",
|
||||
"-XX:-UseParallelGC",
|
||||
"-XX:-UseG1GC",
|
||||
"-XX:-UseZGC",
|
||||
|
@ -78,7 +78,7 @@ public class TestG1ConcMarkStepDurationMillis {
|
||||
|
||||
Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:G1ConcMarkStepDurationMillis="+expectedValue, "-XX:+PrintFlagsFinal", "-version");
|
||||
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(vmOpts);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
output.shouldHaveExitValue(expectedResult == PASS ? 0 : 1);
|
||||
|
@ -69,7 +69,7 @@ public class TestG1ConcRefinementThreads {
|
||||
}
|
||||
Collections.addAll(vmOpts, "-XX:+UseG1GC", "-XX:+PrintFlagsFinal", "-version");
|
||||
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(vmOpts);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(vmOpts);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
|
||||
output.shouldHaveExitValue(0);
|
||||
|
@ -53,7 +53,7 @@ public class TestG1HeapRegionSize {
|
||||
flagList.add("-XX:+PrintFlagsFinal");
|
||||
flagList.add("-version");
|
||||
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(flagList);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flagList);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(exitValue);
|
||||
|
||||
|
@ -63,7 +63,7 @@ public class TestG1PercentageOptions {
|
||||
};
|
||||
|
||||
private static void check(String flag, boolean is_valid) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm("-XX:+UseG1GC", flag, "-version");
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder("-XX:+UseG1GC", flag, "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
if (is_valid) {
|
||||
output.shouldHaveExitValue(0);
|
||||
|
@ -48,7 +48,7 @@ public class TestG1RemSetFlags {
|
||||
flagList.add("-XX:+PrintFlagsFinal");
|
||||
flagList.add("-version");
|
||||
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(flagList);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flagList);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(exitValue);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class TestHeapFreeRatio {
|
||||
}
|
||||
|
||||
private static void testMinMaxFreeRatio(String min, String max, Validation type) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(
|
||||
"-Xminf" + min,
|
||||
"-Xmaxf" + max,
|
||||
"-version");
|
||||
|
@ -41,7 +41,7 @@ import jdk.test.lib.process.OutputAnalyzer;
|
||||
public class TestInitialTenuringThreshold {
|
||||
|
||||
public static void runWithThresholds(int initial, int max, boolean shouldfail) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(
|
||||
"-XX:+UseParallelGC",
|
||||
"-XX:InitialTenuringThreshold=" + String.valueOf(initial),
|
||||
"-XX:MaxTenuringThreshold=" + String.valueOf(max),
|
||||
@ -58,7 +58,7 @@ public class TestInitialTenuringThreshold {
|
||||
|
||||
|
||||
public static void main(String args[]) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(
|
||||
// some value below the default value of InitialTenuringThreshold of 7
|
||||
"-XX:+UseParallelGC",
|
||||
"-XX:MaxTenuringThreshold=1",
|
||||
|
@ -115,7 +115,7 @@ class TestMaxHeapSizeTools {
|
||||
}
|
||||
|
||||
private static void getNewOldSize(String gcflag, long[] values) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(gcflag,
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(gcflag,
|
||||
"-XX:+PrintFlagsFinal", "-version");
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
@ -208,7 +208,7 @@ class TestMaxHeapSizeTools {
|
||||
finalargs.add(classname);
|
||||
finalargs.addAll(Arrays.asList(arguments));
|
||||
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(finalargs.toArray(String[]::new));
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(finalargs.toArray(String[]::new));
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
output.shouldHaveExitValue(0);
|
||||
|
||||
@ -308,7 +308,7 @@ class TestMaxHeapSizeTools {
|
||||
}
|
||||
|
||||
private static void expect(String[] flags, boolean hasWarning, boolean hasError, int errorcode) throws Exception {
|
||||
ProcessBuilder pb = GCArguments.createTestJvm(flags);
|
||||
ProcessBuilder pb = GCArguments.createTestJavaProcessBuilder(flags);
|
||||
OutputAnalyzer output = new OutputAnalyzer(pb.start());
|
||||
shouldContainOrNot(output, hasWarning, "Warning");
|
||||
shouldContainOrNot(output, hasError, "Error");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2016, 2023, 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
|
||||
@ -98,7 +98,7 @@ public class TestMaxMinHeapFreeRatioFlags {
|
||||
Boolean.toString(shrinkHeapInSteps)
|
||||
);
|
||||
|
||||
ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions);
|
||||
ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions);
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start());
|
||||
analyzer.shouldHaveExitValue(0);
|
||||
}
|
||||
@ -123,7 +123,7 @@ public class TestMaxMinHeapFreeRatioFlags {
|
||||
"--add-exports=java.base/jdk.internal.misc=ALL-UNNAMED",
|
||||
"-version"
|
||||
);
|
||||
ProcessBuilder procBuilder = GCArguments.createJavaProcessBuilder(vmOptions);
|
||||
ProcessBuilder procBuilder = GCArguments.createLimitedTestJavaProcessBuilder(vmOptions);
|
||||
OutputAnalyzer analyzer = new OutputAnalyzer(procBuilder.start());
|
||||
analyzer.shouldHaveExitValue(1);
|
||||
analyzer.shouldContain("Error: Could not create the Java Virtual Machine.");
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user