josecelano / cargo-pretty-test

A Rust command that prettifies the ugly `cargo test` output into a beautiful one.
https://users.rust-lang.org/t/cargo-test-output-with-indentation/100149
135 stars 1 forks source link

feat: reinterpret `-q` or `--quite` to show raw output from cargo test #28

Open zjp-CN opened 11 months ago

zjp-CN commented 11 months ago

Ref: https://github.com/josecelano/cargo-pretty-test/issues/5

By default, -q is not passed, meaning raw output is forwarded as cargo test is running. If -q is passed in, don't display raw output, show test tree directly.

Note: this commit also makes --color default to always because not -q is the default, and we want forwarding looks pretty in color.

Press Enter to clear the screen to show the test tree:

https://github.com/josecelano/cargo-pretty-test/assets/25300418/a6f392e5-cd9e-4a17-a362-3a53e85f10c4


Some questions:

josecelano commented 11 months ago

If tests take long to execute I would prefer to run cargo test once and I would like to have both outputs (I guess, is there something missing in the pretty output that is included in the normal one? If not, I would not care not to get the normal one. I would prefer the normal to be pretty. Other testing frameworks only have the pretty one. But I suppose that's because they are not executed in parallel maybe)

josecelano commented 11 months ago

Hi @zjp-CN I think I would just print the cargo test output while running and then the tree without pressing any key. If you want only the normal output, you can just run cargo test. For me, the normal output is just a "progress bar" and a log in case the pretty-test command fails.

zjp-CN commented 11 months ago

What kind of progress bar will it be? We don't know how many tests without running them I guess?

josecelano commented 11 months ago

What kind of progress bar will it be? We don't know how many tests without running them I guess?

I meant the cargo test output could be the "progress bar".