Skip to content

Commit 81cd1ad

Browse files
committed
Print the output of all failed fuzz cases in test, 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.
1 parent daedbbe commit 81cd1ad

36 files changed

+360
-72
lines changed

fuzz/src/bin/chanmon_consistency_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/chanmon_deser_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/full_stack_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_accept_channel_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_announcement_signatures_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_channel_announcement_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_channel_reestablish_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_channel_update_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_closing_signed_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_commitment_signed_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_decoded_onion_error_packet_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_error_message_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_funding_created_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_funding_locked_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_funding_signed_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_gossip_timestamp_filter_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_init_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_node_announcement_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

fuzz/src/bin/msg_onion_hop_data_target.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,18 @@ fn run_test_cases() {
9393
}
9494
}
9595
}
96+
let mut failed_outputs = Vec::new();
9697
for (test, thread) in threads.drain(..) {
9798
if let Some(output) = thread.join().unwrap() {
98-
println!("Output of {}:\n{}", test, output);
99-
panic!();
99+
println!("\nOutput of {}:\n{}\n", test, output);
100+
failed_outputs.push(test);
100101
}
101102
}
103+
if !failed_outputs.is_empty() {
104+
println!("Test cases which failed: ");
105+
for case in failed_outputs {
106+
println!("{}", case);
107+
}
108+
panic!();
109+
}
102110
}

0 commit comments

Comments
 (0)