bencher icon indicating copy to clipboard operation
bencher copied to clipboard

Run benchmarks just once when --bench isn't specified

Open asomers opened this issue 7 years ago • 2 comments

cargo bench will execute each target with the --bench flag. cargo test, however, does not pass that flag. The builtin libtest crate takes advantage of that by only running each benchmark exactly once and not gathering statistics if --bench isn't passed. That means cargo test --all-targets can be used to ensure that the benchmarks run successfully, and it's much faster than doing cargo bench.

asomers avatar Dec 18 '18 00:12 asomers

Sounds good. Do you want to make a pull request? And we can exercise this in travis.

bluss avatar Dec 18 '18 18:12 bluss

Probably not. I'm not actually using bencher at the moment. I just evaluated it and noticed this problem.

asomers avatar Dec 19 '18 22:12 asomers