bolero_engine/
lib.rs

1pub type Seed = u128;
2
3#[cfg(feature = "any")]
4pub mod any;
5pub mod failure;
6pub mod input;
7#[cfg(not(kani))]
8pub mod panic;
9#[cfg(kani)]
10#[path = "./noop/panic.rs"]
11pub mod panic;
12mod result;
13#[cfg(feature = "rng")]
14pub mod rng;
15pub mod shrink;
16#[doc(hidden)]
17pub mod target_location;
18mod test;
19
20pub use crate::failure::Failure;
21pub use anyhow::Error;
22#[cfg(kani)]
23pub use bolero_generator::kani;
24pub use bolero_generator::{
25    driver::{self, Driver},
26    TypeGenerator, ValueGenerator,
27};
28pub use input::Input;
29pub use result::IntoResult;
30#[doc(hidden)]
31pub use target_location::TargetLocation;
32pub use test::*;
33
34/// Trait for defining an engine that executes a test
35pub trait Engine<T: Test>: Sized {
36    type Output;
37
38    fn run(self, test: T, options: driver::Options) -> Self::Output;
39}
40
41pub trait ScopedEngine {
42    type Output;
43
44    fn run<F, R>(self, test: F, options: driver::Options) -> Self::Output
45    where
46        F: FnMut() -> R + core::panic::RefUnwindSafe,
47        R: IntoResult;
48}
49
50// TODO change this to `!` when stabilized
51#[doc(hidden)]
52pub type Never = ();