Skip to content

Commit 23eab28

Browse files
committed
sync the 'std' invocation in the README with that on CI
1 parent c920a98 commit 23eab28

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ Every night, a CI cron job runs the tests against the latest nightly, to make su
99
To run the tests yourself, make sure you have Miri installed (`rustup component add miri`) and then run:
1010

1111
```shell
12+
# Unit tests and integration tests
1213
./run-test.sh core --lib --tests
1314
./run-test.sh alloc --lib --tests
14-
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh std --lib --tests -- time::
15+
MIRIFLAGS="-Zmiri-disable-isolation" ./run-test.sh std --lib --tests -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::
16+
# Doc tests
17+
MIRIFLAGS="-Zmiri-ignore-leaks" ./run-test.sh core --doc
18+
MIRIFLAGS="-Zmiri-ignore-leaks" ./run-test.sh alloc --doc
19+
MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" ./run-test.sh std --doc -- --skip fs:: --skip net:: --skip process:: --skip sys::pal::
1520
```
1621

1722
This will run the test suite of the standard library of your current toolchain.
18-
`--lib --tests` means that doc tests are skipped; those should use separate Miri flags as there are some (expected) memory leaks.
19-
Use `--doc` to run only doc tests.
23+
It will probably take 1-2h, so if you have specific parts of the standard library you want to test, use the usual `cargo test` filter mechanisms to narrow this down:
24+
all arguments are passed to `cargo test`, so arguments after `--` are passed to the test runner as usual.
25+
Doc tests have to be run separately as there are some (expected) memory leaks.
2026
For `std`, we cannot run *all* tests since they will use networking and file system APIs that we do not support.
2127

2228
If you are working on the standard library and want to check that the tests pass with your modifications, set `MIRI_LIB_SRC` to the `library` folder of the checkout you are working in:
@@ -30,12 +36,5 @@ Then the test suite will be compiled from the standard library in that directory
3036
Make sure that is as close to your rustup default toolchain as possible, as the toolchain will still be used to build that standard library and its test suite.
3137
If you are getting strange build errors, `cargo clean` can often fix that.
3238

33-
`run-test` also accepts parameters that are passed to `cargo test` and the test runner,
34-
and `MIRIFLAGS` can be used as usual to pass parameters to Miri:
35-
36-
```shell
37-
MIRIFLAGS="-Zmiri-ignore-leaks -Zmiri-disable-isolation" ./run-test.sh alloc --doc -- --skip vec
38-
```
39-
4039
If you want to know how long each test took to execute, add `2>&1 | ts -m -i '%.s '` to the end of the command,
4140
or use the test flags `-Zunstable-options --report-time` (the latter option also requires `-Zmiri-disable-isolation` in the Miri flags).

0 commit comments

Comments
 (0)