Skip to content

Commit 75f1ec7

Browse files
committed
Add test cases project for presentation compiler
1 parent d40009a commit 75f1ec7

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

build.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ val `dist-linux-aarch64` = Build.`dist-linux-aarch64`
3636
val `community-build` = Build.`community-build`
3737
val `sbt-community-build` = Build.`sbt-community-build`
3838
val `scala3-presentation-compiler` = Build.`scala3-presentation-compiler`
39+
val `scala3-presentation-compiler-testcases` = Build.`scala3-presentation-compiler-testcases`
3940

4041
val sjsSandbox = Build.sjsSandbox
4142
val sjsJUnitTests = Build.sjsJUnitTests

presentation-compiler/test/dotty/tools/pc/base/BasePCSuite.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ import org.junit.runner.RunWith
2525
import scala.meta.pc.CompletionItemPriority
2626

2727
object TestResources:
28-
val scalaLibrary = BuildInfo.ideTestsDependencyClasspath.map(_.toPath).toSeq
28+
val classpath = BuildInfo.ideTestsDependencyClasspath.map(_.toPath).toSeq
2929
val classpathSearch =
30-
ClasspathSearch.fromClasspath(scalaLibrary, ExcludedPackagesHandler.default)
30+
ClasspathSearch.fromClasspath(classpath, ExcludedPackagesHandler.default)
3131

3232
@RunWith(classOf[ReusableClassRunner])
3333
abstract class BasePCSuite extends PcAssertions:
@@ -38,11 +38,11 @@ abstract class BasePCSuite extends PcAssertions:
3838
val executorService: ScheduledExecutorService =
3939
Executors.newSingleThreadScheduledExecutor()
4040
val testingWorkspaceSearch = TestingWorkspaceSearch(
41-
TestResources.scalaLibrary.map(_.toString)
41+
TestResources.classpath.map(_.toString)
4242
)
4343

4444
lazy val presentationCompiler: PresentationCompiler =
45-
val myclasspath: Seq[Path] = TestResources.scalaLibrary
45+
val myclasspath: Seq[Path] = TestResources.classpath
4646
val scalacOpts = scalacOptions(myclasspath)
4747
val search = new MockSymbolSearch(
4848
testingWorkspaceSearch,

project/Build.scala

+7-2
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,7 @@ object Build {
14251425

14261426
lazy val `scala3-presentation-compiler` = project.in(file("presentation-compiler"))
14271427
.withCommonSettings(Bootstrapped)
1428-
.dependsOn(`scala3-compiler-bootstrapped`, `scala3-library-bootstrapped`)
1428+
.dependsOn(`scala3-compiler-bootstrapped`, `scala3-library-bootstrapped`, `scala3-presentation-compiler-testcases`)
14291429
.settings(presentationCompilerSettings)
14301430
.settings(scala3PresentationCompilerBuildInfo)
14311431
.settings(
@@ -1436,14 +1436,15 @@ object Build {
14361436
def scala3PresentationCompilerBuildInfo =
14371437
Seq(
14381438
ideTestsDependencyClasspath := {
1439+
val testCasesLib = (`scala3-presentation-compiler-testcases` / Compile / classDirectory).value
14391440
val dottyLib = (`scala3-library-bootstrapped` / Compile / classDirectory).value
14401441
val scalaLib =
14411442
(`scala3-library-bootstrapped` / Compile / dependencyClasspath)
14421443
.value
14431444
.map(_.data)
14441445
.filter(_.getName.matches("scala-library.*\\.jar"))
14451446
.toList
1446-
dottyLib :: scalaLib
1447+
testCasesLib :: dottyLib :: scalaLib
14471448
// Nil
14481449
},
14491450
Compile / buildInfoPackage := "dotty.tools.pc.buildinfo",
@@ -1503,6 +1504,10 @@ object Build {
15031504
)
15041505
}
15051506

1507+
lazy val `scala3-presentation-compiler-testcases` = project.in(file("presentation-compiler-testcases"))
1508+
.dependsOn(`scala3-compiler-bootstrapped`)
1509+
.settings(commonBootstrappedSettings)
1510+
15061511
lazy val `scala3-language-server` = project.in(file("language-server")).
15071512
dependsOn(dottyCompiler(Bootstrapped)).
15081513
settings(commonBootstrappedSettings).

0 commit comments

Comments
 (0)