@@ -47,6 +47,19 @@ the debuginfo test suite:
47
47
> ./x.py test --stage 1 src/test/debuginfo
48
48
```
49
49
50
+ If you only need to test a specific subdirectory of tests for any
51
+ given test suite, you can pass that directory to ` x.py test ` :
52
+
53
+ ``` bash
54
+ > ./x.py test --stage 1 src/test/ui/const-generics
55
+ ```
56
+
57
+ Likewise, you can test a single file by passing its path:
58
+
59
+ ``` bash
60
+ > ./x.py test --stage 1 src/test/ui/const-generics/const-test.rs
61
+ ```
62
+
50
63
### Run only the tidy script
51
64
52
65
``` bash
@@ -82,16 +95,18 @@ work well with procedural macros or custom derive tests.
82
95
## Running an individual test
83
96
84
97
Another common thing that people want to do is to run an ** individual
85
- test** , often the test they are trying to fix. One way to do this is
86
- to invoke ` x.py ` with the ` --test-args ` option:
98
+ test** , often the test they are trying to fix. As mentioned earlier,
99
+ you may pass the full file path to achieve this, or alternatively one
100
+ may invoke ` x.py ` with the ` --test-args ` option:
87
101
88
102
``` bash
89
103
> ./x.py test --stage 1 src/test/ui --test-args issue-1234
90
104
```
91
105
92
106
Under the hood, the test runner invokes the standard rust test runner
93
107
(the same one you get with ` #[test] ` ), so this command would wind up
94
- filtering for tests that include "issue-1234" in the name.
108
+ filtering for tests that include "issue-1234" in the name. (Thus
109
+ ` --test-args ` is a good way to run a collection of related tests.)
95
110
96
111
## Using incremental compilation
97
112
0 commit comments