Files
lighthouse/testing/state_transition_vectors/src/macros.rs
Michael Sproul 26c19d65a3 Enable large_stack_frames lint (#6343)
* Enable `large_stack_frames` lint
2024-09-05 05:01:16 +00:00

30 lines
772 B
Rust

/// Provides:
///
/// - `fn vectors()`: allows for getting a `Vec<TestVector>` of all vectors for exporting.
/// - `mod tests`: runs all the test vectors locally.
macro_rules! vectors_and_tests {
($($name: ident, $test: expr),*) => {
#[allow(clippy::large_stack_frames)]
pub async fn vectors() -> Vec<TestVector> {
let mut vec = vec![];
$(
vec.push($test.test_vector(stringify!($name).into()).await);
)*
vec
}
#[cfg(all(test, not(debug_assertions)))]
mod tests {
use super::*;
$(
#[tokio::test]
async fn $name() {
$test.run().await;
}
)*
}
};
}