@@ -520,11 +520,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
520
520
}
521
521
522
522
protected def compileWithOtherCompiler (compiler : String , files : Array [JFile ], flags : TestFlags , targetDir : JFile ): TestReporter =
523
- val compilerDir = getCompiler(compiler).toString
523
+ val compilerDir = getCompiler(compiler)
524
524
525
525
def substituteClasspath (old : String ): String =
526
526
old.split(JFile .pathSeparator).map { o =>
527
- if JFile (o) == JFile (Properties .dottyLibrary) then s " $compilerDir/lib/scala3-library_3- $compiler.jar "
527
+ if JFile (o) == JFile (Properties .dottyLibrary) then
528
+ compilerDir.resolve(" lib" ).resolve(s " scala3-library_3- $compiler.jar " ).toString
528
529
else o
529
530
}.mkString(JFile .pathSeparator)
530
531
@@ -535,7 +536,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
535
536
val dummyStream = new PrintStream (new ByteArrayOutputStream ())
536
537
val reporter = TestReporter .reporter(dummyStream, ERROR )
537
538
538
- val command = Array (compilerDir + " /bin/scalac" ) ++ flags1.all ++ files.map(_.getPath)
539
+ val isOSWindows = System .getProperty(" os.name" ).toLowerCase.startsWith(" windows" )
540
+ val scalacBinaryName = if isOSWindows then " scalac.bat" else " scalac"
541
+ val scalacPath = compilerDir.resolve(" bin" ).resolve(scalacBinaryName).toString
542
+ val command = Array (scalacPath) ++ flags1.all ++ files.map(_.getPath)
539
543
val process = Runtime .getRuntime.exec(command)
540
544
val errorsText = Source .fromInputStream(process.getErrorStream).mkString
541
545
if process.waitFor() != 0 then
@@ -1419,10 +1423,10 @@ object ParallelTesting {
1419
1423
def isTastyFile (f : JFile ): Boolean =
1420
1424
f.getName.endsWith(" .tasty" )
1421
1425
1422
- def getCompiler (version : String ): JFile =
1423
- val dir = cache.resolve(s " scala3- ${version}" ).toFile
1426
+ def getCompiler (version : String ): Path =
1427
+ val dir = cache.resolve(s " scala3- ${version}" )
1424
1428
synchronized {
1425
- if dir.exists then
1429
+ if dir.toFile. exists then
1426
1430
dir
1427
1431
else
1428
1432
import scala .sys .process ._
0 commit comments