-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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 --help: clarify --tests and --benches #14675
Conversation
src/bin/cargo/commands/test.rs
Outdated
@@ -41,9 +41,9 @@ pub fn cli() -> Command { | |||
"Test only the specified example", | |||
"Test all examples", | |||
"Test only the specified test target", | |||
"Test all test targets", | |||
"Test all targets that have the `test = true` manifest flag set", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we make them shorter, like
"Test all targets that have the `test = true` manifest flag set", | |
"Test all targets that have `test = true` set", |
and ditto --benches
?
(I still find it confusing though, because it doesn't really test "all" targets. Anyway this PR is already an improvement)
src/bin/cargo/commands/test.rs
Outdated
"Test only the specified bench target", | ||
"Test all bench targets", | ||
"Test all targets in benchmark mode that have the `bench = true` manifest flag set", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what it means to "test a target in benchmark mode",
I don't really know, either. I think "in benchmark mode" should be removed from here and in man pages as well. Basically how I understand it is collecting Cargo targets that have bench = true
and nothing else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "in benchmark mode" is left over from when cargo used to change modes/profiles based on which targets were being built. When we stabilized named profiles, we also changed cargo to stop doing that and use only a single profile.
I would delete it here and in the docs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I have done that. This was duplicated in a bunch of places so I hope this will work.
The term benchmark mode
is now gone entirely; test mode
still appears in a few places -- probably better for one of you to take a look since I am lacking the necessary context here.
I realized the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here it was also talking about "benchmarking in test mode" vs "benchmarking in bench mode" -- I removed it for consistency, or is that still relevant somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
@bors r+ |
☀️ Test successful - checks-actions |
This tries to reduce the confusion expressed in #10936.
I am not sure what it means to "test a target in benchmark mode", this is copied verbatim from
cargo help test
.