[fuzz] Print the output of all failed test cases, not one test.
[rust-lightning] / fuzz / src / bin / msg_channel_reestablish_target.rs
index 5d8d028684cebf09dc399afcd7fd2d38d4fa6519..0111d2b27544160979ea8275d111ec2be082ab8d 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!();
+       }
 }