Skip to content

Commit 732dc47

Browse files
phanschmark-i-m
authored andcommitted
Mention incremental compilation in testing chapter
The `--incremental` flag was only mentioned in [how_to_build_and_run] so far. Faster testing means faster iteration and perhaps even more added tests. [how_to_build_and_run]: https://rust-lang-nursery.github.io/rustc-guide/how-to-build-and-run.html
1 parent f72ba71 commit 732dc47

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/tests/running.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,27 @@ Under the hood, the test runner invokes the standard rust test runner
5959
(the same one you get with `#[test]`), so this command would wind up
6060
filtering for tests that include "issue-1234" in the name.
6161

62-
Often, though, it's easier to just run the test by hand. Most tests are
62+
## Using incremental compilation
63+
64+
You can further enable the `--incremental` flag to save additional time in subsequent rebuilds:
65+
66+
```bash
67+
> ./x.py test --stage 1 src/test/ui --incremental --test-args issue-1234
68+
```
69+
70+
If you don't want to include the flag with every command, you can enable it in the `config.toml`, too:
71+
72+
```toml
73+
# Whether to always use incremental compilation when building rustc
74+
incremental = true
75+
```
76+
77+
Note that incremental compilation will use more disk space than usual. If disk space is a
78+
concern for you, you might want to check the size of the `build` directory from time to time.
79+
80+
## Running tests manually
81+
82+
Sometimes it's easier and faster to just run the test by hand. Most tests are
6383
just `rs` files, so you can do something like
6484

6585
```bash

0 commit comments

Comments
 (0)