src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java
--- a/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java Thu Jul 25 11:44:37 2019 -0700
+++ b/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java Thu Jul 25 17:35:58 2019 -0400
@@ -53,17 +53,18 @@
String[] extensions = new String[]{".cfg", ".bgv", ".graph-strings"};
EconomicMap<OptionKey<?>, Object> overrides = OptionValues.newOptionMap();
overrides.put(DebugOptions.DumpPath, dumpDirectoryPath.toString());
+ overrides.put(DebugOptions.PrintCFG, true);
overrides.put(DebugOptions.PrintGraph, PrintGraphTarget.File);
overrides.put(DebugOptions.PrintCanonicalGraphStrings, true);
overrides.put(DebugOptions.Dump, "*");
// Generate dump files.
test(new OptionValues(getInitialOptions(), overrides), "snippet");
- // Check that Ideal files got created, in the right place.
+ // Check that IGV files got created, in the right place.
checkForFiles(dumpDirectoryPath, extensions);
// Clean up the generated files.
- scrubDirectory(dumpDirectoryPath);
+ removeDirectory(dumpDirectoryPath);
}
/**
@@ -92,24 +93,4 @@
assertTrue(paths[0].equals(paths[i]), paths[0] + " != " + paths[i]);
}
}
-
- /**
- * Remove the temporary directory.
- */
- private static void scrubDirectory(Path directoryPath) {
- try {
- try (DirectoryStream<Path> stream = Files.newDirectoryStream(directoryPath)) {
- for (Path filePath : stream) {
- if (Files.isRegularFile(filePath)) {
- Files.delete(filePath);
- } else if (Files.isDirectory(filePath)) {
- scrubDirectory(filePath);
- }
- }
- }
- Files.delete(directoryPath);
- } catch (IOException ioe) {
- ioe.printStackTrace();
- }
- }
}