pub struct Runner { /* private fields */ }Expand description
Runs recipes against a session backend.
Implementations§
Source§impl Runner
impl Runner
Sourcepub fn with_backend(backend: Box<dyn SessionBackend>) -> Self
pub fn with_backend(backend: Box<dyn SessionBackend>) -> Self
A runner over a supplied backend.
Sourcepub fn run(
&mut self,
recipe: &Recipe,
renderer: &str,
run_dir: &Path,
) -> Result<RunResult, ExecutionError>
pub fn run( &mut self, recipe: &Recipe, renderer: &str, run_dir: &Path, ) -> Result<RunResult, ExecutionError>
Execute one recipe under one renderer, writing evidence into run_dir.
The error case is a refusal to start, not a failed verification: a
recipe that runs and fails its steps comes back as a RunResult with
passed false. Turning a mid-run failure into a structured result is
RUST-009’s subject and is not attempted here.
Trait Implementations§
Source§impl ExecutionContext for Runner
impl ExecutionContext for Runner
Source§fn create_session(
&mut self,
argv: Vec<String>,
cwd: Option<String>,
env: HashMap<String, String>,
cols: u16,
rows: u16,
cast_path: PathBuf,
) -> Result<Box<dyn Session>, ExecutionError>
fn create_session( &mut self, argv: Vec<String>, cwd: Option<String>, env: HashMap<String, String>, cols: u16, rows: u16, cast_path: PathBuf, ) -> Result<Box<dyn Session>, ExecutionError>
Create a new terminal session via the configured backend.
Source§fn run_step(
&mut self,
session: &mut dyn Session,
step: &Value,
index: usize,
) -> ModelStep
fn run_step( &mut self, session: &mut dyn Session, step: &Value, index: usize, ) -> ModelStep
Execute a single step through the registered step registry.
Source§fn evaluate_assertion(
&self,
recipe: &Recipe,
assertion: &Value,
screen: &str,
raw_output: &str,
exit_code: Option<i32>,
) -> AssertionResult
fn evaluate_assertion( &self, recipe: &Recipe, assertion: &Value, screen: &str, raw_output: &str, exit_code: Option<i32>, ) -> AssertionResult
Evaluate a single assertion. Read more
Source§fn evaluate_assertion_with_steps(
&self,
recipe: &Recipe,
assertion: &Value,
screen: &str,
raw_output: &str,
exit_code: Option<i32>,
steps: Option<&[StepResult]>,
) -> AssertionResult
fn evaluate_assertion_with_steps( &self, recipe: &Recipe, assertion: &Value, screen: &str, raw_output: &str, exit_code: Option<i32>, steps: Option<&[StepResult]>, ) -> AssertionResult
Evaluate a single assertion, with the screen captured after each step. Read more
Source§fn evaluate_assertions(
&self,
recipe: &Recipe,
screen: &str,
raw_output: &str,
exit_code: Option<i32>,
) -> Vec<AssertionResult>
fn evaluate_assertions( &self, recipe: &Recipe, screen: &str, raw_output: &str, exit_code: Option<i32>, ) -> Vec<AssertionResult>
Evaluate all assertions (including implicit
expect_exit_code).Source§fn evaluate_assertions_with_steps(
&self,
recipe: &Recipe,
screen: &str,
raw_output: &str,
exit_code: Option<i32>,
steps: Option<&[StepResult]>,
) -> Vec<AssertionResult>
fn evaluate_assertions_with_steps( &self, recipe: &Recipe, screen: &str, raw_output: &str, exit_code: Option<i32>, steps: Option<&[StepResult]>, ) -> Vec<AssertionResult>
Evaluate all assertions, with the screen captured after each step. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Freeze for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.