mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
Directory Restructure (#1163)
* Move tests -> testing * Directory restructure * Update Cargo.toml during restructure * Update Makefile during restructure * Fix arbitrary path
This commit is contained in:
28
testing/state_transition_vectors/src/macros.rs
Normal file
28
testing/state_transition_vectors/src/macros.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
/// 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),*) => {
|
||||
pub fn vectors() -> Vec<TestVector> {
|
||||
let mut vec = vec![];
|
||||
|
||||
$(
|
||||
vec.push($test.test_vector(stringify!($name).into()));
|
||||
)*
|
||||
|
||||
vec
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
$(
|
||||
#[test]
|
||||
fn $name() {
|
||||
$test.run();
|
||||
}
|
||||
)*
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user