Skip to content

Commit 0acf3ba

Browse files
committed
Adjust command prompts and improve description of testOnly syntax
1 parent 36d96f8 commit 0acf3ba

File tree

5 files changed

+36
-14
lines changed

5 files changed

+36
-14
lines changed

docs/docs/contributing/eclipse.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ your Eclipse distribution of choice and enable the Scala IDE from the Eclipse Ma
1212
1. Clone Dotty's repository from Github (and run `sbt managedSources` as described in
1313
[Getting Started](getting-started.md))
1414
2. Generate the Eclipse configuration files:
15-
```
16-
sbt eclipse
15+
```shell
16+
$ sbt eclipse
1717
```
1818

1919
- Note: It is recommended to change the default output folder (in `Properties > java

docs/docs/contributing/getting-started.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ There are also bash scripts that can be used in the same way. Assuming that you
3232
the following line on your `.bash_profile`:
3333

3434
```shell
35-
export PATH=$HOME/dotty/bin:$PATH
35+
$ export PATH=$HOME/dotty/bin:$PATH
3636
```
3737

3838
and you will be able to run the corresponding commands directly from your console:
3939

4040
```shell
4141
# Compile code using Dotty
42-
dotc tests/pos/HelloWorld.scala
42+
$ dotc tests/pos/HelloWorld.scala
4343

4444
# Run it with the proper classpath
45-
dotr HelloWorld
45+
$ dotr HelloWorld
4646
```
4747

4848

docs/docs/contributing/intellij-idea.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Setup
88

99
You can setup IntelliJ [IDEA >= 2016.1](https://www.jetbrains.com/idea/nextversion) to run Dotty.
1010

11-
Assuming you have cloned dotty's repository from Github (and run `sbt managedSources` as described in [Getting Started](getting-started.md))
11+
Assuming you have cloned dotty's repository from Github (and run `sbt managedSources` as described in [Getting Started](getting-started.md)),
1212
you can now proceed with importing it to IDEA by selecting the
1313
corresponding option from the startup menu. Navigate on the corresponding directory and select it. Next, you need
1414
to select the model of the import and as the screenshot shows, select SBT.

docs/docs/contributing/testing.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,38 +20,59 @@ scanning and message errors.
2020
To run all tests in e.g., for the compiler test-suite you can write:
2121

2222
```bash
23+
$ sbt
2324
> dotty-compiler/test
2425
```
2526

2627
To run a single test class you use `testOnly` and the fully qualified class name.
2728
For example:
2829

2930
```bash
30-
> dotty-compiler/testOnly dotty.tools.dotc.transform.TreeTransformerTest
31+
> testOnly dotty.tools.dotc.transform.TreeTransformerTest
3132
```
3233

33-
You can further restrict the executed tests to a subset of methods by appending ``-- *method_name``
34-
as in the example below:
34+
The test command follows a regular expression-based syntax `testOnly * -- *`.
35+
The right-hand side picks a range of names for methods and the left-hand side picks a range of class names and their
36+
fully-qualified paths.
37+
38+
Consequently, you can restrict the aforementioned executed test to a subset of methods by appending ``-- *method_name``.
39+
The example below picks up all methods with the name `canOverwrite`:
40+
41+
```bash
42+
> testOnly dotty.tools.dotc.transform.TreeTransformerTest -- *canOverwrite
43+
```
44+
45+
Additionally, you can run all tests named `method_name`, in any class, without providing a class name:
3546

3647
```bash
37-
> dotty-compiler/testOnly dotty.tools.dotc.transform.TreeTransformerTest -- *canOverwrite
48+
> testOnly -- *canOverwrite
49+
```
50+
51+
You can also run all paths of classes of a certain name:
52+
53+
```bash
54+
> testOnly *.TreeTransformerTest
3855
```
3956

4057
## Integration tests
4158
These tests are Scala source files expected to compile with Dotty (pos tests),
4259
along with their expected output (run tests) or errors (neg tests).
4360

44-
All of these tests are contained in the `./tests/*` directories.
61+
All of these tests are contained in the `./tests/*` directories and can be run with the `vulpix` command.
4562

4663
Currently to run these tests you need to invoke from sbt:
4764

4865
```bash
49-
> testOnly dotty.tools.dotc.CompilationTests
66+
$ sbt
67+
> vulpix
5068
```
5169

52-
It is also possible to run tests filtered by using the `vulpix` command, again from sbt:
70+
(which is effectively the same with `testOnly dotty.tools.dotc.CompilationTests`)
71+
72+
It is also possible to run tests filtered, again from sbt:
5373

5474
```bash
75+
$ sbt
5576
> vulpix i2147.scala
5677
```
5778

docs/docs/contributing/workflow.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,14 @@ There is no power mode for the REPL yet, but you can inspect types with the
4444
type stealer:
4545

4646
```bash
47+
$ sbt
4748
> repl
4849
scala> import dotty.tools.DottyTypeStealer._; import dotty.tools.dotc.core._; import Contexts._,Types._
4950
```
5051

5152
Now, you can define types and access their representation. For example:
5253

53-
```bash
54+
```scala
5455
scala> val s = stealType("class O { type X }", "O#X")
5556
scala> implicit val ctx: Context = s._1
5657
scala> val t = s._2(0)

0 commit comments

Comments
 (0)