From 4f9b0fbd3f3b252ceb8e9aeb19c2d0635294dc1e Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 3 Dec 2018 13:58:11 -0500 Subject: [PATCH] Avoid writing to stdout during fuzz tests --- fuzz/fuzz_targets/utils/test_logger.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fuzz/fuzz_targets/utils/test_logger.rs b/fuzz/fuzz_targets/utils/test_logger.rs index 2ef1196b5..f828d0638 100644 --- a/fuzz/fuzz_targets/utils/test_logger.rs +++ b/fuzz/fuzz_targets/utils/test_logger.rs @@ -4,7 +4,9 @@ pub struct TestLogger {} impl Logger for TestLogger { fn log(&self, record: &Record) { - #[cfg(any(test, not(feature = "fuzztarget")))] + #[cfg(test)] println!("{:<5} [{} : {}, {}] {}", record.level.to_string(), record.module_path, record.file, record.line, record.args); + #[cfg(not(test))] + let _ = format!("{}", record.args); } } -- 2.39.5