mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-27 22:23:48 +01:00
Work
This commit is contained in:
@@ -8,3 +8,29 @@ macro_rules! n_fold {
|
||||
$tmp.$func();
|
||||
};
|
||||
}
|
||||
|
||||
/// Defines a function called `$group_name` that returns the test description
|
||||
/// values for the listed functions `$function`.
|
||||
#[macro_export]
|
||||
macro_rules! benchmark_group {
|
||||
($group_name:ident, $($function:path),+) => {
|
||||
pub fn $group_name() -> ::std::vec::Vec<$crate::TestDescAndFn> {
|
||||
use $crate::{TestDescAndFn, TestFn, TestDesc};
|
||||
use std::borrow::Cow;
|
||||
let mut benches = ::std::vec::Vec::new();
|
||||
$(
|
||||
benches.push(TestDescAndFn {
|
||||
desc: TestDesc {
|
||||
name: Cow::from(module_path!().to_string() + "::" + stringify!($function)),
|
||||
ignore: false,
|
||||
},
|
||||
testfn: TestFn::StaticBenchFn($function),
|
||||
});
|
||||
)+
|
||||
benches
|
||||
}
|
||||
};
|
||||
($group_name:ident, $($function:path,)+) => {
|
||||
benchmark_group!($group_name, $($function),+);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user