8212221: GraalUnitTestLauncher should generate MX_SUBPROCESS_COMMAND_FILE

Reviewed-by: dlong
This commit is contained in:
Ekaterina Pavlova 2018-11-13 12:52:37 -08:00
parent a2cc912565
commit d32fed965b
2 changed files with 10 additions and 6 deletions

View file

@ -164,20 +164,15 @@ compiler/stable/TestStableUShort.java 8204347 gener
# Graal unit tests # Graal unit tests
org.graalvm.compiler.core.test.CheckGraalInvariants 8205081 org.graalvm.compiler.core.test.CheckGraalInvariants 8205081
org.graalvm.compiler.core.test.inlining.PolymorphicInliningTest 8205081
org.graalvm.compiler.core.test.OptionsVerifierTest 8205081 org.graalvm.compiler.core.test.OptionsVerifierTest 8205081
org.graalvm.compiler.core.test.ProfilingInfoTest 8205081
org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081 org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081
org.graalvm.compiler.hotspot.test.HsErrLogTest 8205081
org.graalvm.compiler.hotspot.test.OptionsInFileTest 8205081
org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8205081
org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081 org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081
org.graalvm.compiler.replacements.test.classfile.RedefineIntrinsicTest 8205081
org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955 org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955
org.graalvm.compiler.core.test.CountedLoopTest 8211179 org.graalvm.compiler.core.test.CountedLoopTest 8211179
org.graalvm.compiler.debug.test.DebugContextTest 8203504 org.graalvm.compiler.debug.test.DebugContextTest 8203504
org.graalvm.compiler.hotspot.test.GraalOSRTest 8206947 org.graalvm.compiler.hotspot.test.GraalOSRTest 8206947
org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8213567 windows-all
org.graalvm.compiler.debug.test.TimerKeyTest 8213598 org.graalvm.compiler.debug.test.TimerKeyTest 8213598

View file

@ -31,6 +31,7 @@ import java.util.stream.Collectors;
import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.OutputAnalyzer;
import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.ProcessTools;
import jdk.test.lib.JDKToolFinder;
/* /*
* This is helper class used to run Graal unit tests. * This is helper class used to run Graal unit tests.
@ -262,6 +263,14 @@ public class GraalUnitTestLauncher {
ProcessBuilder javaPB = ProcessTools.createJavaProcessBuilder(true, ProcessBuilder javaPB = ProcessTools.createJavaProcessBuilder(true,
javaFlags.toArray(new String[javaFlags.size()])); javaFlags.toArray(new String[javaFlags.size()]));
// Some tests rely on MX_SUBPROCESS_COMMAND_FILE env variable which contains
// name of the file with java executable and java args used to launch the current process.
Path cmdFile = Files.createTempFile(Path.of(""), "mx_subprocess_", ".cmd");
Files.writeString(cmdFile, JDKToolFinder.getJDKTool("java") + System.lineSeparator());
Files.write(cmdFile, javaFlags, StandardOpenOption.APPEND);
javaPB.environment().put("MX_SUBPROCESS_COMMAND_FILE", cmdFile.toAbsolutePath().toString());
System.out.println("INFO: run command: " + String.join(" ", javaPB.command())); System.out.println("INFO: run command: " + String.join(" ", javaPB.command()));
OutputAnalyzer outputAnalyzer = new OutputAnalyzer(javaPB.start()); OutputAnalyzer outputAnalyzer = new OutputAnalyzer(javaPB.start());