Trait credibility::TestReporter [−][src]
pub trait TestReporter { fn averred<T: Sized + Debug>(&mut self, result: Result<T>); fn ran<T: Sized + Debug>(&mut self, result: Result<T, Error>); fn tally<'a>(&self, name: &'a str); }
Collects and report test statuses. This trait is used by the test block type to retain the state of a test run.
Required Methods
fn averred<T: Sized + Debug>(&mut self, result: Result<T>)
Invoked whenever the result of an aver!
is
available. If that result is the thread::Result
's Err
kind, the aver!
failed, indicating that the test should fail.
fn ran<T: Sized + Debug>(&mut self, result: Result<T, Error>)
Invoked whenever a test block finished. If result is an Err
,
indicates that the block failed. This means that the test
should abort.
fn tally<'a>(&self, name: &'a str)
Invoked at the end of life of a test block.
Panics
This method should be expected to panic if there are any test failures.
Implementors
impl TestReporter for DefaultTestReporter
impl TestReporter for TestTracker