I am a little confused by file organisation in criterion. I would like to put benches into different files, just for grouping.
The documentation says
Currently, Cargo treats any *.rs file in the benches directory as a benchmark, unless there are one or more [[bench]] sections in the Cargo.toml file. In that case, the auto-discovery is disabled entirely.
In Rust 2018 edition, Cargo will be changed so that [[bench]] no longer disables the auto-discovery.
That makes enough sense, but it also says
The first thing to do is update the
Cargo.toml
to disable the libtest benchmark harness
Which involves creating the "benches" section. I've done this, but now only the named file gets run.
Currently, I am taking the approach of creating a single bench file and using mod
to import all the others. But this requires quite a lot of linking things together manually. The autodiscovery option would seem easier.