Description
Summary
./x test clippy
does not support filtering tests the way other test suites do, by passing --test-args
.
Command used
./x test clippy --stage 1 --test-args line
Expected 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:
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?