Skip to content

Commit 197ebf3

Browse files
committed
chore: add test configuration for the non-bootstrapped compiler
1 parent 9adf7cb commit 197ebf3

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
@@ -2095,6 +2095,8 @@ object Build {
20952095
// Add the source directories for the compiler (non-boostrapped)
20962096
Compile / unmanagedSourceDirectories := Seq(baseDirectory.value / "src"),
20972097
Compile / unmanagedSourceDirectories += baseDirectory.value / "src-non-bootstrapped",
2098+
// Add the test directories for the compiler (non-bootstrapped)
2099+
Test / unmanagedSourceDirectories := Seq(baseDirectory.value / "test"),
20982100
// All the dependencies needed by the compiler
20992101
libraryDependencies ++= Seq(
21002102
"com.github.sbt" % "junit-interface" % "0.13.3" % Test,
@@ -2214,6 +2216,36 @@ object Build {
22142216
sjsSources
22152217
} (Set(scalaJSIRSourcesJar)).toSeq
22162218
}.taskValue,
2219+
// Configuration of the test suite
2220+
Test / forkOptions := (Test / forkOptions).value
2221+
.withWorkingDirectory((ThisBuild / baseDirectory).value),
2222+
Test / test := (Test / testOnly).toTask(" -- --exclude-categories=dotty.VulpixMetaTests").value,
2223+
Test / testOptions += Tests.Argument(
2224+
TestFrameworks.JUnit,
2225+
"--run-listener=dotty.tools.ContextEscapeDetector", "--exclude-categories=dotty.BootstrappedOnlyTests",
2226+
),
2227+
Test / javaOptions ++= {
2228+
val log = streams.value.log
2229+
val managedSrcDir = {
2230+
// Populate the directory
2231+
(Compile / managedSources).value
2232+
2233+
(Compile / sourceManaged).value
2234+
}
2235+
val externalDeps = (ThisProject / Runtime / externalDependencyClasspath).value
2236+
Seq(
2237+
s"-Ddotty.tests.dottyCompilerManagedSources=${managedSrcDir}",
2238+
s"-Ddotty.tests.classes.dottyInterfaces=${(`scala3-interfaces` / Compile / packageBin).value}",
2239+
s"-Ddotty.tests.classes.dottyCompiler=${(ThisProject / Compile / packageBin).value}",
2240+
s"-Ddotty.tests.classes.tastyCore=${(`tasty-core-nonbootstrapped` / Compile / packageBin).value}",
2241+
s"-Ddotty.tests.classes.compilerInterface=${findArtifactPath(externalDeps, "compiler-interface")}",
2242+
s"-Ddotty.tests.classes.scalaLibrary=${(`scala-library-nonbootstrapped` / Compile / packageBin).value}",
2243+
s"-Ddotty.tests.classes.scalaAsm=${findArtifactPath(externalDeps, "scala-asm")}",
2244+
s"-Ddotty.tests.classes.jlineTerminal=${findArtifactPath(externalDeps, "jline-terminal")}",
2245+
s"-Ddotty.tests.classes.jlineReader=${findArtifactPath(externalDeps, "jline-reader")}",
2246+
s"-Ddotty.tools.dotc.semanticdb.test=${(ThisBuild / baseDirectory).value/"tests"/"semanticdb"}",
2247+
)
2248+
},
22172249
)
22182250

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

0 commit comments

Comments
 (0)