Add option to hide output from successful test binaries. · Issue #5089 · rust-lang/cargo (original) (raw)

Right now passing tests in a harness have no output shown which is nice for seeing the output of those that have failed. However if you have tests in multiple targets (for example in lib/, tests/ bin/...) the output quickly gets to be quite noisy.

   Compiling ecl v0.1.0 (file:///home/kevincox/p/ecl)
warning: unused import: `thunk::Thunk`
 --> src/dict.rs:9:5
  |
9 | use thunk::Thunk;
  |     ^^^^^^^^^^^^
  |
  = note: #[warn(unused_imports)] on by default

    Finished dev [unoptimized + debuginfo] target(s) in 9.16 secs
     Running target/debug/deps/ecl-a3de2a1c73e991ba

running 13 tests
test builtins::tests::assert_once_once ... ok
test bytecode::tests::compile_global ... ok
test builtins::tests::assert_once_twice ... ok
test grammar::tests::num_hex ... ok
test tests::ident ... ok
test builtins::tests::panic ... ok
test grammar::tests::num_binary ... ok
test tests::val_is_gc_sized ... ok
test tests::list ... ok
test grammar::tests::num_decimal ... ok
test dict::tests::dict ... ok
test tests::recursion ... ok
test tests::recursion_multi_step ... ok

test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/ast-e414ddb60918e758

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/ecl-bff861297faac3d7

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/tree-a9e09fe64622dc5d

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/compile-3fed4c7317d42ec1

running 1 test
test test_compile_lines ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

     Running target/debug/deps/lines-3858789213e13cf3

running 1 test
test test_lines ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

   Doc-tests ecl

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

Some of these binaries have no tests and a couple of them only have a single test case. However they print at least 6 lines each. Pushing the warning off the top of my screen.

It would be great if there was an option to hide successful test harness output by default. This would probably require a "all good" message at the end to confirm the everything is complete but would nicely keep errors near the bottom and noise low.