Skip to content

Commit e16e15f

Browse files
committed
Add documentation
1 parent 32b6ac5 commit e16e15f

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

Diff for: src/doc/rustc/src/tests/index.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,38 @@ unstable-options` flag. See [tracking issue
181181
#64888](https://github.com/rust-lang/rust/issues/64888) and the [unstable
182182
docs](../../unstable-book/compiler-flags/report-time.html) for more information.
183183

184+
#### `--shuffle`
185+
186+
Runs the tests in random order, as opposed to the default alphabetical order.
187+
188+
This may also be specified by setting the `RUST_TEST_SHUFFLE` environment
189+
variable to anything but `0`.
190+
191+
The random number generator seed that is output can be passed to
192+
[`--shuffle-seed`](#--shuffle-seed-seed) to run the tests in the same order
193+
again.
194+
195+
Note that `--shuffle` does not affect whether the tests are run in parallel. To
196+
run the tests in random order sequentially, use `--shuffle --test-threads 1`.
197+
198+
⚠️ 🚧 This option is [unstable](#unstable-options), and requires the `-Z
199+
unstable-options` flag.
200+
201+
#### `--shuffle-seed` _SEED_
202+
203+
Like [`--shuffle`](#--shuffle), but seeds the random number generator with
204+
_SEED_. Thus, calling the test harness with `--shuffle-seed` _SEED_ twice runs
205+
the tests in the same order both times.
206+
207+
_SEED_ is any 64-bit unsigned integer, for example, one produced by
208+
[`--shuffle`](#--shuffle).
209+
210+
This can also be specified with the `RUST_TEST_SHUFFLE_SEED` environment
211+
variable.
212+
213+
⚠️ 🚧 This option is [unstable](#unstable-options), and requires the `-Z
214+
unstable-options` flag.
215+
184216
### Output options
185217

186218
The following options affect the output behavior.
@@ -197,7 +229,7 @@ to the console. Usually the output is captured, and only displayed if the test
197229
fails.
198230

199231
This may also be specified by setting the `RUST_TEST_NOCAPTURE` environment
200-
variable set to anything but `0`.
232+
variable to anything but `0`.
201233

202234
#### `--show-output`
203235

0 commit comments

Comments
 (0)