about summary refs log tree commit diff
path: root/library/test
diff options
context:
space:
mode:
authorEd Page <eopage@gmail.com>2025-08-11 15:06:32 -0500
committerEd Page <eopage@gmail.com>2025-08-11 15:06:32 -0500
commitc1a31d81031613a52b509f75ddc8cdf7285cc43a (patch)
tree81ef067d59833ea38b5e96fca7a969dbff7e8ed4 /library/test
parent2886b36df4a646dd8d82fb65bf0c9d8d96c1f71a (diff)
downloadrust-c1a31d81031613a52b509f75ddc8cdf7285cc43a.tar.gz
rust-c1a31d81031613a52b509f75ddc8cdf7285cc43a.zip
Deprecate RUST_TEST_* env variables
This is a documentation-only deprecation for now.
Over time, we can
- warn and then remove on use of unstable environment variables
- warn on use of stable environment variables (no plan to remove due to
  compatibility)

Longer term, we expect test runners, like `cargo test`, to provide the
necessary mechanisms for environmental or persistent configuration (e.g.
using cargo config which supports `.cargo/config.toml` as well as
environment variables).

This would include:
- `RUST_TEST_THREADS`
- `RUST_TEST_NOCAPTURE`
- `RUST_TEST_SHUFFLE` (unstable)
- `RUST_TEST_SHUFFLE_SEED` (unstable)

The primary outcomes for this change are
- Reducing the scope of what is expected for custom test harnesses to
  implement
- Reduce the mechanisms that test runners, like `cargo test`, are
  expected to track when they are being bypassed to protect against
  negative interactions, e.g.  `RUST_TEST_NOCAPTURE=1` when json output
  is being read.
Diffstat (limited to 'library/test')
-rw-r--r--library/test/src/cli.rs17
1 files changed, 8 insertions, 9 deletions
diff --git a/library/test/src/cli.rs b/library/test/src/cli.rs
index 8840714a662..1b3f9e2564c 100644
--- a/library/test/src/cli.rs
+++ b/library/test/src/cli.rs
@@ -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: