Note that there doesn't appear to be a way to conditionally set
#[no_main] so that has to happen manually at compile-time.
[features]
afl_fuzz = ["afl"]
honggfuzz_fuzz = ["honggfuzz"]
+libfuzzer_fuzz = ["libfuzzer-sys"]
[dependencies]
afl = { version = "0.4", optional = true }
hex = "0.3"
honggfuzz = { version = "0.5", optional = true }
secp256k1 = { version = "0.11", features=["fuzztarget"] }
+libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git", optional = true }
[build-dependencies]
cc = "1.0"
+//Uncomment this for libfuzzer builds:
+//#![no_main]
+
extern crate bitcoin;
extern crate bitcoin_hashes;
extern crate lightning;
}
}
+#[cfg(feature = "libfuzzer_fuzz")]
+#[macro_use] extern crate libfuzzer_sys;
+#[cfg(feature = "libfuzzer_fuzz")]
+fuzz_target!(|data: &[u8]| {
+ let logger: Arc<Logger> = Arc::new(test_logger::TestLogger{});
+ do_test(data, &logger);
+});
+
extern crate hex;
#[cfg(test)]
mod tests {