Rust Criterion running a unit test as a benchmark

Hi I am trying to use criterion to benchmask some code and have followed the rust book by

having the following structure.

             -> benches
             -> src

How can I import a unit test to benchmark by passing it to

c.bench_function("mytest", |b| b.iter(|| tests::my_test()));

Without making tests module public ?
I guessing the issue is can I make the benchmarks in criterion part of the crate.
In the example it show import their test like

use mycrate::fibonacci;

so it not part of the same crate.


This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.