Skip to content

Commit 5098ad3

Browse files
committed
Use Scala 2 library TASTy in compilation tests
1 parent 035202b commit 5098ad3

File tree

6 files changed

+19
-1
lines changed

6 files changed

+19
-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: 3 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"),
@@ -829,7 +830,8 @@ object Build {
829830
// running the compiler, we should always have the bootstrapped
830831
// library on the compiler classpath since the non-bootstrapped one
831832
// may not be binary-compatible.
832-
"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value
833+
"scala3-library" -> (`scala3-library-bootstrapped` / Compile / packageBin).value,
834+
"stdlib-bootstrapped-tasty" -> (`stdlib-bootstrapped-tasty` / Compile / packageBin).value,
833835
).mapValues(_.getAbsolutePath)
834836
}
835837
}.value,

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)