rust/library/test/src
Ed Page aa8670f6f8 fix(test): Expose '--no-capture', deprecating '--nocapture'
This improves consistency with commonly expected CLI conventions,
avoiding a common stutter people make when running tests (trying what
they expect and then having to check the docs to then user whats
accepted).

An alternative could have been to take a value, like `--capture <value>` (e.g. `pytest` does this).
Overall, we're shifting focus for features to custom test harnesses (see #134283).
Most of `pytest`s modes will likely be irrelevant in that situation.
As for the rest, its too early to tell which, if any, may be relevant,
so we're sticking with this small, quality of life improvement.

By deprecating `--nocapture`, we intend that custom test harnesses do
not need to support it for reasons outside of their own compatibility
requirements, much like the deprecation in #134283

I'm punting for now on the naming of `RUST_TEST_NOCAPTURE`.
I feel like T-testing-devex should do a wider look at environment
variables role in lib`test` before evaluating whether to
- Deprecate it in favor of the user passing CLI flags or the test runner
  providing its own config
- Deprecate in favor of `RUST_TEST_NO_CAPTURE`
- Deprecate in favor of `RUST_TEST_CAPTURE`

Other CLI flags were evaluated for casing consistency:
- `--logfile` has the same problem but was deprecated in #134283

Fixes #133073
2025-04-17 13:30:59 -05:00
..
formatters Use correct error message casing for io::const_errors 2025-02-28 17:50:38 +01:00
helpers test: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
stats test: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
term Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDenton 2025-02-17 06:37:37 +01:00
bench.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
cli.rs fix(test): Expose '--no-capture', deprecating '--nocapture' 2025-04-17 13:30:59 -05:00
console.rs fix(libtest): Enable Instant on Emscripten targets 2025-02-09 23:51:54 +03:00
event.rs Do fewer passes and generally be more efficient when filtering tests 2022-10-27 21:34:56 -04:00
lib.rs libtest: Pass the test's panic payload as Option instead of Result 2025-04-08 13:28:05 +10:00
options.rs test: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
stats.rs Fix doc nits 2024-07-26 13:26:33 +01:00
term.rs test: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
test_result.rs Report span of test when should_panic test failed 2025-04-14 10:36:11 +08:00
tests.rs Remove a bunch of emscripten test ignores 2025-01-24 09:25:34 +00:00
time.rs test: add #![warn(unreachable_pub)] 2025-01-20 18:46:29 +01:00
types.rs Reduce merged doctest source code size 2024-08-13 20:14:56 +02:00