Skip to content

Commit d9e3f3f

Browse files
committed
Move the Scala.js-specific compiler tests to a separate project.
This way, it is not necessary to compile `dotty-library-bootstrappedJS` unless we want to run the Scala.js-specific tests. This reduces test coverage, since those tests won't be run with the bootstrapped compiler anymore.
1 parent 400b6c2 commit d9e3f3f

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed

build.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ val `community-build` = Build.`community-build`
3030

3131
val sjsSandbox = Build.sjsSandbox
3232
val sjsJUnitTests = Build.sjsJUnitTests
33+
val sjsCompilerTests = Build.sjsCompilerTests
3334

3435
val `sbt-dotty` = Build.`sbt-dotty`
3536
val `vscode-dotty` = Build.`vscode-dotty`

project/Build.scala

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,22 +526,19 @@ object Build {
526526
(sourceManaged in Compile).value
527527
}
528528
val externalDeps = externalCompilerClasspathTask.value
529-
val externalJSDeps = (externalDependencyClasspath in (LocalProject("dotty-library-bootstrappedJS"), Compile)).value
530529
val jars = packageAll.value
531530

532531
Seq(
533532
"-Ddotty.tests.dottyCompilerManagedSources=" + managedSrcDir,
534533
"-Ddotty.tests.classes.dottyInterfaces=" + jars("dotty-interfaces"),
535534
"-Ddotty.tests.classes.dottyLibrary=" + jars("dotty-library"),
536-
"-Ddotty.tests.classes.dottyLibraryJS=" + jars("dotty-library-js"),
537535
"-Ddotty.tests.classes.dottyCompiler=" + jars("dotty-compiler"),
538536
"-Ddotty.tests.classes.tastyCore=" + jars("tasty-core"),
539537
"-Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, "compiler-interface"),
540538
"-Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, "scala-library"),
541539
"-Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, "scala-asm"),
542540
"-Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, "jline-terminal"),
543541
"-Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, "jline-reader"),
544-
"-Ddotty.tests.classes.scalaJSLibrary=" + findArtifactPath(externalJSDeps, "scalajs-library_2.13"),
545542
)
546543
},
547544

@@ -708,8 +705,7 @@ object Build {
708705
// running the compiler, we should always have the bootstrapped
709706
// library on the compiler classpath since the non-bootstrapped one
710707
// may not be binary-compatible.
711-
"dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value,
712-
"dotty-library-js" -> packageBin.in(`dotty-library-bootstrappedJS`, Compile).value,
708+
"dotty-library" -> packageBin.in(`dotty-library-bootstrapped`, Compile).value
713709
).mapValues(_.getAbsolutePath)
714710
}
715711
}.value,
@@ -1144,6 +1140,27 @@ object Build {
11441140
}
11451141
)
11461142

1143+
lazy val sjsCompilerTests = project.in(file("tests/sjs-compiler-tests")).
1144+
dependsOn(`dotty-compiler` % "test->test").
1145+
settings(
1146+
commonNonBootstrappedSettings,
1147+
outputStrategy := Some(StdoutOutput),
1148+
1149+
// Change the baseDirectory when running the tests
1150+
baseDirectory in Test := baseDirectory.value.getParentFile.getParentFile,
1151+
1152+
javaOptions ++= (javaOptions in `dotty-compiler`).value,
1153+
javaOptions ++= {
1154+
val externalJSDeps = (externalDependencyClasspath in (`dotty-library-bootstrappedJS`, Compile)).value
1155+
val dottyLibraryJSJar = (packageBin in (`dotty-library-bootstrappedJS`, Compile)).value.getAbsolutePath
1156+
1157+
Seq(
1158+
"-Ddotty.tests.classes.dottyLibraryJS=" + dottyLibraryJSJar,
1159+
"-Ddotty.tests.classes.scalaJSLibrary=" + findArtifactPath(externalJSDeps, "scalajs-library_2.13"),
1160+
)
1161+
},
1162+
)
1163+
11471164
lazy val `dotty-bench` = project.in(file("bench")).asDottyBench(NonBootstrapped)
11481165
lazy val `dotty-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped)
11491166
lazy val `dotty-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped)

0 commit comments

Comments
 (0)