Convert libFuzzer fuzz_target!
files to Unit Tests #[test]
for Rust.
-
Rust nightly
rustup install nightly rustup default nightly
-
cargo-fuzz
cargo install cargo-fuzz
NOTE The process is subject to change as the project matures.
mkdir -p data && cd data
git clone https://github.com/marshallpierce/rust-base64
cd ..
cargo run data/rust-base64
This step does two things data/rust-base64
- modify fuzzer files in
\fuzz
and copy a backup\fuzz-bak
- generate unit tests
\tests-gen
based on\fuzz
To restore to previous stage, use rm fuzz tests-gen -rf && mv fuzz-bak fuzz
.
cd data/rust-base64
cargo fuzz run roundtrip > record.txt
head record.txt
cargo install --git https://github.com/SecurityLab-UCD/rust-fuzzer-gen.git
rust-fuzzer-gen <patht to a target repo>