Enum fuzzcheck::FuzzerBuilder[][src]

pub enum FuzzerBuilder {}
Expand description

Use this builder type to construct a fuzz test and launch it.

A fuzz-test is constructed by passing these five arguments, in order:

  1. the function to fuzz-test
  2. the mutator that produces the test cases
  3. the serializer to use when saving the interesting test cases to the file system
  4. other fuzzing arguments, which may be produced by cargo-fuzzcheck, or specified manually
  5. the files whose code coverage influece the fuzzer

For example, you may write:

#![feature(no_coverage)]
use fuzzcheck::{FuzzerBuilder, DefaultMutator, SerdeSerializer};

fn my_function(xs: &Option<u16>) -> bool {
    // ..
}
fn fuzz_test() {
    FuzzerBuilder::test(my_function)
        .mutator(<Option<u16>>::default_mutator())
        .serializer(SerdeSerializer::default())
        .arguments_from_cargo_fuzzcheck()
        .observe_only_files_from_current_dir()
        .launch();
}

Each step is performed on a different type. You start with a FuzzerBuilder, which asks for a test function. Once that test function is given, you get a FuzzerBuilder1, which asks for a mutator. FuzzerBuilder2 asks for a serializer. FuzzerBuilder3 asks for fuzzing arguments. And finally, FuzzerBuilder4 has all the information needed to launch the fuzz test.

Implementations

Specify the function to fuzz-test.

There are currently three kinds of functions that can be passed as arguments:

  1. Fn(&T) : the fuzzer will only report a failure when the given function crashes
  2. Fn(&T) -> Bool : the fuzzer will report a failure when the output is false
  3. Fn(&T) -> Result<_,_> : the fuzzer will report a failure when the output is Err(..)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.