Skip to content

Commit 71c1d66

Browse files
committed
Print the output of all failed fuzz cases in test, not one test.
1 parent 2d788a9 commit 71c1d66

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
}

0 commit comments

Comments
 (0)