aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/test/java/com/google/devtools/build/lib/testutil/FoundationTestCase.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/FoundationTestCase.java b/src/test/java/com/google/devtools/build/lib/testutil/FoundationTestCase.java
index 56773d4dac..8f480f88f2 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/FoundationTestCase.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/FoundationTestCase.java
@@ -157,6 +157,14 @@ public abstract class FoundationTestCase extends TestCase {
}
/**
+ * Create a scratch directory in the scratch filesystem, with the given pathName. The method
+ * returns a Path instance for the scratch directory.
+ */
+ protected Path scratchDir(String pathName) throws IOException {
+ return scratch.dir(workspaceRelative(pathName));
+ }
+
+ /**
* Like {@code scratchFile}, but the file is first deleted if it already
* exists.
*/