1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
pub use anyhow::Error;
pub use bolero_generator::{
    driver::{Driver, DriverMode},
    TypeGenerator, ValueGenerator,
};
use core::time::Duration;

#[cfg(not(kani))]
pub mod panic;
#[cfg(kani)]
#[path = "./noop/panic.rs"]
pub mod panic;

#[cfg(not(any(fuzzing, kani)))]
pub mod rng;
pub mod shrink;
mod test;
pub use test::*;

pub mod test_failure;
pub use crate::test_failure::TestFailure;

mod test_input;
pub use test_input::*;

#[doc(hidden)]
pub mod target_location;
#[doc(hidden)]
pub use target_location::TargetLocation;

mod test_result;
pub use test_result::*;

/// Trait for defining an engine that executes a test
pub trait Engine<T: Test>: Sized {
    type Output;

    fn set_driver_mode(&mut self, mode: DriverMode);
    fn set_shrink_time(&mut self, shrink_time: Duration);
    fn run(self, test: T) -> Self::Output;
}

// TODO change this to `!` when stabilized
#[doc(hidden)]
pub type Never = ();