[][src]Macro bolero::fuzz

macro_rules! fuzz {
    ($($tt:tt)*) => { ... };
}

Execute fuzz tests for a given target

This should be executed in a separate test target, for example tests/my_fuzz_target/main.rs.

Examples

use bolero::fuzz;

fn main() {
    fuzz!().for_each(|input| {
        // implement fuzz target here
    });
}
use bolero::fuzz;

fn main() {
    fuzz!()
        .with_type::<(u8, u16)>()
        .for_each(|(a, b)| {
            // implement fuzz target here
        });
}
use bolero::fuzz;

fn main() {
    fuzz!()
        .with_generator((0..100, 10..50))
        .for_each(|(a, b)| {
            // implement fuzz target here
        });
}
use bolero::fuzz;

fn main() {
    fuzz!(|input| {
        // implement fuzz target here
    });
}
use bolero::fuzz;

fn main() {
    fuzz!(for (a, b) in all((gen::<u8>(), gen::<u8>())) {
        // implement fuzz target here
    });
}