-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Make the unit-test framework check RUST_TEST_TASKS over RUST_THREADS. #8823
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
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@huonw needs rebase |
bors
added a commit
that referenced
this pull request
Aug 29, 2013
bors
added a commit
that referenced
this pull request
Aug 30, 2013
The only user-facing change is handling non-integer (and zero) `RUST_THREADS` more nicely: ``` $ RUST_THREADS=x rustc # old You've met with a terrible fate, haven't you? fatal runtime error: runtime tls key not initialized Aborted $ RUST_THREADS=x ./x86_64-unknown-linux-gnu/stage2/bin/rustc # new You've met with a terrible fate, haven't you? fatal runtime error: `RUST_THREADS` is `x`, should be a positive integer Aborted ``` The other changes are converting some `for .. in range(x,y)` to `vec::from_fn` or `for .. in x.iter()` as appropriate; and removing a chain of (seemingly) unnecessary pointer casts. (Also, fixes a typo in `extra::test` from #8823.)
xFrednet
pushed a commit
to xFrednet/rust
that referenced
this pull request
May 21, 2022
Improve "unknown field" error messages Fixes rust-lang#8806 Sample output: ``` error: error reading Clippy's configuration file `/home/smoelius/github/smoelius/rust-clippy/clippy.toml`: unknown field `foobar`, expected one of allow-expect-in-tests enable-raw-pointer-heuristic-for-send standard-macro-braces allow-unwrap-in-tests enforced-import-renames third-party allowed-scripts enum-variant-name-threshold too-large-for-stack array-size-threshold enum-variant-size-threshold too-many-arguments-threshold avoid-breaking-exported-api literal-representation-threshold too-many-lines-threshold await-holding-invalid-types max-fn-params-bools trivial-copy-size-limit blacklisted-names max-include-file-size type-complexity-threshold cargo-ignore-publish max-struct-bools unreadable-literal-lint-fractions cognitive-complexity-threshold max-suggested-slice-pattern-length upper-case-acronyms-aggressive cyclomatic-complexity-threshold max-trait-bounds vec-box-size-threshold disallowed-methods msrv verbose-bit-mask-threshold disallowed-types pass-by-value-size-limit warn-on-all-wildcard-imports doc-valid-idents single-char-binding-names-threshold at line 1 column 1 ``` You can test this by (say) adding `foobar = 42` to Clippy's root `clippy.toml` file, and running `cargo run --bin cargo-clippy`. Note that, to get the terminal width, this PR adds `termize` as a dependency to `cargo-clippy`. However, `termize` is also [how `rustc_errors` gets the terminal width](https://github.com/rust-lang/rust/blob/481db40311cdd241ae4d33f34f2f75732e44d8e8/compiler/rustc_errors/src/emitter.rs#L1607). So, hopefully, this is not a dealbreaker. r? `@xFrednet` changelog: Enhancements: the "unknown field" error messages for config files now wraps the field names.
epage
added a commit
to epage/rust
that referenced
this pull request
Aug 11, 2025
Like with rust-lang#139224, 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. For testing-devex FCP, see rust-lang/testing-devex-team#10 Fixes rust-lang/testing-devex-team#10 History ------- At each step, I could not find evidence of design discussions on whether to support CLI, env, or both. The first env variable seems to come from the fact that it was being forked out of an existing env variable that had a much wider scope. At best, this seems like a way to offer a more persistent configuration for these flags but environment variables hidden away in libtest is a bit clunky and this seems like the wrong layer to handle this problem. **Originally:** `RUST_THREADS` was respected by the Rust runtime and libextra/test got this for free **2013:** rust-lang#7335 suggested splitting `RUST_TEST_TASKS` out of `RUST_THREADS`. In that issue and the implementation (rust-lang#8823). **2014:** rust-lang#13374 ask for support to disable capturing of stdout/stderr. `--nocapture` and `RUST_TEST_NOCAPTURE` were added together. **2015:** rust-lang#23525 renamed `RUST_TEST_TASKS` to `RUST_TEST_THREADS` **2016:** rust-lang#25636 asked to configure `RUST_TEST_THREADS` via `--test-threads` which was implemented in rust-lang#35414 **2021:** rust-lang#85440 asked for test randomization which was implemented in rust-lang#89082, adding `--shuffle` / RUST_TEST_SHUFFLE` and `--shuffle-seed SEED` / `RUST_TEST_SHUFFLE_SEED` Potentially relevant issues --------------------------- - rust-lang#74845
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #7335.