diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/helpers/mod.rs | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/tests/helpers/mod.rs b/tests/helpers/mod.rs index c671684..a7eaadc 100644 --- a/tests/helpers/mod.rs +++ b/tests/helpers/mod.rs @@ -2,12 +2,20 @@ mod fixtures; pub use fixtures::fixture; pub use fixtures::FixtureScreen; +pub static mut QUIET: bool = false; + macro_rules! is { ($got:expr, $expected:expr) => { if ($got) != ($expected) { - eprintln!("{} != {}:", stringify!($got), stringify!($expected)); - eprintln!(" got: {:?}", $got); - eprintln!("expected: {:?}", $expected); + if !unsafe { QUIET } { + eprintln!( + "{} != {}:", + stringify!($got), + stringify!($expected) + ); + eprintln!(" got: {:?}", $got); + eprintln!("expected: {:?}", $expected); + } return false; } }; @@ -15,7 +23,9 @@ macro_rules! is { macro_rules! ok { ($e:expr) => { if !($e) { - eprintln!("!{}", stringify!($e)); + if !unsafe { QUIET } { + eprintln!("!{}", stringify!($e)); + } return false; } }; |