Skip to content
Permalink
Browse files
8266184: a few compiler/debug tests don't check exit code
Reviewed-by: thartmann
  • Loading branch information
iignatev committed Apr 28, 2021
1 parent 7e3bc4c commit 19d3c451b89680cefa41fd18f9e9ba0624f56858
@@ -26,7 +26,6 @@
import java.nio.file.Paths;
import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.Asserts;

/*
* @test
@@ -58,7 +57,8 @@ public static void main(String[] args) throws Exception {
"-Xcomp", "-XX:-TieredCompilation", "-XX:+UnlockDiagnosticVMOptions",
"-XX:CompileOnly=" + className + "::sum", "-XX:+" + stressOpt,
"-XX:+LogCompilation", "-XX:LogFile=" + log, className, "10"};
ProcessTools.createJavaProcessBuilder(procArgs).start().waitFor();
new OutputAnalyzer(ProcessTools.createJavaProcessBuilder(procArgs).start())
.shouldHaveExitValue(0);
new OutputAnalyzer(Paths.get(log))
.shouldContain("stress_test seed");
} else {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2021, 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,6 +49,7 @@ static String cmTrace(String stressOpt, int stressSeed) throws Exception {
"-XX:StressSeed=" + stressSeed, className, "10"};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
// Extract the trace of our method (the last one after those of all
// mandatory stubs such as _new_instance_Java, etc.).
String [] traces = out.getStdout().split("\\R");
@@ -49,11 +49,12 @@ static String phaseTrace(String stressOption, String traceOption,
className, "10"};
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs);
OutputAnalyzer out = new OutputAnalyzer(pb.start());
out.shouldHaveExitValue(0);
return out.getStdout();
}

static String igvnTrace(int stressSeed) throws Exception {
return phaseTrace("StressIGVN", "TraceIterativeIGVN", stressSeed);
return phaseTrace("StressIGVN", "TraceIterativeGVN", stressSeed);
}

static String ccpTrace(int stressSeed) throws Exception {

1 comment on commit 19d3c45

@openjdk-notifier

This comment has been minimized.

Copy link

@openjdk-notifier openjdk-notifier bot commented on 19d3c45 Apr 28, 2021

Please sign in to comment.