-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Cargo test ignores test flags when testing specific keyword #10268
Comments
I guess it's #6683 that causes the compilation not respecting the default target selection rules. In contrast, it compiles all bin and test targets in order to filter unit tests. Is this a desired change? Personally I feel like when running |
What do you mean by "cargo should always compile the default targets"? (I'm not so familiar with the lingo) I don't think I rarely use |
Each build command in cargo has its own target selection rule. For example, |
I think in this particular situation, it probably shouldn't be building the It might be a little tricky code-wise. Cargo allows you to override the |
Problem
When running
cargo test xyz
, cargo ignores all test flags in thecargo.toml
file.Steps
cargo init xyz
#[test] fn random{}
to yourmain.rs
Cargo.toml
cargo test
and then typecargo test xyz
Result:

Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: