-
-
Notifications
You must be signed in to change notification settings - Fork 15k
./x test clippy does not honor --test-args #143824
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-clippyRelevant to the Clippy team.Relevant to the Clippy team.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-clippyRelevant to the Clippy team.Relevant to the Clippy team.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
./x test clippydoes not support filtering tests the way other test suites do, by passing--test-args.Command used
./x test clippy --stage 1 --test-args lineExpected behaviour
Only the tests with the word "line" in the file get run. (C.f.
./x test miri -- atomic).Actual behaviour
All tests get run.
More details
The logic that makes this work in Miri is here:
rust/src/bootstrap/src/core/build_steps/test.rs
Line 685 in d617902
There's something in clippy that seems related but I don't understand any part of it:
rust/src/bootstrap/src/core/build_steps/test.rs
Lines 792 to 807 in d617902
Also the logic inside clippy's ui test runner is odd -- usually, Rust test suites take their test filter form the command-line arguments. Here's Miri doing that:
rust/src/tools/miri/tests/ui.rs
Line 159 in db617af
We don't even have to do anything, ui_test just does this by default.
Clippy also does this...
rust/src/tools/clippy/tests/compile-test.rs
Line 112 in 3ee4325
... but then it overwrites the resulting filter for some reason:
rust/src/tools/clippy/tests/compile-test.rs
Line 118 in 3ee4325
Is there a reason clippy makes this different from every other crate I have ever seen?
Cc @flip1995 @oli-obk @Kobzol