Skip to content

Commit ca63fd0

Browse files
committed
Use Scala 2 library TASTy in compilation tests
1 parent 645d7f5 commit ca63fd0

File tree

6 files changed

+20
-1
lines changed

6 files changed

+20
-1
lines changed

compiler/test/dotty/Properties.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ object Properties {
8282
/** scala-library jar */
8383
def scalaLibrary: String = sys.props("dotty.tests.classes.scalaLibrary")
8484

85+
/** scala-library TASTy jar */
86+
def scalaLibraryTasty: String = sys.props("dotty.tests.tasties.scalaLibrary")
87+
8588
/** scala-asm jar */
8689
def scalaAsm: String = sys.props("dotty.tests.classes.scalaAsm")
8790

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,13 @@ object TestConfiguration {
2626
)
2727

2828
val basicClasspath = mkClasspath(List(
29+
Properties.scalaLibraryTasty,
2930
Properties.scalaLibrary,
3031
Properties.dottyLibrary
3132
))
3233

3334
val withCompilerClasspath = mkClasspath(List(
35+
Properties.scalaLibraryTasty,
3436
Properties.scalaLibrary,
3537
Properties.scalaAsm,
3638
Properties.jlineTerminal,

project/Build.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,7 @@ object Build {
641641
"-Ddotty.tests.classes.tastyCore=" + jars("tasty-core"),
642642
"-Ddotty.tests.classes.compilerInterface=" + findArtifactPath(externalDeps, "compiler-interface"),
643643
"-Ddotty.tests.classes.scalaLibrary=" + findArtifactPath(externalDeps, "scala-library"),
644+
"-Ddotty.tests.tasties.scalaLibrary=" + jars("stdlib-bootstrapped-tasty"),
644645
"-Ddotty.tests.classes.scalaAsm=" + findArtifactPath(externalDeps, "scala-asm"),
645646
"-Ddotty.tests.classes.jlineTerminal=" + findArtifactPath(externalDeps, "jline-terminal"),
646647
"-Ddotty.tests.classes.jlineReader=" + findArtifactPath(externalDeps, "jline-reader"),
@@ -820,7 +821,8 @@ object Build {
820821
// running the compiler, we should always have the bootstrapped
821822
// library on the compiler classpath since the non-bootstrapped one
822823
// may not be binary-compatible.
823-
"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value
824+
"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value,
825+
"stdlib-bootstrapped-tasty" -> (`stdlib-bootstrapped-tasty` / Compile / packageBin).value,
824826
).mapValues(_.getAbsolutePath)
825827
}
826828
}.value,
@@ -848,6 +850,7 @@ object Build {
848850
"scala3-staging" -> (LocalProject("scala3-staging") / Compile / packageBin).value.getAbsolutePath,
849851
"scala3-tasty-inspector" -> (LocalProject("scala3-tasty-inspector") / Compile / packageBin).value.getAbsolutePath,
850852
"tasty-core" -> (LocalProject("tasty-core-bootstrapped") / Compile / packageBin).value.getAbsolutePath,
853+
"stdlib-bootstrapped-tasty" -> (LocalProject("stdlib-bootstrapped-tasty") / Compile / packageBin).value.getAbsolutePath,
851854
)
852855
},
853856

stdlib-bootstrapped-tasty-tests/src/Main.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ object HelloWorld:
1919
testScalaNumberUnderlying()
2020
testArrayOps()
2121
scala.collection.mutable.UnrolledBufferTest.test()
22+
23+
assert(scala.StdlibBootstrappedDummy.thisMethodMustNotBePublished == "This method must not be published in a stable release of the library.")
2224
}
2325

2426
def testScala2UnapplySignatures() = {
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package scala.StdlibBootstrappedDummy
2+
3+
// This method must not be published in a stable release of the library.
4+
// This method can be removed once we add other methods to the stdlib bootstrapped
5+
// and are able to test it using those methods.
6+
inline def thisMethodMustNotBePublished: String =
7+
"This method must not be published in a stable release of the library."

tests/run/testStdlibTasty.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@main def Test: Unit =
2+
assert(scala.StdlibBootstrappedDummy.thisMethodMustNotBePublished == "This method must not be published in a stable release of the library.")

0 commit comments

Comments
 (0)