cargo 0.17.0-nightly (740f9c0 2016-12-29)
We should be able to silence the test runner's stdout via --quiet like build and clean's --quiet flag, but alas this is not currently done.
tmba:sentinel thill $ cargo test --quiet -- quiet
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
tmba:sentinel thill $ cargo test --quiet
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
--quiet prints a compact version of the normal output:
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running /Users/sfackler/code/rust-openssl/target/debug/deps/openssl-3ace7e2ac4871275
running 146 tests
..................................................................................................................................................
test result: ok. 146 passed; 0 failed; 0 ignored; 0 measured
Seems reasonable for --quiet --quiet to completely suppress output though.
But --quiet doesn't even do that for me.
tmba:sentinel thill $ cargo test --quiet
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
tmba:sentinel thill $ cargo test -- --quiet
Finished debug [unoptimized + debuginfo] target(s) in 0.0 secs
Running target/debug/deps/sentinel-0ecd9a282af25c50
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Doc-tests sentinel
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
Why doesn't it? It's displaying zero dots for the zero tests it ran.
I feel like ultimately -qq could silence test runs completely and just return the exit code; or perhaps we could have an --exit-code option that did the equivalent.
Even with cargo test --quiet -- --quiet (!), it is excessively verbose:
$ cargo test --quiet -- --quiet
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 7 tests
.......
test result: ok. 7 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 1 test
.
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
With --all, this output can easily span multiple pages for a reasonably sized workspace.
It would be nice to merge all the blocks instead, to eliminate the useless noise (and make --all output actually glanceable):
$ cargo test --quiet -- --quiet
running 8 tests
........
test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
I agree that an even quieter setting would be valuable. I would like to see a PR with an implementation.
In general there is a lot of room for improvement in the cargo test experience. At some point I would love for someone to reimagine how cargo test would work in an ideal world -- a bit like what has been done for error messages over the past year. It would be so wonderful if someone takes the initiative to come up with some design proposals. The RFCs repo or the users forum would be the place to follow up.
Triage: no changes
Most helpful comment
I agree that an even quieter setting would be valuable. I would like to see a PR with an implementation.
In general there is a lot of room for improvement in the
cargo testexperience. At some point I would love for someone to reimagine howcargo testwould work in an ideal world -- a bit like what has been done for error messages over the past year. It would be so wonderful if someone takes the initiative to come up with some design proposals. The RFCs repo or the users forum would be the place to follow up.