[][src]Struct bolero::TestTarget

pub struct TestTarget<Generator, Engine, InputOwnership> { /* fields omitted */ }

Configuration for a test target

Implementations

impl<Engine> TestTarget<ByteSliceGenerator, Engine, BorrowedInput>[src]

pub fn new(
    engine: Engine
) -> TestTarget<ByteSliceGenerator, Engine, BorrowedInput>
[src]

Create a TestTarget with the given Engine

impl<G, Engine, InputOwnership> TestTarget<G, Engine, InputOwnership>[src]

pub fn with_generator<Generator: ValueGenerator>(
    self,
    generator: Generator
) -> TestTarget<Generator, Engine, InputOwnership> where
    Generator::Output: Debug
[src]

Set the value generator for the TestTarget

The function with_generator::<Generator>(generator) will use the provided Generator, which implements generator::ValueGenerator, to generate input values of type Generator::Output.

This mode is used for testing an implementation that requires structured input with specific constraints applied to the type.

pub fn with_type<T: Debug + TypeGenerator>(
    self
) -> TestTarget<TypeValueGenerator<T>, Engine, InputOwnership>
[src]

Set the type generator for the TestTarget

Calling with_type::<Type>() will generate random values of Type to be tested. Type is required to implement generator::TypeGenerator in order to use this method.

This mode is used for testing an implementation that requires structured input.

impl<G: ValueGenerator, Engine, InputOwnership> TestTarget<G, Engine, InputOwnership>[src]

pub fn map<F: Fn(G::Output) -> T, T: Debug>(
    self,
    map: F
) -> TestTarget<MapGenerator<G, F>, Engine, InputOwnership>
[src]

Map the value of the generator

pub fn and_then<F: Fn(G::Output) -> T, T: ValueGenerator>(
    self,
    map: F
) -> TestTarget<AndThenGenerator<G, F>, Engine, InputOwnership> where
    T::Output: Debug
[src]

Map the value of the generator with a new generator

pub fn filter<F: Fn(&G::Output) -> bool>(
    self,
    filter: F
) -> TestTarget<FilterGenerator<G, F>, Engine, InputOwnership>
[src]

Filter the value of the generator

pub fn filter_map<F: Fn(G::Output) -> Option<T>, T>(
    self,
    filter_map: F
) -> TestTarget<FilterMapGenerator<G, F>, Engine, InputOwnership>
[src]

Filter the value of the generator and map it to something else

pub fn with_driver_mode(self, mode: DriverMode) -> Self[src]

Set the driver mode for the fuzz target

impl<G, InputOwnership> TestTarget<G, RngEngine, InputOwnership>[src]

pub fn with_iterations(self, iterations: usize) -> Self[src]

Set the number of iterations executed

pub fn with_max_len(self, max_len: usize) -> Self[src]

Set the maximum length of the generated bytes

impl<G, Engine> TestTarget<G, Engine, BorrowedInput>[src]

pub fn cloned(self) -> TestTarget<G, Engine, ClonedInput>[src]

Use a cloned value for the test input

Cloning the test inputs will force a call to Clone::clone on each input value, and therefore, will be less efficient than using a reference.

impl<G, E> TestTarget<G, E, BorrowedInput> where
    G: ValueGenerator
[src]

pub fn for_each<F>(self, test: F) -> E::Output where
    E: Engine<BorrowedGeneratorTest<F, G, G::Output>>,
    BorrowedGeneratorTest<F, G, G::Output>: Test
[src]

Iterate over all of the inputs and check the TestTarget

impl<G, E> TestTarget<G, E, ClonedInput> where
    G: ValueGenerator
[src]

pub fn for_each<F>(self, test: F) -> E::Output where
    E: Engine<ClonedGeneratorTest<F, G, G::Output>>,
    ClonedGeneratorTest<F, G, G::Output>: Test
[src]

Iterate over all of the inputs and check the TestTarget

impl<E> TestTarget<ByteSliceGenerator, E, BorrowedInput>[src]

pub fn for_each<T>(self, test: T) -> E::Output where
    E: Engine<BorrowedSliceTest<T>>,
    BorrowedSliceTest<T>: Test
[src]

Iterate over all of the inputs and check the TestTarget

impl<E> TestTarget<ByteSliceGenerator, E, ClonedInput>[src]

pub fn for_each<T>(self, test: T) -> E::Output where
    E: Engine<ClonedSliceTest<T>>,
    ClonedSliceTest<T>: Test
[src]

Iterate over all of the inputs and check the TestTarget

Auto Trait Implementations

impl<Generator, Engine, InputOwnership> RefUnwindSafe for TestTarget<Generator, Engine, InputOwnership> where
    Engine: RefUnwindSafe,
    Generator: RefUnwindSafe,
    InputOwnership: RefUnwindSafe

impl<Generator, Engine, InputOwnership> Send for TestTarget<Generator, Engine, InputOwnership> where
    Engine: Send,
    Generator: Send,
    InputOwnership: Send

impl<Generator, Engine, InputOwnership> Sync for TestTarget<Generator, Engine, InputOwnership> where
    Engine: Sync,
    Generator: Sync,
    InputOwnership: Sync

impl<Generator, Engine, InputOwnership> Unpin for TestTarget<Generator, Engine, InputOwnership> where
    Engine: Unpin,
    Generator: Unpin,
    InputOwnership: Unpin

impl<Generator, Engine, InputOwnership> UnwindSafe for TestTarget<Generator, Engine, InputOwnership> where
    Engine: UnwindSafe,
    Generator: UnwindSafe,
    InputOwnership: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,