Waiting for a large test suite to run is painful, so I collect the duration of each test from cargo test
and use a simple heuristic to find failures fast (I order by probability of failure/last run duration and run tests in that order).
This is great, but it doesn't have a way of knowing about new tests. If I could list all tests, I could detect new tests and add them to the high risk group that gets run first.
You can run cargo test -- --list
to list all tests and benchmarks. The output format is:
glonk: benchmark
hurz: test
1 test, 1 benchmark
You can suppress the summary line by passing the --format=terse
flag.
Note that --list
is a command line flag that is passed to the test binary itself, and not a Cargo flag. You can get a full list of flags accepted by the test binary using cargo test -- --help
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With