You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_docs/contributing/testing.md
+28Lines changed: 28 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -155,6 +155,34 @@ To run `testCompilation` on a bootstrapped Dotty compiler, use
155
155
Some tests can only be run in bootstrapped compilers; that includes all tests
156
156
with `with-compiler` in their name.
157
157
158
+
### Scala 2 library TASTy tests
159
+
160
+
Usually we use the Scala 2 library JAR (with classfiles) generated by Scala 2. We can
161
+
also use a special version of the library that we generate with only TASTy files. This
162
+
JAR is added to the classpath before the Scala 2 library JAR. This allows the compiler
163
+
to load the TASTy and the runtime to load the original classfiles.
164
+
165
+
The library is compiled in `scala2-library-bootstrapped` with TASTy and classfiles.
166
+
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
+
```
175
+
176
+
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`).
177
+
178
+
```
179
+
$ sbt
180
+
> set ThisBuild/Build.useScala2LibraryTasty := true
0 commit comments