Skip to content

Commit 72d15f7

Browse files
authored
Move scala2-library-tasty-tests/run tests to tests/run/scala2-library-test (#19383)
The `tests/run/scala2-library-test` test will be tested with the original Scala 2 library JAR and with the Scala 2 library TASTy JAR depending on the `scala2Library` SBT setting.
2 parents c15cc9c + 9895daa commit 72d15f7

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

.github/workflows/ci.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136

137137
- name: Cmd Tests
138138
run: |
139-
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;scala2-library-tasty-tests/run ;scala2-library-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
139+
./project/scripts/sbt ";dist/pack; scala3-bootstrapped/compile; scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/*; scala2-library-tasty-tests/test; scala3-compiler-bootstrapped/scala3CompilerCoursierTest:test"
140140
./project/scripts/cmdTests
141141
./project/scripts/bootstrappedOnlyCmdTests
142142
@@ -547,7 +547,7 @@ jobs:
547547

548548
- name: Test
549549
run: |
550-
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/* ;scala2-library-tasty-tests/run ;scala2-library-tasty-tests/test"
550+
./project/scripts/sbt ";dist/pack ;scala3-bootstrapped/compile ;scala3-bootstrapped/test ;sbt-test/scripted scala2-compat/*; scala2-library-tasty-tests/test"
551551
./project/scripts/cmdTests
552552
./project/scripts/bootstrappedOnlyCmdTests
553553

docs/_docs/contributing/testing.md

+1-8
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,7 @@ to load the TASTy and the runtime to load the original classfiles.
164164

165165
The library is compiled in `scala2-library-bootstrapped` with TASTy and classfiles.
166166
These classfiles should not be used. The `scala2-library-tasty` project repackages the
167-
JAR `scala2-library-bootstrapped` to only keep TASTy files. The `scala2-library-tasty-tests` provides some basic tests using the library TASTy JAR.
168-
169-
```
170-
$ sbt
171-
> scala2-library-tasty/compile
172-
> scala2-library-tasty-tests/run
173-
> scala2-library-tasty-tests/test
174-
```
167+
JAR `scala2-library-bootstrapped` to only keep TASTy files.
175168

176169
We can enable this library in the build using the SBT setting `useScala2LibraryTasty`. This setting can only be used by bootstrapped compiler tests and is currently only supported for `test` (or `testCompilation`) and `scalac` (or `run`).
177170

scala2-library-tasty-tests/src/Main.scala renamed to tests/run/scala2-library-test/Main.scala

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
package hello
1+
// This tests language features that have a special handling in the Scala 2 library TASTy.
2+
// These should behave the same way from if compiled against the Scala 2 library class files ot TASTy.
23

34
import scala.util.*
45
import scala.compiletime.testing.typeChecks
56

67
enum Color:
78
case Red, Green, Blue
89

9-
object HelloWorld:
10+
object Test:
1011
def main(args: Array[String]): Unit = {
1112
println("hello 2.13 library bootstrapped")
1213
println(Color.Red)
@@ -74,4 +75,4 @@ object HelloWorld:
7475
new collection.ArrayOps[String](Array[String]("foo")).exists(x => true)
7576
}
7677

77-
end HelloWorld
78+
end Test

0 commit comments

Comments
 (0)