Skip to main content

Runner

Struct Runner 

Source
pub struct Runner { /* private fields */ }
Expand description

Runs a corpus.

Implementations§

Source§

impl Runner

Source

pub fn new(config: EvalConfig) -> Self

A runner with this configuration and no judge, which is all a corpus of deterministic assertions needs.

Source

pub fn with_judge(self, judge: Arc<Judge>) -> Self

Attaches a judge, used only for the criteria an item asks for.

Source

pub const fn config(&self) -> &EvalConfig

The configuration in force.

Source

pub async fn run(&self, suite: &Suite, harness: &dyn EvalHarness) -> EvalReport

Runs every selected item of suite.

Source

pub async fn run_control( &self, suite: &Suite, harness: &dyn EvalHarness, ) -> ControlRun

Runs the same suite twice, against the same harness, and hands back both reports as a ControlRun.

This is how the noise floor stops being an assumption. Nothing changes between the two passes — same corpus, same harness, same code — so whatever difference ControlRun::noise_floor finds is the harness’s own variation, and a later comparison can say whether a difference exceeds it instead of leaving a reader to guess.

It costs exactly twice a run, which is the honest price of knowing whether the first one meant anything.

let control = Runner::new(EvalConfig::default().with_samples_per_item(10))
    .run_control(suite, harness)
    .await;
let floor = control.noise_floor();
println!("{}", floor.summary());
Source

pub async fn run_item( &self, item: &EvalItem, harness: &dyn EvalHarness, ) -> ItemReport

Runs one item, samples_per_item times, at most sample_concurrency of them at once.

The default concurrency of one reproduces the strictly serial behaviour exactly. Above one the samples execute interleaved — which is the point, when each of them is a call to a real endpoint — but the report does not move: the samples come back in index order either way, and the same set of results comes back whatever the setting is.

Source

pub async fn run_sample( &self, item: &EvalItem, harness: &dyn EvalHarness, sample: SampleIndex, ) -> SampleReport

Runs one sample of one item.

Trait Implementations§

Source§

impl Debug for Runner

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more