@@ -520,11 +520,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
520520 }
521521
522522 protected def compileWithOtherCompiler (compiler : String , files : Array [JFile ], flags : TestFlags , targetDir : JFile ): TestReporter =
523- val compilerDir = getCompiler(compiler).toString
523+ val compilerDir = getCompiler(compiler)
524524
525525 def substituteClasspath (old : String ): String =
526526 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
528529 else o
529530 }.mkString(JFile .pathSeparator)
530531
@@ -535,7 +536,10 @@ trait ParallelTesting extends RunnerOrchestration { self =>
535536 val dummyStream = new PrintStream (new ByteArrayOutputStream ())
536537 val reporter = TestReporter .reporter(dummyStream, ERROR )
537538
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)
539543 val process = Runtime .getRuntime.exec(command)
540544 val errorsText = Source .fromInputStream(process.getErrorStream).mkString
541545 if process.waitFor() != 0 then
@@ -1419,10 +1423,10 @@ object ParallelTesting {
14191423 def isTastyFile (f : JFile ): Boolean =
14201424 f.getName.endsWith(" .tasty" )
14211425
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}" )
14241428 synchronized {
1425- if dir.exists then
1429+ if dir.toFile. exists then
14261430 dir
14271431 else
14281432 import scala .sys .process ._
0 commit comments