Skip to content

Commit fb69a90

Browse files
committed
fixed test failure on Windows
1 parent f428172 commit fb69a90

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ static void parse(CompilerToVM compilerToVm) {
407407
msg.format("%nError: A fatal exception has occurred. Program will exit.%n");
408408
byte[] msgBytes = msg.toString().getBytes();
409409
compilerToVm.writeDebugOutput(msgBytes, 0, msgBytes.length, true, true);
410-
compilerToVm.callSystemExit(-1);
410+
compilerToVm.callSystemExit(1);
411411
} else if (value instanceof Option) {
412412
Option option = (Option) value;
413413
option.init(e.getValue());

test/hotspot/jtreg/compiler/jvmci/TestInvalidJVMCIOption.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ public static void main(String[] args) throws Exception {
4242
"-XX:+UseJVMCICompiler",
4343
"-Djvmci.XXXXXXXXX=true");
4444
OutputAnalyzer output = new OutputAnalyzer(pb.start());
45-
output.shouldMatch("Error parsing JVMCI options: Could not find option jvmci.XXXXXXXXX" + System.lineSeparator() +
46-
"Error: A fatal exception has occurred. Program will exit." + System.lineSeparator());
47-
output.shouldHaveExitValue(255);
45+
String expectStdout = String.format(
46+
"Error parsing JVMCI options: Could not find option jvmci.XXXXXXXXX%n" +
47+
"Error: A fatal exception has occurred. Program will exit.%n");
48+
String actualStdout = output.getStdout();
49+
if (!actualStdout.equals(expectStdout)) {
50+
throw new RuntimeException(String.format("Invalid STDOUT:%nExpect:%n%s%nActual:%n%s", expectStdout, actualStdout));
51+
}
52+
if (!output.getStderr().isEmpty()) {
53+
throw new RuntimeException("STDERR was not empty: " + output.getStderr());
54+
}
55+
output.shouldHaveExitValue(1);
4856
}
4957
}

0 commit comments

Comments
 (0)