From 5110560e0450dd54846af12877a97243b1e48f9e Mon Sep 17 00:00:00 2001 From: Shaopeng Wang <spxwang@gmail.com> Date: Mon, 29 Jun 2020 16:04:53 +1200 Subject: [PATCH] Fix benchmarking macro. (#218) --- benchmarking/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/benchmarking/src/lib.rs b/benchmarking/src/lib.rs index 1c7b554..ea2a4a8 100644 --- a/benchmarking/src/lib.rs +++ b/benchmarking/src/lib.rs @@ -308,7 +308,7 @@ macro_rules! benchmarks_iter { } #[cfg(test)] - $crate::impl_benchmark_test!( $instance $runtime $pallet $name); + $crate::impl_benchmark_test!($instance $runtime $pallet $name); $crate::benchmarks_iter!( $instance @@ -1036,10 +1036,10 @@ macro_rules! impl_benchmark_test { SelectedBenchmark as $crate::BenchmarkingSetup<$runtime> >::components(&selected_benchmark); - assert!( - components.len() != 0, - "You need to add components to your benchmark!", - ); + // assert!( + // components.len() != 0, + // "You need to add components to your benchmark!", + // ); for (_, (name, low, high)) in components.iter().enumerate() { // Test only the low and high value, assuming values in the middle won't break for component_value in vec![low, high] { @@ -1080,7 +1080,7 @@ macro_rules! impl_benchmark_test { $instance:ident $runtime:ident $pallet:ident - $( $name:ident ),* + $name:ident ) => { $crate::paste::item! { fn [<test_benchmark_ $name>] () -> Result<(), &'static str> -- GitLab