Macro test_generator::bench_expand_list
source · bench_expand_list!() { /* proc-macro */ }
Expand description
deprecated Generate a benchmark-function call for each list-element
extern crate test_generator;
#[cfg(test)]
mod tests {
test_generator::bench_expand_list! { bench_size; [ 10, 100, 1000 ]}
fn bench_size(b: &mut test::Bencher, val: &usize) {
let input = val;
b.iter(|| { *input > 0 });
}
}
Will expand to bench-functions incorporating the array-elements
#[cfg(test)]
mod tests {
#[bench]
fn bench_size_0000000010(bencher: & mut test::Bencher) {
bench_exists(bencher, &10);
}
#[bench]
fn bench_size_0000000100(bencher: & mut test::Bencher) {
bench_exists(bencher, &100);
}
#[bench]
fn bench_size_0000001000(bencher: & mut test::Bencher) {
bench_exists(bencher, &1000);
}
}