Skip to content

Commit 1f652f4

Browse files
committed
vulpix: pass -classpath to javac too
Otherwise the tastyBootstrap test failed when compiling the .java files added in the previous commit that depend on scala-asm.
1 parent 0abd076 commit 1f652f4

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,8 @@ trait ParallelTesting extends RunnerOrchestration { self =>
324324

325325
protected def compile(files0: Array[JFile], flags0: TestFlags, suppressErrors: Boolean, targetDir: JFile): TestReporter = {
326326

327-
val flags = flags0 and ("-d", targetDir.getAbsolutePath)
327+
val flags = flags0.and("-d", targetDir.getAbsolutePath)
328+
.withClasspath(targetDir.getAbsolutePath)
328329

329330
def flattenFiles(f: JFile): Array[JFile] =
330331
if (f.isDirectory) f.listFiles.flatMap(flattenFiles)
@@ -336,9 +337,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
336337
val fullArgs = Array(
337338
"javac",
338339
"-encoding", "UTF-8",
339-
"-classpath",
340-
s"${Properties.scalaLibrary}${JFile.pathSeparator}${targetDir.getAbsolutePath}"
341-
) ++ flags.all.takeRight(2) ++ fs
340+
) ++ flags.javacFlags ++ fs
342341

343342
val process = Runtime.getRuntime.exec(fullArgs)
344343
val output = Source.fromInputStream(process.getErrorStream).mkString
@@ -366,7 +365,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
366365
}
367366
}
368367

369-
val allArgs = flags.withClasspath(targetDir.getAbsolutePath).all
368+
val allArgs = flags.all
370369

371370
// Compile with a try to catch any StackTrace generated by the compiler:
372371
try {

compiler/test/dotty/tools/vulpix/TestFlags.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ final case class TestFlags(
2020
TestFlags(defaultClassPath, s"$runClassPath${JFile.pathSeparator}$classPath", options)
2121

2222
def all: Array[String] = Array("-classpath", defaultClassPath) ++ options
23+
24+
/** Subset of the flags that should be passed to javac. */
25+
def javacFlags: Array[String] = {
26+
val flags = all
27+
val cp = flags.dropWhile(_ != "-classpath").take(2)
28+
val output = flags.dropWhile(_ != "-d").take(2)
29+
cp ++ output
30+
}
2331
}
2432

2533
object TestFlags {

0 commit comments

Comments
 (0)