From: Matt Corallo Date: Mon, 23 Nov 2020 23:22:29 +0000 (-0500) Subject: [fuzz] Print the output of all failed test cases, not one test. X-Git-Tag: v0.0.98~20^2~14 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=acc9ff627495eff0a0fff9848a7c6b5e0c4ac46c;p=rust-lightning [fuzz] Print the output of all failed test cases, not one test. Our fuzz tests previously only printed the log output of the first fuzz test case to fail. This commit changes that (with lots of auto-generated updates) to ensure we print all log outputs. --- diff --git a/fuzz/src/bin/chanmon_consistency_target.rs b/fuzz/src/bin/chanmon_consistency_target.rs index c01eb57b..c480b3d1 100644 --- a/fuzz/src/bin/chanmon_consistency_target.rs +++ b/fuzz/src/bin/chanmon_consistency_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/chanmon_deser_target.rs b/fuzz/src/bin/chanmon_deser_target.rs index 8f426c40..8b57874c 100644 --- a/fuzz/src/bin/chanmon_deser_target.rs +++ b/fuzz/src/bin/chanmon_deser_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/full_stack_target.rs b/fuzz/src/bin/full_stack_target.rs index 527fac21..7dae6553 100644 --- a/fuzz/src/bin/full_stack_target.rs +++ b/fuzz/src/bin/full_stack_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_accept_channel_target.rs b/fuzz/src/bin/msg_accept_channel_target.rs index 8e36dbbb..d28895a0 100644 --- a/fuzz/src/bin/msg_accept_channel_target.rs +++ b/fuzz/src/bin/msg_accept_channel_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_announcement_signatures_target.rs b/fuzz/src/bin/msg_announcement_signatures_target.rs index 1b15d2fd..dcfc006e 100644 --- a/fuzz/src/bin/msg_announcement_signatures_target.rs +++ b/fuzz/src/bin/msg_announcement_signatures_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_channel_announcement_target.rs b/fuzz/src/bin/msg_channel_announcement_target.rs index 53634230..0efc0b41 100644 --- a/fuzz/src/bin/msg_channel_announcement_target.rs +++ b/fuzz/src/bin/msg_channel_announcement_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_channel_reestablish_target.rs b/fuzz/src/bin/msg_channel_reestablish_target.rs index 5d8d0286..0111d2b2 100644 --- a/fuzz/src/bin/msg_channel_reestablish_target.rs +++ b/fuzz/src/bin/msg_channel_reestablish_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_channel_update_target.rs b/fuzz/src/bin/msg_channel_update_target.rs index beac3f0c..4bfb9860 100644 --- a/fuzz/src/bin/msg_channel_update_target.rs +++ b/fuzz/src/bin/msg_channel_update_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_closing_signed_target.rs b/fuzz/src/bin/msg_closing_signed_target.rs index dfb9c18d..12dbb31c 100644 --- a/fuzz/src/bin/msg_closing_signed_target.rs +++ b/fuzz/src/bin/msg_closing_signed_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_commitment_signed_target.rs b/fuzz/src/bin/msg_commitment_signed_target.rs index 585d97aa..407f0288 100644 --- a/fuzz/src/bin/msg_commitment_signed_target.rs +++ b/fuzz/src/bin/msg_commitment_signed_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_decoded_onion_error_packet_target.rs b/fuzz/src/bin/msg_decoded_onion_error_packet_target.rs index 0be01b95..9f76e696 100644 --- a/fuzz/src/bin/msg_decoded_onion_error_packet_target.rs +++ b/fuzz/src/bin/msg_decoded_onion_error_packet_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_error_message_target.rs b/fuzz/src/bin/msg_error_message_target.rs index dbe6590a..dc418c93 100644 --- a/fuzz/src/bin/msg_error_message_target.rs +++ b/fuzz/src/bin/msg_error_message_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_funding_created_target.rs b/fuzz/src/bin/msg_funding_created_target.rs index 8f174cce..6fb87c40 100644 --- a/fuzz/src/bin/msg_funding_created_target.rs +++ b/fuzz/src/bin/msg_funding_created_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_funding_locked_target.rs b/fuzz/src/bin/msg_funding_locked_target.rs index 47ce4a90..7b8f21f8 100644 --- a/fuzz/src/bin/msg_funding_locked_target.rs +++ b/fuzz/src/bin/msg_funding_locked_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_funding_signed_target.rs b/fuzz/src/bin/msg_funding_signed_target.rs index c1b756fe..ea05acdc 100644 --- a/fuzz/src/bin/msg_funding_signed_target.rs +++ b/fuzz/src/bin/msg_funding_signed_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_gossip_timestamp_filter_target.rs b/fuzz/src/bin/msg_gossip_timestamp_filter_target.rs index 1ebd7690..1aba4e3f 100644 --- a/fuzz/src/bin/msg_gossip_timestamp_filter_target.rs +++ b/fuzz/src/bin/msg_gossip_timestamp_filter_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_init_target.rs b/fuzz/src/bin/msg_init_target.rs index 2a39565f..dd7b197a 100644 --- a/fuzz/src/bin/msg_init_target.rs +++ b/fuzz/src/bin/msg_init_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_node_announcement_target.rs b/fuzz/src/bin/msg_node_announcement_target.rs index 1c150beb..63b23bd6 100644 --- a/fuzz/src/bin/msg_node_announcement_target.rs +++ b/fuzz/src/bin/msg_node_announcement_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_onion_hop_data_target.rs b/fuzz/src/bin/msg_onion_hop_data_target.rs index 73b7d5f2..493817c7 100644 --- a/fuzz/src/bin/msg_onion_hop_data_target.rs +++ b/fuzz/src/bin/msg_onion_hop_data_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_open_channel_target.rs b/fuzz/src/bin/msg_open_channel_target.rs index 515cba9e..d6c9de48 100644 --- a/fuzz/src/bin/msg_open_channel_target.rs +++ b/fuzz/src/bin/msg_open_channel_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_ping_target.rs b/fuzz/src/bin/msg_ping_target.rs index 2a02fac5..e739cd58 100644 --- a/fuzz/src/bin/msg_ping_target.rs +++ b/fuzz/src/bin/msg_ping_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_pong_target.rs b/fuzz/src/bin/msg_pong_target.rs index 20304c45..73113472 100644 --- a/fuzz/src/bin/msg_pong_target.rs +++ b/fuzz/src/bin/msg_pong_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_query_channel_range_target.rs b/fuzz/src/bin/msg_query_channel_range_target.rs index b7e24246..db22fa52 100644 --- a/fuzz/src/bin/msg_query_channel_range_target.rs +++ b/fuzz/src/bin/msg_query_channel_range_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_query_short_channel_ids_target.rs b/fuzz/src/bin/msg_query_short_channel_ids_target.rs index ad18f21e..6c470e3b 100644 --- a/fuzz/src/bin/msg_query_short_channel_ids_target.rs +++ b/fuzz/src/bin/msg_query_short_channel_ids_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_reply_channel_range_target.rs b/fuzz/src/bin/msg_reply_channel_range_target.rs index 283ac0d4..68651347 100644 --- a/fuzz/src/bin/msg_reply_channel_range_target.rs +++ b/fuzz/src/bin/msg_reply_channel_range_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_reply_short_channel_ids_end_target.rs b/fuzz/src/bin/msg_reply_short_channel_ids_end_target.rs index c8b0e780..de3e9f1c 100644 --- a/fuzz/src/bin/msg_reply_short_channel_ids_end_target.rs +++ b/fuzz/src/bin/msg_reply_short_channel_ids_end_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_revoke_and_ack_target.rs b/fuzz/src/bin/msg_revoke_and_ack_target.rs index 34df3579..e0f78198 100644 --- a/fuzz/src/bin/msg_revoke_and_ack_target.rs +++ b/fuzz/src/bin/msg_revoke_and_ack_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_shutdown_target.rs b/fuzz/src/bin/msg_shutdown_target.rs index f682e2af..6220fc92 100644 --- a/fuzz/src/bin/msg_shutdown_target.rs +++ b/fuzz/src/bin/msg_shutdown_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_update_add_htlc_target.rs b/fuzz/src/bin/msg_update_add_htlc_target.rs index a8b3d4ba..dffdb830 100644 --- a/fuzz/src/bin/msg_update_add_htlc_target.rs +++ b/fuzz/src/bin/msg_update_add_htlc_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_update_fail_htlc_target.rs b/fuzz/src/bin/msg_update_fail_htlc_target.rs index ee0b5206..2828b396 100644 --- a/fuzz/src/bin/msg_update_fail_htlc_target.rs +++ b/fuzz/src/bin/msg_update_fail_htlc_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs b/fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs index 1b5435c6..8bf82a51 100644 --- a/fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs +++ b/fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_update_fee_target.rs b/fuzz/src/bin/msg_update_fee_target.rs index b06d958e..e9e63f28 100644 --- a/fuzz/src/bin/msg_update_fee_target.rs +++ b/fuzz/src/bin/msg_update_fee_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/msg_update_fulfill_htlc_target.rs b/fuzz/src/bin/msg_update_fulfill_htlc_target.rs index 26f53cfc..4820b0ad 100644 --- a/fuzz/src/bin/msg_update_fulfill_htlc_target.rs +++ b/fuzz/src/bin/msg_update_fulfill_htlc_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/peer_crypt_target.rs b/fuzz/src/bin/peer_crypt_target.rs index e0fc97b5..8f626269 100644 --- a/fuzz/src/bin/peer_crypt_target.rs +++ b/fuzz/src/bin/peer_crypt_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/router_target.rs b/fuzz/src/bin/router_target.rs index c2ef438b..4df8b2a0 100644 --- a/fuzz/src/bin/router_target.rs +++ b/fuzz/src/bin/router_target.rs @@ -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!(); + } } diff --git a/fuzz/src/bin/target_template.txt b/fuzz/src/bin/target_template.txt index f73fc6d8..7db3bc80 100644 --- a/fuzz/src/bin/target_template.txt +++ b/fuzz/src/bin/target_template.txt @@ -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!(); + } } diff --git a/fuzz/src/bin/zbase32_target.rs b/fuzz/src/bin/zbase32_target.rs index ae96ce40..0b9d6291 100644 --- a/fuzz/src/bin/zbase32_target.rs +++ b/fuzz/src/bin/zbase32_target.rs @@ -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!(); + } }