openethereum/ethcore/src/tests/test_common.rs

35 lines
602 B
Rust
Raw Normal View History

pub use common::*;
2016-01-21 16:08:09 +01:00
macro_rules! test {
($name: expr) => {
assert!(do_json_test(include_bytes!(concat!("../../res/ethereum/tests/", $name, ".json"))).is_empty());
2016-01-21 16:08:09 +01:00
}
}
#[macro_export]
macro_rules! declare_test {
2016-01-21 16:08:09 +01:00
(ignore => $id: ident, $name: expr) => {
#[ignore]
#[test]
#[allow(non_snake_case)]
fn $id() {
2016-01-21 16:08:09 +01:00
test!($name);
}
};
2016-01-21 16:08:09 +01:00
(heavy => $id: ident, $name: expr) => {
#[cfg(feature = "test-heavy")]
#[test]
#[allow(non_snake_case)]
fn $id() {
2016-01-21 16:08:09 +01:00
test!($name);
}
};
2016-01-21 16:08:09 +01:00
($id: ident, $name: expr) => {
#[test]
#[allow(non_snake_case)]
fn $id() {
test!($name);
}
}
}