X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=fuzz%2Fsrc%2Fbin%2Ffull_stack_target.rs;h=bebb7fdcd81ebdd2f558154b661a4a7c95a77f35;hb=a386d4455d8a6331a2de90974e5c6e7e2718ede2;hp=7ad5d148ecd4c562b0da6744ff76bca38734a559;hpb=4dc0dd17c00c55055e7cd3256c1cf17834055cbf;p=rust-lightning diff --git a/fuzz/src/bin/full_stack_target.rs b/fuzz/src/bin/full_stack_target.rs index 7ad5d148..bebb7fdc 100644 --- a/fuzz/src/bin/full_stack_target.rs +++ b/fuzz/src/bin/full_stack_target.rs @@ -1,8 +1,20 @@ +// This file is Copyright its original authors, visible in version control +// history. +// +// This file is licensed under the Apache License, Version 2.0 or the MIT license +// , at your option. +// You may not use this file except in accordance with one or both of these +// licenses. + // This file is auto-generated by gen_target.sh based on target_template.txt // To modify it, modify target_template.txt and run gen_target.sh instead. #![cfg_attr(feature = "libfuzzer_fuzz", no_main)] +#[cfg(not(fuzzing))] +compile_error!("Fuzz targets need cfg=fuzzing"); + extern crate lightning_fuzz; use lightning_fuzz::full_stack::*; @@ -84,10 +96,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!(); } }