Skip to content
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

Add --show-output to cargo help test and cargo test --help #12530

Open
matthewelmer opened this issue Aug 19, 2023 · 4 comments
Open

Add --show-output to cargo help test and cargo test --help #12530

matthewelmer opened this issue Aug 19, 2023 · 4 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-test S-triage Status: This issue is waiting on initial triage.

Comments

@matthewelmer
Copy link

Problem

When users would like to show the output of their unit tests, they often end up at this Stackoverflow post, and even then, they might miss --show-output if they don't scroll down a bit. Of course, the option is also mentioned in the book, but given that the book isn't designed to be a reference manual, it's not the first place one might check.

Proposed Solution

I think that if we add --show-output to cargo help test and cargo test --help, users might be able to find what they need a little quicker and/or without internet access.

Notes

Anecdotally, when I was trying to figure out how to make the output show, I ran cargo test --help, saw nothing that caught my eye (--nocapture is an alternative, but its name doesn't make that obvious), and proceeded to run an internet search that landed me at the aforementioned Stackoverflow post.

@matthewelmer matthewelmer added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Aug 19, 2023
@epage
Copy link
Contributor

epage commented Aug 21, 2023

#11702 is just slightly related in that it will help if you do cargo test --show-output, it will tell you to run cargo test -- --show-output.

@epage
Copy link
Contributor

epage commented Aug 21, 2023

Anecdotally, when I was trying to figure out how to make the output show, I ran cargo test --help, saw nothing that caught my eye (--nocapture is an alternative, but its name doesn't make that obvious), and proceeded to run an internet search that landed me at the aforementioned Stackoverflow post.

One limitation is that cargo test --help can't guarentee what test harness is being used by the test which is one reason to delegate help output to cargo test -- --help.

@epage
Copy link
Contributor

epage commented Aug 21, 2023

Anecdotally, when I was trying to figure out how to make the output show, I ran cargo test --help, saw nothing that caught my eye (--nocapture is an alternative, but its name doesn't make that obvious), and proceeded to run an internet search that landed me at the aforementioned Stackoverflow post.

This isn't too clear to me. This makes it sound like --nocapture was listed in cargo test --help but I'm not seeing it. Did you mean cargo test -- --help? But then that should show --show-output.

@matthewelmer
Copy link
Author

Anecdotally, when I was trying to figure out how to make the output show, I ran cargo test --help, saw nothing that caught my eye (--nocapture is an alternative, but its name doesn't make that obvious), and proceeded to run an internet search that landed me at the aforementioned Stackoverflow post.

This isn't too clear to me. This makes it sound like --nocapture was listed in cargo test --help but I'm not seeing it. Did you mean cargo test -- --help? But then that should show --show-output.

Oh, huh! I guess that's not there either!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-test S-triage Status: This issue is waiting on initial triage.
Projects
Status: No status
Development

No branches or pull requests

2 participants