@@ -2261,17 +2261,20 @@ object Build {
2261
2261
crossPaths := true , // org.scala-lang:scala3-compiler has a crosspath
2262
2262
// sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
2263
2263
autoScalaLibrary := false ,
2264
- // Add the source directories for the stdlib (non- boostrapped)
2264
+ // Add the source directories for the compiler ( boostrapped)
2265
2265
Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
2266
2266
Compile / unmanagedSourceDirectories += baseDirectory.value / " src-bootstrapped" ,
2267
+ // Add the test directories for the compiler (bootstrapped)
2268
+ Test / unmanagedSourceDirectories := Seq (baseDirectory.value / " test" ),
2267
2269
// All the dependencies needed by the compiler
2268
2270
libraryDependencies ++= Seq (
2269
2271
" org.scala-lang.modules" % " scala-asm" % " 9.8.0-scala-1" ,
2270
2272
Dependencies .compilerInterface,
2271
2273
" org.jline" % " jline-reader" % " 3.29.0" ,
2272
2274
" org.jline" % " jline-terminal" % " 3.29.0" ,
2273
2275
" org.jline" % " jline-terminal-jni" % " 3.29.0" ,
2274
- // ("io.get-coursier" %% "coursier" % "2.0.16" % Test).cross(CrossVersion.for3Use2_13),
2276
+ " com.github.sbt" % " junit-interface" % " 0.13.3" % Test ,
2277
+ (" io.get-coursier" %% " coursier" % " 2.0.16" % Test ).cross(CrossVersion .for3Use2_13),
2275
2278
),
2276
2279
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
2277
2280
Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
@@ -2315,6 +2318,7 @@ object Build {
2315
2318
Seq (file)
2316
2319
}.taskValue,
2317
2320
// Configure to use the non-bootstrapped compiler
2321
+ managedScalaInstance := false ,
2318
2322
scalaInstance := {
2319
2323
val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
2320
2324
@@ -2381,6 +2385,38 @@ object Build {
2381
2385
sjsSources
2382
2386
} (Set (scalaJSIRSourcesJar)).toSeq
2383
2387
}.taskValue,
2388
+ // Configuration of the test suite
2389
+ Test / forkOptions := (Test / forkOptions).value
2390
+ .withWorkingDirectory((ThisBuild / baseDirectory).value),
2391
+ Test / test := (Test / testOnly).toTask(" -- --exclude-categories=dotty.VulpixMetaTests" ).value,
2392
+ Test / testOptions += Tests .Argument (
2393
+ TestFrameworks .JUnit ,
2394
+ " --run-listener=dotty.tools.ContextEscapeDetector" ,
2395
+ ),
2396
+ Test / javaOptions ++= {
2397
+ val log = streams.value.log
2398
+ val managedSrcDir = {
2399
+ // Populate the directory
2400
+ (Compile / managedSources).value
2401
+
2402
+ (Compile / sourceManaged).value
2403
+ }
2404
+ val externalDeps = (ThisProject / Runtime / externalDependencyClasspath).value
2405
+ Seq (
2406
+ s " -Ddotty.tests.dottyCompilerManagedSources= ${managedSrcDir}" ,
2407
+ s " -Ddotty.tests.classes.dottyInterfaces= ${(`scala3-interfaces` / Compile / packageBin).value}" ,
2408
+ s " -Ddotty.tests.classes.dottyCompiler= ${(ThisProject / Compile / packageBin).value}" ,
2409
+ s " -Ddotty.tests.classes.tastyCore= ${(`tasty-core-bootstrapped-new` / Compile / packageBin).value}" ,
2410
+ s " -Ddotty.tests.classes.compilerInterface= ${findArtifactPath(externalDeps, " compiler-interface" )}" ,
2411
+ s " -Ddotty.tests.classes.scalaLibrary= ${(`scala-library-bootstrapped` / Compile / packageBin).value}" ,
2412
+ s " -Ddotty.tests.classes.scalaAsm= ${findArtifactPath(externalDeps, " scala-asm" )}" ,
2413
+ s " -Ddotty.tests.classes.jlineTerminal= ${findArtifactPath(externalDeps, " jline-terminal" )}" ,
2414
+ s " -Ddotty.tests.classes.jlineReader= ${findArtifactPath(externalDeps, " jline-reader" )}" ,
2415
+ s " -Ddotty.tests.classes.dottyStaging= ${(LocalProject (" scala3-staging-new" ) / Compile / packageBin).value}" ,
2416
+ s " -Ddotty.tests.classes.dottyTastyInspector= ${(LocalProject (" scala3-tasty-inspector-new" ) / Compile / packageBin).value}" ,
2417
+ s " -Ddotty.tools.dotc.semanticdb.test= ${(ThisBuild / baseDirectory).value/ " tests" / " semanticdb" }" ,
2418
+ )
2419
+ },
2384
2420
)
2385
2421
2386
2422
// ==============================================================================================
0 commit comments