Merge pull request #3001 from optout21/splicing-feature-bit-with-any
[rust-lightning] / fuzz / src / bin / msg_shutdown_target.rs
index f682e2afaa86fd736af6e43ceede45e2078b2681..1959a8cfa858c9fff0558779fef9710b23ee74eb 100644 (file)
@@ -12,6 +12,9 @@
 
 #![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
 
+#[cfg(not(fuzzing))]
+compile_error!("Fuzz targets need cfg=fuzzing");
+
 extern crate lightning_fuzz;
 use lightning_fuzz::msg_targets::msg_shutdown::*;
 
@@ -93,10 +96,18 @@ fn run_test_cases() {
                        }
                }
        }
+       let mut failed_outputs = Vec::new();
        for (test, thread) in threads.drain(..) {
                if let Some(output) = thread.join().unwrap() {
-                       println!("Output of {}:\n{}", test, output);
-                       panic!();
+                       println!("\nOutput of {}:\n{}\n", test, output);
+                       failed_outputs.push(test);
+               }
+       }
+       if !failed_outputs.is_empty() {
+               println!("Test cases which failed: ");
+               for case in failed_outputs {
+                       println!("{}", case);
                }
+               panic!();
        }
 }