diff --git a/test-templates/src/fields.rs b/test-templates/src/fields.rs index d82c580e5..8a44d0382 100644 --- a/test-templates/src/fields.rs +++ b/test-templates/src/fields.rs @@ -528,7 +528,7 @@ macro_rules! __test_field { #[macro_export] macro_rules! test_field { - ($mod_name: ident; $field: ty $(; $tail:tt)*) => { + ($mod_name:ident; $field:ty; $iterations:expr $(; $tail:tt)*) => { mod $mod_name { use super::*; use ark_ff::{ @@ -537,9 +537,13 @@ macro_rules! test_field { }; use ark_serialize::{buffer_bit_byte_size, Flags}; use ark_std::{io::Cursor, rand::Rng, vec::Vec, test_rng, vec, Zero, One, UniformRand}; - const ITERATIONS: usize = 1000; + const ITERATIONS: usize = $iterations; $crate::__test_field!($field $(; $tail)*); } }; + + ($mod_name:ident; $field:ty $(; $tail:tt)*) => { + $crate::test_field!($mod_name; $field; 1000 $(; $tail)*); + }; } diff --git a/test-templates/src/groups.rs b/test-templates/src/groups.rs index 20cbf009a..104fa0f27 100644 --- a/test-templates/src/groups.rs +++ b/test-templates/src/groups.rs @@ -405,16 +405,20 @@ macro_rules! __test_group { #[macro_export] macro_rules! test_group { - ($mod_name: ident; $group: ty $(; $tail:tt)*) => { + ($mod_name:ident; $group:ty; $iterations:expr $(; $tail:tt)*) => { mod $mod_name { use super::*; use ark_ff::*; use ark_ec::{PrimeGroup, CurveGroup, ScalarMul, AffineRepr, CurveConfig, short_weierstrass::SWCurveConfig, twisted_edwards::TECurveConfig, scalar_mul::{*, wnaf::*}}; use ark_serialize::*; use ark_std::{io::Cursor, rand::Rng, vec::Vec, test_rng, vec, Zero, One, UniformRand}; - const ITERATIONS: usize = 500; + const ITERATIONS: usize = $iterations; $crate::__test_group!($group $(; $tail)*); } }; + + ($mod_name:ident; $group:ty $(; $tail:tt)*) => { + $crate::test_group!($mod_name; $group; 500 $(; $tail)*); + }; }