-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Shorter output for rustc --test
binaries.
#31887
Conversation
servo/rustc-test@e3a9adc Also proposed upstream at rust-lang/rust#31887
4a32a10
to
7c288b0
Compare
servo/rustc-test@e3a9adc Also proposed upstream at rust-lang/rust#31887
1598260
to
0412918
Compare
I personally think that the ship has unfortunately sailed on changing libtest too much right now. We've talked a bit about custom test frameworks/runners recently and this would certainly be easily fixed by a custom test runner, and until that time we may just not be able to change the format in terms of stability In terms of personal opinion, I can see the value in having a more terse output but I prefer to see the longer output. It allows easily diffing two runs to see which test deadlocked, in single threaded mode it shows which test is running (to see what deadlocked), etc. |
Regarding stability: would it be better if this new output was not the default? Maybe with a Regarding preference: that’s why the old output is still available with |
6124641
to
f4d71e2
Compare
Oh last time I meant to cc @rust-lang/tools I don't think |
Re For what it’s worth, I’ve applied this to https://crates.io/crates/rustc-test. You can see it in action in https://travis-ci.org/servo/html5ever/jobs/111813368#L281 |
Ok, we discussed this in the tools triage meeting today, and the conclusion was that we probably want to leave the output the same as-is today, but we're fine with a flag being added to enable this output. Would you be ok with that @SimonSapin? |
Alright. I’ve amended the commit to flip the default. |
$(call RUN,test-ignore-cfg) | grep 'shouldnotignore ... ok' | ||
$(call RUN,test-ignore-cfg) | grep 'shouldignore ... ignored' | ||
$(call RUN,test-ignore-cfg) --verbose | grep 'shouldnotignore ... ok' | ||
$(call RUN,test-ignore-cfg) --verbose | grep 'shouldignore ... ignored' |
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.
This and the previous test can be reverted to what they once were, right?
Thanks! Can you also add a test for this switch + output? |
A program created with `rustc --test` prints at least one line per test. This can be very verbose, especially with [data-driven tests]( https://internals.rust-lang.org/t/test-and-external-test-harnesses/3145) when hundreds or thousands of tests is not rare. This adds a `-q` or `--quiet` option that changes the output to one character instead of one line per test (except metrics and benchmarks results which have additional data to show): ``` Running target/debug/wpt-75c594dc1e6e6187 running 314 tests .............................................................................. .............................................................................. .............................................................................. .............................................................................. .. test result: ok. 314 passed; 0 failed; 0 ignored; 0 measured ``` This is a breaking change since the `test::TestOpts` struct now has one more field.
Done. |
Shorter output for `rustc --test` binaries. Until now, a program created with `rustc --test` prints at least one line per test. This can be very verbose, especially with [data-driven tests](https://internals.rust-lang.org/t/test-and-external-test-harnesses/3145) when hundreds or thousands of tests is not rare. This changes the default output to one character per test (except metrics and benchmarks results which have additional data to show): ``` Running target/debug/wpt-75c594dc1e6e6187 running 314 tests .............................................................................. .............................................................................. .............................................................................. .............................................................................. .. test result: ok. 314 passed; 0 failed; 0 ignored; 0 measured ``` <s>The previous behavior is available by passing `--verbose` to the test program. Maybe `cargo test --verbose` could be changed to do that?</s> **Edit:** the default is now unchanged, `-q` or `--quiet` enables the new output.
servo/rustc-test@e3a9adc Also proposed upstream at rust-lang/rust#31887
Use shrinked output built into the test harness. servo/rustc-test@e3a9adc Also proposed upstream at rust-lang/rust#31887 r? @nox <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/html5ever/200) <!-- Reviewable:end -->
Until now, a program created with
rustc --test
prints at least one line per test. This can be very verbose, especially with data-driven tests when hundreds or thousands of tests is not rare.This changes the default output to one character per test (except metrics and benchmarks results which have additional data to show):
The previous behavior is available by passingEdit: the default is now unchanged,--verbose
to the test program. Maybecargo test --verbose
could be changed to do that?-q
or--quiet
enables the new output.