Thanks to visit codestin.com
Credit goes to lib.rs

#using-cargo #command-line-tool #test-cargo #command-output #prettify #install-it

bin+lib cargo-ptest

If installed using cargo install it acts as a command line tool, if used as a package provides methods for running and parsing the output of cargo test

20 stable releases

Uses new Rust 2024

1.3.3 Nov 18, 2025
1.3.0 Nov 4, 2025
1.2.6 Oct 31, 2025

#162 in Testing

Codestin Search App Codestin Search App Codestin Search App Codestin Search App

660 downloads per month

MIT license

48KB
1K SLoC

ptest

Prettify the output of cargo test

If installed using cargo install it acts as a command line tool, if used as a package provides methods for running and parsing the output of cargo test.

Example

Example Linear Output

Generated by ptest
├ Ignored - tests::tests::should_panic_and_does
├ Failed - tests::tests2::panic - See reason below
├ Pass - tests::tests2::succeed
├ Pass - tests::tests::succeed
├ Failed - tests::tests::should_panic_and_doesnt - See reason below
├ Failed - tests::tests::panic - See reason below
├ Pass - colour_test_green
├ Pass - colour_test_red
├ Ignored - submod::ignore (this is the reason)
├ Ignored - submod::ignore_without_reason
├ Pass - submod::normal_test
├ Pass - submod::panic::should_panic
├ Failed - submod::panic::should_panic_but_didnt - See reason below
├ Failed - submod::panic::panicked - See reason below
├ Pass - submod::panic::should_panic_without_reason
├ Pass - works
├ Pass - from_main_rs
├ Pass - from_integration
├ Ignored - attribute::ignore from tests/integration/src/lib.rs   Doc-test
├ Pass - attribute::no_run from tests/integration/src/lib.rs  Doc-test
├ Pass -  from tests/integration/src/lib.rs  Doc-test
├ Pass - normal_doc_mod from tests/integration/src/lib.rs  Doc-test
├ Pass - empty_doc_mod::private_mod from tests/integration/src/lib.rs  Doc-test
├ Pass - empty_doc_mod from tests/integration/src/lib.rs  Doc-test
├ Pass - normal_doc_mod::private_mod::Item from tests/integration/src/lib.rs  Doc-test
├ Pass - attribute::should_panic from tests/integration/src/lib.rs  Doc-test
├ Pass - normal_doc_mod::Item from tests/integration/src/lib.rs  Doc-test
├ Pass - empty_doc_mod::Item from tests/integration/src/lib.rs  Doc-test
├ Pass - normal_doc_mod::private_mod from tests/integration/src/lib.rs  Doc-test
├ Pass - attribute::edition2018 from tests/integration/src/lib.rs  Doc-test
├ Pass - attribute::should_compile_fail from tests/integration/src/lib.rs  Doc-test
├ Failed - attribute::should_compile_fail_but_didnt from tests/integration/src/lib.rs - See reason below  Doc-test

test result: FAILED. 10 Passed; 5 Failed; 3 Ignored; 0 Measured; 0 Filtered; finished in 0.00s

Command Args

To pass arguments to cargo test put them after a --. For example,

cargo ptest --no-color -- --tests --no-fail-fast -- --color=always

would run cargo test --tests --no-fail-fast -- --color=always and the --no-color argument would be consumed by ptest.

Filtered Commands

The following commands are filtered out before running cargo test as they add extra formatting that the parser cannot handle.

   --nocapture
   -v
   --verbose
   --color=always
   --color=auto
   --color=never

Dependencies

~2–3MB
~52K SLoC