Skip to content

Update testing docs (dotty-compiler-bootstrapped -> scala3-compiler-bootstrapped) #12594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 25, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions docs/docs/contributing/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The entire suite of tests can be run using the bootstrapped compiler as follows:

```bash
$ sbt
> dotty-bootstrapped/test
> scala3-bootstrapped/test
```

There are currently several forms of tests in Dotty. These can be split into
Expand All @@ -32,7 +32,7 @@ To run all tests in e.g., for the compiler test-suite you can write:

```bash
$ sbt
> dotty-compiler/test
> scala3-compiler/test
```

To run a single test class you use `testOnly` and the fully qualified class name.
Expand Down Expand Up @@ -130,7 +130,7 @@ $ sbt
### Bootstrapped-only tests

To run `testCompilation` on a bootstrapped Dotty compiler, use
`dotty-compiler-bootstrapped/testCompilation` (with the same syntax as above).
`scala3-compiler-bootstrapped/testCompilation` (with the same syntax as above).
Some tests can only be run in bootstrapped compilers; that includes all tests
with `with-compiler` in their name.

Expand All @@ -144,10 +144,15 @@ with `with-compiler` in their name.
> testCompilation --from-tasty
```

This mode can be run under `dotty-compiler-bootstrapped/testCompilation` to test on a bootstrapped Dotty compiler.
This mode can be run under `scala3-compiler-bootstrapped/testCompilation` to test on a bootstrapped Dotty compiler.

### SemanticDB tests

```bash
$ sbt
> scala3-compiler-bootstrapped/testOnly dotty.tools.dotc.semanticdb.SemanticdbTests
```

The output of the `extractSemanticDB` phase, enabled with `-Xsemanticdb` is tested with the bootstrapped JUnit test
`dotty.tools.dotc.semanticdb.SemanticdbTests`. It uses source files in `tests/semanticdb/expect` to generate
two kinds of output file that are compared with "expect files": placement of semanticdb symbol occurrences inline in
Expand All @@ -157,5 +162,5 @@ Expect files are used as regression tests to detect changes in the compiler.

The test suite will create a new file if it detects any difference, which can be compared with the
original expect file, or if the user wants to globally replace all expect files for semanticdb they can use
`dotty-compiler-bootstrapped/test:runMain dotty.tools.dotc.semanticdb.updateExpect`, and compare the changes via version
`scala3-compiler-bootstrapped/test:runMain dotty.tools.dotc.semanticdb.updateExpect`, and compare the changes via version
control.