Skip to content

Commit 545fb35

Browse files
committed
chore: add test configuration for the non-bootstrapped compiler
1 parent 6dde886 commit 545fb35

File tree

3 files changed

+34
-9
lines changed

3 files changed

+34
-9
lines changed

compiler/test/dotty/Properties.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ object Properties {
5757
/** dotty-interfaces jar */
5858
def dottyInterfaces: String = sys.props("dotty.tests.classes.dottyInterfaces")
5959

60-
/** dotty-library jar */
61-
def dottyLibrary: String = sys.props("dotty.tests.classes.dottyLibrary")
62-
6360
/** dotty-library-js jar */
6461
def dottyLibraryJS: String = sys.props("dotty.tests.classes.dottyLibraryJS")
6562

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@ object TestConfiguration {
2525
"-Xverify-signatures"
2626
)
2727

28-
val basicClasspath = mkClasspath(List(
29-
Properties.scalaLibrary,
30-
Properties.dottyLibrary
31-
))
28+
val basicClasspath = mkClasspath(List(Properties.scalaLibrary))
3229

3330
val withCompilerClasspath = mkClasspath(List(
3431
Properties.scalaLibrary,
@@ -37,7 +34,6 @@ object TestConfiguration {
3734
Properties.jlineReader,
3835
Properties.compilerInterface,
3936
Properties.dottyInterfaces,
40-
Properties.dottyLibrary,
4137
Properties.tastyCore,
4238
Properties.dottyCompiler
4339
))
@@ -66,7 +62,7 @@ object TestConfiguration {
6662

6763
val commonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions
6864
val noYcheckCommonOptions = Array("-indent") ++ checkOptions ++ noCheckOptions
69-
val defaultOptions = TestFlags(basicClasspath, commonOptions)
65+
val defaultOptions = TestFlags(basicClasspath, commonOptions) and "-Yno-stdlib-patches"
7066
val noYcheckOptions = TestFlags(basicClasspath, noYcheckCommonOptions)
7167
val bestEffortBaselineOptions = TestFlags(basicClasspath, noCheckOptions)
7268
val unindentOptions = TestFlags(basicClasspath, Array("-no-indent") ++ checkOptions ++ noCheckOptions ++ yCheckOptions)

project/Build.scala

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,6 +2125,8 @@ object Build {
21252125
// Add the source directories for the compiler (non-boostrapped)
21262126
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
21272127
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
2128+
// Add the test directories for the compiler (non-bootstrapped)
2129+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
21282130
// All the dependencies needed by the compiler
21292131
libraryDependencies ++= Seq(
21302132
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
@@ -2245,6 +2247,36 @@ object Build {
22452247
sjsSources
22462248
} (Set(scalaJSIRSourcesJar)).toSeq
22472249
}.taskValue,
2250+
// Configuration of the test suite
2251+
Test / forkOptions := (Test / forkOptions).value
2252+
.withWorkingDirectory((ThisBuild / baseDirectory).value),
2253+
Test / test := (Test / testOnly).toTask(" -- --exclude-categories=dotty.VulpixMetaTests").value,
2254+
Test / testOptions += Tests.Argument(
2255+
TestFrameworks.JUnit,
2256+
"--run-listener=dotty.tools.ContextEscapeDetector", "--exclude-categories=dotty.BootstrappedOnlyTests",
2257+
),
2258+
Test / javaOptions ++= {
2259+
val log = streams.value.log
2260+
val managedSrcDir = {
2261+
// Populate the directory
2262+
(Compile / managedSources).value
2263+
2264+
(Compile / sourceManaged).value
2265+
}
2266+
val externalDeps = (ThisProject / Runtime / externalDependencyClasspath).value
2267+
Seq(
2268+
s"-Ddotty.tests.dottyCompilerManagedSources=${managedSrcDir}",
2269+
s"-Ddotty.tests.classes.dottyInterfaces=${(`scala3-interfaces` / Compile / packageBin).value}",
2270+
s"-Ddotty.tests.classes.dottyCompiler=${(ThisProject / Compile / packageBin).value}",
2271+
s"-Ddotty.tests.classes.tastyCore=${(`tasty-core-nonbootstrapped` / Compile / packageBin).value}",
2272+
s"-Ddotty.tests.classes.compilerInterface=${findArtifactPath(externalDeps, "compiler-interface")}",
2273+
s"-Ddotty.tests.classes.scalaLibrary=${(`scala-library-nonbootstrapped` / Compile / packageBin).value}",
2274+
s"-Ddotty.tests.classes.scalaAsm=${findArtifactPath(externalDeps, "scala-asm")}",
2275+
s"-Ddotty.tests.classes.jlineTerminal=${findArtifactPath(externalDeps, "jline-terminal")}",
2276+
s"-Ddotty.tests.classes.jlineReader=${findArtifactPath(externalDeps, "jline-reader")}",
2277+
s"-Ddotty.tools.dotc.semanticdb.test=${(ThisBuild / baseDirectory).value/"tests"/"semanticdb"}",
2278+
)
2279+
},
22482280
)
22492281

22502282
/* Configuration of the org.scala-lang:scala3-compiler_3:*.**.**-bootstrapped project */

0 commit comments

Comments
 (0)