< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java

Print this page

        

*** 35,44 **** --- 35,45 ---- import java.io.IOException; import java.io.PrintStream; import java.util.List; import org.graalvm.compiler.core.test.GraalCompilerTest; + import org.graalvm.compiler.debug.DebugOptions.PrintGraphTarget; import org.graalvm.compiler.test.SubprocessUtil; import org.graalvm.compiler.test.SubprocessUtil.Subprocess; import org.junit.Assert; import org.junit.Test;
*** 52,78 **** String debugFilterValue = "a very unlikely debug scope"; File optionsFile = File.createTempFile("options", ".properties").getAbsoluteFile(); try { Assert.assertFalse(methodFilterValue.equals(MethodFilter.getDefaultValue())); Assert.assertFalse(debugFilterValue.equals(Dump.getDefaultValue())); ! Assert.assertTrue(PrintGraph.getDefaultValue()); try (PrintStream out = new PrintStream(new FileOutputStream(optionsFile))) { out.println(MethodFilter.getName() + "=" + methodFilterValue); out.println(Dump.getName() + "=" + debugFilterValue); ! out.println(PrintGraph.getName() + " = false"); } List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine()); vmArgs.removeIf(a -> a.startsWith("-Dgraal.")); vmArgs.add("-Dgraal.options.file=" + optionsFile); vmArgs.add("-XX:+JVMCIPrintProperties"); Subprocess proc = SubprocessUtil.java(vmArgs); String[] expected = { "graal.MethodFilter := \"a very unlikely method name\"", "graal.Dump := \"a very unlikely debug scope\"", ! "graal.PrintGraph := false"}; for (String line : proc.output) { for (int i = 0; i < expected.length; i++) { if (expected[i] != null && line.contains(expected[i])) { expected[i] = null; } --- 53,79 ---- String debugFilterValue = "a very unlikely debug scope"; File optionsFile = File.createTempFile("options", ".properties").getAbsoluteFile(); try { Assert.assertFalse(methodFilterValue.equals(MethodFilter.getDefaultValue())); Assert.assertFalse(debugFilterValue.equals(Dump.getDefaultValue())); ! Assert.assertEquals(PrintGraphTarget.File, PrintGraph.getDefaultValue()); try (PrintStream out = new PrintStream(new FileOutputStream(optionsFile))) { out.println(MethodFilter.getName() + "=" + methodFilterValue); out.println(Dump.getName() + "=" + debugFilterValue); ! out.println(PrintGraph.getName() + " = Network"); } List<String> vmArgs = withoutDebuggerArguments(getVMCommandLine()); vmArgs.removeIf(a -> a.startsWith("-Dgraal.")); vmArgs.add("-Dgraal.options.file=" + optionsFile); vmArgs.add("-XX:+JVMCIPrintProperties"); Subprocess proc = SubprocessUtil.java(vmArgs); String[] expected = { "graal.MethodFilter := \"a very unlikely method name\"", "graal.Dump := \"a very unlikely debug scope\"", ! "graal.PrintGraph := Network"}; for (String line : proc.output) { for (int i = 0; i < expected.length; i++) { if (expected[i] != null && line.contains(expected[i])) { expected[i] = null; }
< prev index next >