rust-fuzz/libfuzzer

Consider a `cargo fuzz` command

frewsxcv opened this issue · 4 comments

Consider a `cargo fuzz` command

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

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)

Sounds very reasonable to me! 🐇 💻 🎊

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