#[macro_export] macro_rules! bench_case { ($lang:ident, $id:ident, $spec:expr) => { ::paste::paste! { #[test] fn [<$lang _ $id>]() { let dir = $crate::helpers::temp_dir(); let spec: ::criterion_polyglot::BenchSpec = $spec; $crate::helpers::short_benchmark(&dir).[<$lang _benchmark>](::std::stringify!([<$lang _ $id>]), spec); } } }; } #[macro_export] macro_rules! cases { ($($id:ident { $($lang:ident => $spec:expr),+ }),+) => { $($($crate::bench_case!($lang, $id, $spec);)+)+ }; }