@@ -2292,17 +2292,20 @@ object Build {
22922292 crossPaths := true , // org.scala-lang:scala3-compiler has a crosspath
22932293 // sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
22942294 autoScalaLibrary := false ,
2295- // Add the source directories for the stdlib (non- boostrapped)
2295+ // Add the source directories for the compiler ( boostrapped)
22962296 Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
22972297 Compile / unmanagedSourceDirectories += baseDirectory.value / " src-bootstrapped" ,
2298+ // Add the test directories for the compiler (bootstrapped)
2299+ Test / unmanagedSourceDirectories := Seq (baseDirectory.value / " test" ),
22982300 // All the dependencies needed by the compiler
22992301 libraryDependencies ++= Seq (
23002302 " org.scala-lang.modules" % " scala-asm" % " 9.8.0-scala-1" ,
23012303 Dependencies .compilerInterface,
23022304 " org.jline" % " jline-reader" % " 3.29.0" ,
23032305 " org.jline" % " jline-terminal" % " 3.29.0" ,
23042306 " org.jline" % " jline-terminal-jni" % " 3.29.0" ,
2305- // ("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13),
2307+ " com.github.sbt" % " junit-interface" % " 0.13.3" % Test ,
2308+ (" io.get-coursier" %% " coursier" % " 2.0.16" % Test ).cross(CrossVersion .for3Use2_13),
23062309 ),
23072310 // NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
23082311 Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
@@ -2346,6 +2349,7 @@ object Build {
23462349 Seq (file)
23472350 }.taskValue,
23482351 // Configure to use the non-bootstrapped compiler
2352+ managedScalaInstance := false ,
23492353 scalaInstance := {
23502354 val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
23512355
@@ -2412,7 +2416,39 @@ object Build {
24122416 sjsSources
24132417 } (Set (scalaJSIRSourcesJar)).toSeq
24142418 }.taskValue,
2415- (Compile / sourceGenerators) += ShadedSourceGenerator .task.taskValue
2419+ (Compile / sourceGenerators) += ShadedSourceGenerator .task.taskValue,
2420+ // Configuration of the test suite
2421+ Test / forkOptions := (Test / forkOptions).value
2422+ .withWorkingDirectory((ThisBuild / baseDirectory).value),
2423+ Test / test := (Test / testOnly).toTask(" -- --exclude-categories=dotty.VulpixMetaTests" ).value,
2424+ Test / testOptions += Tests .Argument (
2425+ TestFrameworks .JUnit ,
2426+ " --run-listener=dotty.tools.ContextEscapeDetector" ,
2427+ ),
2428+ Test / javaOptions ++= {
2429+ val log = streams.value.log
2430+ val managedSrcDir = {
2431+ // Populate the directory
2432+ (Compile / managedSources).value
2433+
2434+ (Compile / sourceManaged).value
2435+ }
2436+ val externalDeps = (ThisProject / Runtime / externalDependencyClasspath).value
2437+ Seq (
2438+ s " -Ddotty.tests.dottyCompilerManagedSources= ${managedSrcDir}" ,
2439+ s " -Ddotty.tests.classes.dottyInterfaces= ${(`scala3-interfaces` / Compile / packageBin).value}" ,
2440+ s " -Ddotty.tests.classes.dottyCompiler= ${(ThisProject / Compile / packageBin).value}" ,
2441+ s " -Ddotty.tests.classes.tastyCore= ${(`tasty-core-bootstrapped-new` / Compile / packageBin).value}" ,
2442+ s " -Ddotty.tests.classes.compilerInterface= ${findArtifactPath(externalDeps, " compiler-interface" )}" ,
2443+ s " -Ddotty.tests.classes.scalaLibrary= ${(`scala-library-bootstrapped` / Compile / packageBin).value}" ,
2444+ s " -Ddotty.tests.classes.scalaAsm= ${findArtifactPath(externalDeps, " scala-asm" )}" ,
2445+ s " -Ddotty.tests.classes.jlineTerminal= ${findArtifactPath(externalDeps, " jline-terminal" )}" ,
2446+ s " -Ddotty.tests.classes.jlineReader= ${findArtifactPath(externalDeps, " jline-reader" )}" ,
2447+ s " -Ddotty.tests.classes.dottyStaging= ${(LocalProject (" scala3-staging-new" ) / Compile / packageBin).value}" ,
2448+ s " -Ddotty.tests.classes.dottyTastyInspector= ${(LocalProject (" scala3-tasty-inspector-new" ) / Compile / packageBin).value}" ,
2449+ s " -Ddotty.tools.dotc.semanticdb.test= ${(ThisBuild / baseDirectory).value/ " tests" / " semanticdb" }" ,
2450+ )
2451+ },
24162452 )
24172453
24182454 // ==============================================================================================
0 commit comments