@@ -2292,17 +2292,20 @@ object Build {
2292
2292
crossPaths := true , // org.scala-lang:scala3-compiler has a crosspath
2293
2293
// sbt shouldn't add stdlib automatically, we depend on `scala3-library-nonbootstrapped`
2294
2294
autoScalaLibrary := false ,
2295
- // Add the source directories for the stdlib (non- boostrapped)
2295
+ // Add the source directories for the compiler ( boostrapped)
2296
2296
Compile / unmanagedSourceDirectories := Seq (baseDirectory.value / " src" ),
2297
2297
Compile / unmanagedSourceDirectories += baseDirectory.value / " src-bootstrapped" ,
2298
+ // Add the test directories for the compiler (bootstrapped)
2299
+ Test / unmanagedSourceDirectories := Seq (baseDirectory.value / " test" ),
2298
2300
// All the dependencies needed by the compiler
2299
2301
libraryDependencies ++= Seq (
2300
2302
" org.scala-lang.modules" % " scala-asm" % " 9.8.0-scala-1" ,
2301
2303
Dependencies .compilerInterface,
2302
2304
" org.jline" % " jline-reader" % " 3.29.0" ,
2303
2305
" org.jline" % " jline-terminal" % " 3.29.0" ,
2304
2306
" 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),
2306
2309
),
2307
2310
// NOTE: The only difference here is that we drop `-Werror` and semanticDB for now
2308
2311
Compile / scalacOptions := Seq (" -deprecation" , " -feature" , " -unchecked" , " -encoding" , " UTF8" , " -language:implicitConversions" ),
@@ -2346,6 +2349,7 @@ object Build {
2346
2349
Seq (file)
2347
2350
}.taskValue,
2348
2351
// Configure to use the non-bootstrapped compiler
2352
+ managedScalaInstance := false ,
2349
2353
scalaInstance := {
2350
2354
val externalCompilerDeps = (`scala3-compiler-nonbootstrapped` / Compile / externalDependencyClasspath).value.map(_.data).toSet
2351
2355
@@ -2412,7 +2416,39 @@ object Build {
2412
2416
sjsSources
2413
2417
} (Set (scalaJSIRSourcesJar)).toSeq
2414
2418
}.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
+ },
2416
2452
)
2417
2453
2418
2454
// ==============================================================================================
0 commit comments