Add --quiet flag to suppress verbose run-make output for passing tests#154587
Add --quiet flag to suppress verbose run-make output for passing tests#154587Ayuse wants to merge 4 commits intorust-lang:mainfrom
Conversation
|
r? @wesleywiser rustbot has assigned @wesleywiser. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
When using `--no-capture` with `panic=abort` test suites, every passing test dumps its full command output, flooding the terminal. This adds a `--quiet` flag so that `./x test --no-capture --quiet` suppresses that output for passing tests while still showing output for failures.
This comment has been minimized.
This comment has been minimized.
ee8706b to
d7cd840
Compare
This comment has been minimized.
This comment has been minimized.
|
r? @jieyouxu |
| cmd.inspect(|std_cmd| { | ||
| eprintln!("{std_cmd:?}"); | ||
| }); | ||
| eprintln!("output status: `{}`", output.status()); | ||
| eprintln!("=== STDOUT ===\n{}\n\n", output.stdout_utf8()); | ||
| eprintln!("=== STDERR ===\n{}\n\n", output.stderr_utf8()); | ||
| if !cmd.get_context().is_empty() { | ||
| eprintln!("Context:\n{}", cmd.get_context()); | ||
| } |
There was a problem hiding this comment.
Question: wait, why is the body of verbose_print_command inlined here?
| /// suppress verbose subprocess output for successful run-make tests (useful with | ||
| /// --no-capture for panic=abort test suites like cg_clif) | ||
| quiet: bool, |
There was a problem hiding this comment.
Suggestion: I thought about this flag name a bit more. With #154616 in mind, I want to reserve --quiet for the more general operation of "suppressing certain bootstrap build output". I don't want to use --quiet for the more niche use cases of suppressing run-make verbose subprocess output.
Can you change this flag and config name to sth more like --verbose-run-make-subprocess-output? I would expect that:
- It is normally
true(preserve previous default), but - For cg_clif we want to explicitly set
--verbose-run-make-subprocess-output=false(in a follow-up PR).
I'm fully aware that:
- The flag name is extremely specific, but that's my intention: when and if we need to recycle this flag somewhere else, I want us to re-evaluate the two places if it makes sense to recycle it as-is.
- The flag name is really long. Also intentional, because this usage is quite niche (cg_clif/cg_* backend specific). General rule of thumb for flag name length is proportional to how often/common we anticipate it to be used.
|
Reminder, once the PR becomes ready for a review, use |
| /// suppress verbose subprocess output for successful run-make tests (useful with | ||
| /// --no-capture for panic=abort test suites like cg_clif) | ||
| quiet: bool, |
There was a problem hiding this comment.
Suggestion: please also document the new ./x test flag (prob. --verbose-run-make-subprocess-output) in rustc-dev-guide (fine to do so in the subtree in this PR)
Adds
--quietflag to./x testand compiletest./x test --no-capture --quietsuppresses verbose subprocess output for passing run-make tests--quietThis addresses the request from @bjorn3 which needs
--no-capture(due topanic=abort) but doesn't want outputdumped for every passing test.
Fixes Retain ability to not verbose-dump cmd/output for successful tests even when
--nopcaturefor cg_clif #154069Test plan
./x test tests/run-make/bare-outfile --no-capture --force-rerun— verbose output for passing test./x test tests/run-make/bare-outfile --no-capture --quiet --force-rerun— no verbose output for passing test--quiet