Skip to content

Deprecate RUST_TEST_* env variables #145269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions library/test/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,17 @@ tests whose names contain the filter are run. Multiple filter strings may
be passed, which will run all tests matching any of the filters.

By default, all tests are run in parallel. This can be altered with the
--test-threads flag or the RUST_TEST_THREADS environment variable when running
tests (set it to 1).
--test-threads flag when running tests (set it to 1).

By default, the tests are run in alphabetical order. Use --shuffle or set
RUST_TEST_SHUFFLE to run the tests in random order. Pass the generated
"shuffle seed" to --shuffle-seed (or set RUST_TEST_SHUFFLE_SEED) to run the
tests in the same order again. Note that --shuffle and --shuffle-seed do not
affect whether the tests are run in parallel.
By default, the tests are run in alphabetical order. Use --shuffle to run
the tests in random order. Pass the generated "shuffle seed" to
--shuffle-seed to run the tests in the same order again. Note that
--shuffle and --shuffle-seed do not affect whether the tests are run in
parallel.

All tests have their standard output and standard error captured by default.
This can be overridden with the --no-capture flag or setting RUST_TEST_NOCAPTURE
environment variable to a value other than "0". Logging is not captured by default.
This can be overridden with the --no-capture flag to a value other than "0".
Logging is not captured by default.

Test Attributes:

Expand Down
8 changes: 4 additions & 4 deletions src/doc/rustc/src/tests/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ Sets the number of threads to use for running tests in parallel. By default,
uses the amount of concurrency available on the hardware as indicated by
[`available_parallelism`].

This can also be specified with the `RUST_TEST_THREADS` environment variable.
Deprecated: this can also be specified with the `RUST_TEST_THREADS` environment variable.

#### `--force-run-in-process`

Expand All @@ -186,7 +186,7 @@ docs](../../unstable-book/compiler-flags/report-time.html) for more information.

Runs the tests in random order, as opposed to the default alphabetical order.

This may also be specified by setting the `RUST_TEST_SHUFFLE` environment
Deprecated: this may also be specified by setting the `RUST_TEST_SHUFFLE` environment
variable to anything but `0`.

The random number generator seed that is output can be passed to
Expand All @@ -209,7 +209,7 @@ the tests in the same order both times.
_SEED_ is any 64-bit unsigned integer, for example, one produced by
[`--shuffle`](#--shuffle).

This can also be specified with the `RUST_TEST_SHUFFLE_SEED` environment
Deprecated: this can also be specified with the `RUST_TEST_SHUFFLE_SEED` environment
variable.

⚠️ 🚧 This option is [unstable](#unstable-options), and requires the `-Z
Expand All @@ -231,7 +231,7 @@ Does not capture the stdout and stderr of the test, and allows tests to print
to the console. Usually the output is captured, and only displayed if the test
fails.

This may also be specified by setting the `RUST_TEST_NOCAPTURE` environment
Deprecated: this may also be specified by setting the `RUST_TEST_NOCAPTURE` environment
variable to anything but `0`.

`--nocapture` is a deprecated alias for `--no-capture`.
Expand Down
Loading