rust-fuzz / libfuzzer

Rust bindings and utilities for LLVM’s libFuzzer
Apache License 2.0
209 stars 44 forks source link

Consider a `cargo fuzz` command #6

Closed frewsxcv closed 7 years ago

Manishearth commented 7 years ago

I will probably create a separate crate under this org for this.

Manishearth commented 7 years ago

This really would be the easiest within Cargo, actually. The problem is that you need to be able to add the dependencies right, and you can't do that without hooking into Cargo or manually editing the Cargo.toml. You basically want stuff to work like cargo test, except it should find things

I looked into using Cargo as a library but the code as written is rather rigid; I can't just drop in a custom test file that is not living in test/.

An alternate way to do this would be to have a cargo fuzzable command that creates a fuzz/ folder with a Cargo.toml, and individual fuzzers are binaries for this crate. You manually add any dependencies you may have. You then cargo fuzz foo within this crate (which is RUSTFLAGS=whatevs cargo run foo)

frewsxcv commented 7 years ago

Sounds very reasonable to me! 🐇 💻 🎊

https://github.com/rust-fuzz/cargo-fuzz

Manishearth commented 7 years ago

https://github.com/rust-fuzz/cargo-fuzz

It works!