@@ -479,6 +479,23 @@ trait ParallelTesting {
479
479
this
480
480
}
481
481
482
+ private def copyToDir (dir : JFile , file : JFile ): JFile = {
483
+ val target = Paths .get(dir.getAbsolutePath, file.getName)
484
+ Files .copy(file.toPath, target, REPLACE_EXISTING )
485
+ if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
486
+ target.toFile
487
+ }
488
+
489
+ def copyToTarget (): CompilationTest = new CompilationTest (
490
+ targets.map {
491
+ case target @ ConcurrentCompilationTarget (files, _, outDir) =>
492
+ target.copy(files = files.map(copyToDir(outDir,_)))
493
+ case target @ SeparateCompilationTarget (dir, _, outDir) =>
494
+ target.copy(dir = copyToDir(outDir, dir))
495
+ },
496
+ times, shouldDelete, threadLimit
497
+ )
498
+
482
499
def times (i : Int ): CompilationTest =
483
500
new CompilationTest (targets, i, shouldDelete, threadLimit)
484
501
@@ -521,12 +538,6 @@ trait ParallelTesting {
521
538
targetDir
522
539
}
523
540
524
- private def copyToDir (dir : JFile , file : JFile ): Unit = {
525
- val target = Paths .get(dir.getAbsolutePath, file.getName)
526
- Files .copy(file.toPath, target, REPLACE_EXISTING )
527
- if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
528
- }
529
-
530
541
private def requirements (f : String , sourceDir : JFile , outDir : String ): Unit = {
531
542
require(sourceDir.isDirectory && sourceDir.exists, " passed non-directory to `compileFilesInDir`" )
532
543
require(outDir.last == '/' , " please specify an `outDir` with a trailing slash" )
0 commit comments