diff --git a/test/integration-test/src/main.rs b/test/integration-test/src/main.rs index a61bf088..b2ad10be 100644 --- a/test/integration-test/src/main.rs +++ b/test/integration-test/src/main.rs @@ -24,6 +24,15 @@ enum Command { List } +macro_rules! exec_test { + ($test:expr) => {{ + info!("Running {}", $test.name); + if let Err(e) = ($test.test_fn)() { + panic!("{}", e) + } + }}; +} + fn main() -> anyhow::Result<()> { env_logger::init(); @@ -35,19 +44,13 @@ fn main() -> anyhow::Result<()> { Some(tests) => { for t in inventory::iter:: { if tests.contains(&t.name.into()) { - info!("Running {}", t.name); - if let Err(e) = (t.test_fn)() { - panic!("{}", e) - } + exec_test!(t) } } } None => { for t in inventory::iter:: { - info!("Running {}", t.name); - if let Err(e) = (t.test_fn)() { - panic!("{}", e) - } + exec_test!(t) } } }