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 c01eb57b2..c480b3d17 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 8f426c402..8b57874cf 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 527fac217..7dae65531 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 8e36dbbb6..d28895a0f 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 1b15d2fd3..dcfc006eb 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 536342307..0efc0b41f 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 5d8d02868..0111d2b27 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 beac3f0ce..4bfb9860c 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 dfb9c18df..12dbb31cd 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 585d97aaa..407f0288c 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 0be01b95c..9f76e6967 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 dbe6590ab..dc418c93d 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 8f174cce5..6fb87c408 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 47ce4a905..7b8f21f8a 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 c1b756fe6..ea05acdce 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 1ebd76903..1aba4e3fe 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 2a39565fb..dd7b197a4 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 1c150beb0..63b23bd66 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 73b7d5f27..493817c7e 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 515cba9e8..d6c9de48f 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 2a02fac56..e739cd580 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 20304c453..73113472c 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 b7e242467..db22fa525 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 ad18f21e2..6c470e3b1 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 283ac0d46..68651347b 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 c8b0e7804..de3e9f1cc 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 34df3579d..e0f781986 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 f682e2afa..6220fc928 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 a8b3d4bab..dffdb8309 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 ee0b52067..2828b396a 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 1b5435c67..8bf82a517 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 b06d958ed..e9e63f28a 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 26f53cfcf..4820b0adf 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 e0fc97b57..8f6262698 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 c2ef438bb..4df8b2a00 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 f73fc6d83..7db3bc80b 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 ae96ce409..0b9d62915 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!(); + } }