@@ -58,7 +58,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
58
58
def flags : TestFlags
59
59
def sourceFiles : Array [JFile ]
60
60
61
- def runClassPath : String = outDir.getAbsolutePath + JFile .pathSeparator + flags.runClassPath
61
+ def runClassPath : String = outDir.getPath + JFile .pathSeparator + flags.runClassPath
62
62
63
63
def title : String = self match {
64
64
case self : JointCompilationSource =>
@@ -107,7 +107,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
107
107
108
108
self match {
109
109
case source : JointCompilationSource => {
110
- source.sourceFiles.map(_.getAbsolutePath ).foreach { path =>
110
+ source.sourceFiles.map(_.getPath ).foreach { path =>
111
111
sb.append(delimiter)
112
112
sb.append(path)
113
113
sb += ' '
@@ -217,10 +217,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
217
217
*/
218
218
final def checkFile (testSource : TestSource ): Option [JFile ] = (testSource match {
219
219
case ts : JointCompilationSource =>
220
- ts.files.collectFirst { case f if ! f.isDirectory => new JFile (f.getAbsolutePath .replaceFirst(" \\ .scala$" , " .check" )) }
220
+ ts.files.collectFirst { case f if ! f.isDirectory => new JFile (f.getPath .replaceFirst(" \\ .scala$" , " .check" )) }
221
221
222
222
case ts : SeparateCompilationSource =>
223
- Option (new JFile (ts.dir.getAbsolutePath + " .check" ))
223
+ Option (new JFile (ts.dir.getPath + " .check" ))
224
224
}).filter(_.exists)
225
225
226
226
/**
@@ -319,9 +319,9 @@ trait ParallelTesting extends RunnerOrchestration { self =>
319
319
if (! testFilter.isDefined) testSources
320
320
else testSources.filter {
321
321
case JointCompilationSource (_, files, _, _, _, _) =>
322
- files.exists(file => file.getAbsolutePath .contains(testFilter.get))
322
+ files.exists(file => file.getPath .contains(testFilter.get))
323
323
case SeparateCompilationSource (_, dir, _, _) =>
324
- dir.getAbsolutePath .contains(testFilter.get)
324
+ dir.getPath .contains(testFilter.get)
325
325
}
326
326
327
327
/** Total amount of test sources being compiled by this test */
@@ -424,8 +424,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
424
424
425
425
protected def compile (files0 : Array [JFile ], flags0 : TestFlags , suppressErrors : Boolean , targetDir : JFile ): TestReporter = {
426
426
427
- val flags = flags0.and(" -d" , targetDir.getAbsolutePath )
428
- .withClasspath(targetDir.getAbsolutePath )
427
+ val flags = flags0.and(" -d" , targetDir.getPath )
428
+ .withClasspath(targetDir.getPath )
429
429
430
430
def flattenFiles (f : JFile ): Array [JFile ] =
431
431
if (f.isDirectory) f.listFiles.flatMap(flattenFiles)
@@ -469,10 +469,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
469
469
470
470
// If a test contains a Java file that cannot be parsed by Dotty's Java source parser, its
471
471
// name must contain the string "JAVA_ONLY".
472
- val dottyFiles = files.filterNot(_.getName.contains(" JAVA_ONLY" )).map(_.getAbsolutePath )
472
+ val dottyFiles = files.filterNot(_.getName.contains(" JAVA_ONLY" )).map(_.getPath )
473
473
driver.process(allArgs ++ dottyFiles, reporter = reporter)
474
474
475
- val javaFiles = files.filter(_.getName.endsWith(" .java" )).map(_.getAbsolutePath )
475
+ val javaFiles = files.filter(_.getName.endsWith(" .java" )).map(_.getPath )
476
476
val javaErrors = compileWithJavac(javaFiles)
477
477
478
478
if (javaErrors.isDefined) {
@@ -486,7 +486,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
486
486
protected def compileFromTasty (flags0 : TestFlags , suppressErrors : Boolean , targetDir : JFile ): TestReporter = {
487
487
val tastyOutput = new JFile (targetDir.getPath + " _from-tasty" )
488
488
tastyOutput.mkdir()
489
- val flags = flags0 and (" -d" , tastyOutput.getAbsolutePath ) and " -from-tasty"
489
+ val flags = flags0 and (" -d" , tastyOutput.getPath ) and " -from-tasty"
490
490
491
491
def tastyFileToClassName (f : JFile ): String = {
492
492
val pathStr = targetDir.toPath.relativize(f.toPath).toString.replace(JFile .separatorChar, '.' )
@@ -668,7 +668,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
668
668
Source .fromFile(file, " UTF-8" ).getLines().zipWithIndex.foreach { case (line, lineNbr) =>
669
669
val errors = line.sliding(" // error" .length).count(_.mkString == " // error" )
670
670
if (errors > 0 )
671
- errorMap.put(s " ${file.getAbsolutePath }: ${lineNbr}" , errors)
671
+ errorMap.put(s " ${file.getPath }: ${lineNbr}" , errors)
672
672
673
673
val noposErrors = line.sliding(" // nopos-error" .length).count(_.mkString == " // nopos-error" )
674
674
if (noposErrors > 0 ) {
@@ -938,7 +938,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
938
938
* and if so copying recursively
939
939
*/
940
940
private def copyToDir (dir : JFile , file : JFile ): JFile = {
941
- val target = Paths .get(dir.getAbsolutePath , file.getName)
941
+ val target = Paths .get(dir.getPath , file.getName)
942
942
Files .copy(file.toPath, target, REPLACE_EXISTING )
943
943
if (file.isDirectory) file.listFiles.map(copyToDir(target.toFile, _))
944
944
target.toFile
@@ -1216,7 +1216,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
1216
1216
val (dirs, files) = compilationTargets(sourceDir, fromTastyFilter)
1217
1217
1218
1218
val filteredFiles = testFilter match {
1219
- case Some (str) => files.filter(_.getAbsolutePath .contains(str))
1219
+ case Some (str) => files.filter(_.getPath .contains(str))
1220
1220
case None => files
1221
1221
}
1222
1222
0 commit comments