Skip to content

8321713: Harmonize executeTestJvm with create[Limited]TestJavaProcessBuilder #3495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/hotspot/jtreg/compiler/c2/Test8062950.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@
public class Test8062950 {
private static final String CLASSNAME = "DoesNotExist";
public static void main(String[] args) throws Exception {
ProcessTools.executeTestJvm("-Xcomp",
"-XX:-TieredCompilation",
"-XX:-UseOptoBiasInlining",
CLASSNAME)
ProcessTools.executeTestJava("-Xcomp",
"-XX:-TieredCompilation",
"-XX:-UseOptoBiasInlining",
CLASSNAME)
.shouldHaveExitValue(1)
.shouldContain("Error: Could not find or load main class " + CLASSNAME)
.shouldNotContain("A fatal error has been detected")
Expand Down
2 changes: 1 addition & 1 deletion test/hotspot/jtreg/compiler/c2/cr7200264/TestDriver.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void run() throws Throwable {
}

private List<String> executeApplication() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
"-Xbatch",
"-XX:-TieredCompilation",
"-XX:+PrintCompilation",
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/ciReplay/CiReplayBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ static void test(int i) {

static {
try {
CLIENT_VM_AVAILABLE = ProcessTools.executeTestJvm(CLIENT_VM_OPTION, VERSION_OPTION)
CLIENT_VM_AVAILABLE = ProcessTools.executeTestJava(CLIENT_VM_OPTION, VERSION_OPTION)
.getOutput().contains("Client");
SERVER_VM_AVAILABLE = ProcessTools.executeTestJvm(SERVER_VM_OPTION, VERSION_OPTION)
SERVER_VM_AVAILABLE = ProcessTools.executeTestJava(SERVER_VM_OPTION, VERSION_OPTION)
.getOutput().contains("Server");
} catch(Throwable t) {
throw new Error("Initialization failed: " + t, t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,49 +36,49 @@

public class OptionTest {
public static void main(String[] args) throws Exception {
ProcessTools.executeTestJvm("-XX:CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,package/class,ccstrlist,ControlIntrinsic,+_id", "-version")
.shouldHaveExitValue(0)
.shouldContain("CompileCommand: An error occurred during parsing")
.shouldContain("Error: Did not specify any method name")
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

ProcessTools.executeTestJvm("-XX:CompileCommand=option,*,ccstrlist,ControlIntrinsic,+_id", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,*,ccstrlist,ControlIntrinsic,+_id", "-version")
.shouldHaveExitValue(0)
.shouldContain("CompileCommand: An error occurred during parsing")
.shouldContain("Error: Did not specify any method name")
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

// corner case:
// ccstrlist could be a valid method name, so it is accepted in the well-formed case.
ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.ccstrlist,ccstrlist,ControlIntrinsic,+_id", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,*.ccstrlist,ccstrlist,ControlIntrinsic,+_id", "-version")
.shouldContain("CompileCommand: ControlIntrinsic *.ccstrlist const char* ControlIntrinsic")
.shouldHaveExitValue(0)
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

ProcessTools.executeTestJvm("-XX:CompileCommand=option,*.*,ccstrlist,ControlIntrinsic,+_id", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,*.*,ccstrlist,ControlIntrinsic,+_id", "-version")
.shouldContain("CompileCommand: ControlIntrinsic *.* const char* ControlIntrinsic")
.shouldHaveExitValue(0)
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

ProcessTools.executeTestJvm("-XX:CompileCommand=option,class,PrintIntrinsics", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,class,PrintIntrinsics", "-version")
.shouldHaveExitValue(0)
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

// corner case:
// PrintIntrinsics could be a valid method name, so it is accepted in the well-formed case.
ProcessTools.executeTestJvm("-XX:CompileCommand=option,class.PrintIntrinsics,PrintIntrinsics", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=option,class.PrintIntrinsics,PrintIntrinsics", "-version")
.shouldContain("CompileCommand: PrintIntrinsics class.PrintIntrinsics bool PrintIntrinsics = true")
.shouldHaveExitValue(0)
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

// corner case:
// _dontinline_* is a valid method pattern, so it should be accepted
ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*::dontinline_*", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=dontinline,*::dontinline_*", "-version")
.shouldContain("CompileCommand: dontinline *.dontinline_* bool dontinline = true")
.shouldHaveExitValue(0)
.shouldNotContain("# A fatal error has been detected by the Java Runtime Environment");

ProcessTools.executeTestJvm("-XX:CompileCommand=dontinline,*.dontinline", "-version")
ProcessTools.executeTestJava("-XX:CompileCommand=dontinline,*.dontinline", "-version")
.shouldContain("CompileCommand: dontinline *.dontinline bool dontinline = true")
.shouldHaveExitValue(0)
.shouldNotContain("Error: Did not specify any method name")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private static List<String> getRandomDescriptors(
protected static OutputAnalyzer execute(String fileName) {
OutputAnalyzer output;
try {
output = ProcessTools.executeTestJvm(
output = ProcessTools.executeTestJava(
"-XX:+UnlockDiagnosticVMOptions",
"-XX:CompilerDirectivesLimit=1000",
"-XX:CompilerDirectivesFile=" + fileName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static void main(String[] args) throws Exception {
}

public static void test(String compileOnlyCommand) throws Exception {
OutputAnalyzer output = ProcessTools.executeTestJvm("-XX:CompileOnly=" + compileOnlyCommand, "-version");
OutputAnalyzer output = ProcessTools.executeTestJava("-XX:CompileOnly=" + compileOnlyCommand, "-version");
output.shouldHaveExitValue(0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public List<OutputAnalyzer> execute() {
vmInputArgs.length + vmOptions.size());
System.arraycopy(vmOptions.toArray(), 0, cmds, vmInputArgs.length,
vmOptions.size());
output = ProcessTools.executeTestJvm(cmds);
output = ProcessTools.executeTestJava(cmds);
} catch (Throwable thr) {
throw new Error("Execution failed: " + thr.getMessage(), thr);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private boolean isTieredLevelGreaterThan(int level) {
* @throws Throwable
*/
private void testUseAES() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
.USE_AES, true)));
final String errorMessage = "Case testUseAES failed";
Expand Down Expand Up @@ -103,7 +103,7 @@ private void testUseAES() throws Throwable {
*/
private void testUseAESUseSSE2() throws Throwable {
if (Platform.isX86() || Platform.isX64()) {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
.USE_AES_INTRINSICS, true),
prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2)));
Expand Down Expand Up @@ -132,7 +132,7 @@ private void testUseAESUseSSE2() throws Throwable {
*/
private void testNoUseAESUseSSE2() throws Throwable {
if (Platform.isX86() || Platform.isX64()) {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
.USE_AES, false),
prepareNumericFlag(AESIntrinsicsBase.USE_SSE, 2)));
Expand All @@ -158,7 +158,7 @@ private void testNoUseAESUseSSE2() throws Throwable {
* @throws Throwable
*/
private void testNoUseAES() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
.USE_AES, false)));
final String errorMessage = "Case testNoUseAES failed";
Expand All @@ -180,7 +180,7 @@ private void testNoUseAES() throws Throwable {
* @throws Throwable
*/
private void testNoUseAESIntrinsic() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
prepareArguments(prepareBooleanFlag(AESIntrinsicsBase
.USE_AES_INTRINSICS, false)));
final String errorMessage = "Case testNoUseAESIntrinsic failed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected void runTestCases() throws Throwable {
* @throws Throwable
*/
private void testUseAESIntrinsics() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
AESIntrinsicsBase.prepareArguments(prepareBooleanFlag(
AESIntrinsicsBase.USE_AES_INTRINSICS, true)));
final String errorMessage = "Case testUseAESIntrinsics failed";
Expand All @@ -89,7 +89,7 @@ private void testUseAESIntrinsics() throws Throwable {
* @throws Throwable
*/
private void testUseAES() throws Throwable {
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(
AESIntrinsicsBase.prepareArguments(prepareBooleanFlag
(AESIntrinsicsBase.USE_AES, true)));
final String errorMessage = "Case testUseAES failed";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class TestMembarDependencies {
public static void main(String args[]) throws Exception {
if (args.length == 0) {
// For debugging, add "-XX:+TraceOptoPipelining"
OutputAnalyzer oa = ProcessTools.executeTestJvm("-XX:+IgnoreUnrecognizedVMOptions",
OutputAnalyzer oa = ProcessTools.executeTestJava("-XX:+IgnoreUnrecognizedVMOptions",
"-XX:-TieredCompilation", "-XX:-BackgroundCompilation", "-XX:+PrintOpto",
"-XX:CompileCommand=compileonly,compiler.membars.TestMembarDependencies::test*",
"-XX:CompileCommand=dontinline,compiler.membars.TestMembarDependencies::test_m1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static OutputAnalyzer runTest(Class<? extends Expr> expr,
new Integer(iterations).toString()
});

OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJvm(vmOpts);
OutputAnalyzer outputAnalyzer = ProcessTools.executeTestJava(vmOpts);

outputAnalyzer.shouldHaveExitValue(0);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private void prepareVMFlags(Class<?> testClass, List<String> additionalFlags) {
private void start() {
try {
// Run "flag" VM with White Box access to determine the test VM flags and if IR verification should be done.
oa = ProcessTools.executeTestJvm(cmds);
oa = ProcessTools.executeTestJava(cmds);
} catch (Exception e) {
throw new TestRunException("Failed to execute TestFramework flag VM", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private void start() {
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
// Use executeProcess instead of executeTestJava as we have already added the JTreg VM and
// Java options in prepareTestVMFlags().
oa = ProcessTools.executeProcess(process);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ public static void main (String args[]) {
private static void check(boolean enabled) {
OutputAnalyzer oa;
try {
oa = ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions", "-Xbootclasspath/a:.",
"-XX:" + (enabled ? "+" : "-") + "UseCountedLoopSafepoints",
"-XX:+WhiteBoxAPI",
oa = ProcessTools.executeTestJava(
"-XX:+UnlockDiagnosticVMOptions", "-Xbootclasspath/a:.",
"-XX:" + (enabled ? "+" : "-") + "UseCountedLoopSafepoints",
"-XX:+WhiteBoxAPI",
"-XX:-Inline", "-Xbatch", "-XX:+PrintIdeal", "-XX:LoopUnrollLimit=0",
"-XX:CompileOnly=" + UseCountedLoopSafepoints.class.getName() + "::testMethod",
UseCountedLoopSafepoints.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

public class CheckLoopStripMining {
public static void main(String args[]) throws Exception {
ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions",
ProcessTools.executeTestJava("-XX:+UnlockDiagnosticVMOptions",
// to prevent biased locking handshakes from changing the timing of this test
"-XX:-UseBiasedLocking",
"-XX:+SafepointTimeout",
Expand All @@ -56,7 +56,7 @@ public static void main(String args[]) throws Exception {
.shouldHaveExitValue(0)
.stdoutShouldContain("sum: 715827882");

ProcessTools.executeTestJvm("-XX:+UnlockDiagnosticVMOptions",
ProcessTools.executeTestJava("-XX:+UnlockDiagnosticVMOptions",
// to prevent biased locking handshakes from changing the timing of this test
"-XX:-UseBiasedLocking",
"-XX:+SafepointTimeout",
Expand Down
4 changes: 2 additions & 2 deletions test/hotspot/jtreg/compiler/runtime/TestConstantsInError.java
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ static void run(TestConstantsInError test) throws Exception {
c1Args.addAll(List.of("-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-XX:+TracePatching"));
c1Args.addAll(commonArgs);

OutputAnalyzer outputC1 = ProcessTools.executeTestJvm(c1Args)
OutputAnalyzer outputC1 = ProcessTools.executeTestJava(c1Args)
.shouldHaveExitValue(0);

test.process(outputC1, true);
Expand All @@ -268,7 +268,7 @@ static void run(TestConstantsInError test) throws Exception {
c2Args.add("-XX:-TieredCompilation");
c2Args.addAll(commonArgs);

OutputAnalyzer outputC2 = ProcessTools.executeTestJvm(c2Args)
OutputAnalyzer outputC2 = ProcessTools.executeTestJava(c2Args)
.shouldHaveExitValue(0);

test.process(outputC2, false);
Expand Down
14 changes: 7 additions & 7 deletions test/hotspot/jtreg/compiler/vectorapi/TestVectorErgonomics.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,42 +37,42 @@
public class TestVectorErgonomics {

public static void main(String[] args) throws Throwable {
ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorReboxing=true");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorAggressiveReboxing=true");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-XX:+EnableVectorReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
.shouldContain("EnableVectorReboxing=false")
.shouldContain("EnableVectorAggressiveReboxing=false");

ProcessTools.executeTestJvm("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
ProcessTools.executeTestJava("--add-modules=jdk.incubator.vector", "-XX:+UnlockExperimentalVMOptions",
"-XX:-EnableVectorSupport", "-XX:+EnableVectorAggressiveReboxing", "-Xlog:compilation", "-version")
.shouldHaveExitValue(0)
.shouldContain("EnableVectorSupport=false")
Expand Down
Loading