aboutsummaryrefslogtreecommitdiff
path: root/compiler/test/dotty/tools/dotc/ParallelTesting.scala
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/test/dotty/tools/dotc/ParallelTesting.scala')
-rw-r--r--compiler/test/dotty/tools/dotc/ParallelTesting.scala23
1 files changed, 17 insertions, 6 deletions
diff --git a/compiler/test/dotty/tools/dotc/ParallelTesting.scala b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
index 0cb6e8d7c..c9b9a8f64 100644
--- a/compiler/test/dotty/tools/dotc/ParallelTesting.scala
+++ b/compiler/test/dotty/tools/dotc/ParallelTesting.scala
@@ -479,6 +479,23 @@ trait ParallelTesting {
this
}
+ private def copyToDir(dir: JFile, file: JFile): JFile = {
+ val target = Paths.get(dir.getAbsolutePath, file.getName)
+ Files.copy(file.toPath, target, REPLACE_EXISTING)
+ if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
+ target.toFile
+ }
+
+ def copyToTarget(): CompilationTest = new CompilationTest (
+ targets.map {
+ case target @ ConcurrentCompilationTarget(files, _, outDir) =>
+ target.copy(files = files.map(copyToDir(outDir,_)))
+ case target @ SeparateCompilationTarget(dir, _, outDir) =>
+ target.copy(dir = copyToDir(outDir, dir))
+ },
+ times, shouldDelete, threadLimit
+ )
+
def times(i: Int): CompilationTest =
new CompilationTest(targets, i, shouldDelete, threadLimit)
@@ -521,12 +538,6 @@ trait ParallelTesting {
targetDir
}
- private def copyToDir(dir: JFile, file: JFile): Unit = {
- val target = Paths.get(dir.getAbsolutePath, file.getName)
- Files.copy(file.toPath, target, REPLACE_EXISTING)
- if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
- }
-
private def requirements(f: String, sourceDir: JFile, outDir: String): Unit = {
require(sourceDir.isDirectory && sourceDir.exists, "passed non-directory to `compileFilesInDir`")
require(outDir.last == '/', "please specify an `outDir` with a trailing slash")