[fuzz] Print the output of all failed test cases, not one test.
[rust-lightning] / fuzz / src / bin / msg_funding_created_target.rs
index 8f174cce5d8a14201b1f97859c96a40e809f88b4..6fb87c4082a98ec34e6dd0b67057f2684e6e78ad 100644 (file)
@@ -93,10 +93,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!();
+       }
 }