pub struct Tester { /* private fields */ }Expand description
A tester structure.
The tester tests a library or libraries by running the tests which were written by a programmer. The test results can be collected by the tester in order to print the test results for the programmer.
Implementations§
Source§impl Tester
impl Tester
Sourcepub fn new(
root_mod: Arc<RwLock<ModNode<Value, ()>>>,
lib_path: OsString,
doc_path: OsString,
printer: Arc<dyn Print + Send + Sync>,
are_stdout_cursors: bool,
are_stderr_cursors: bool,
) -> Self
pub fn new( root_mod: Arc<RwLock<ModNode<Value, ()>>>, lib_path: OsString, doc_path: OsString, printer: Arc<dyn Print + Send + Sync>, are_stdout_cursors: bool, are_stderr_cursors: bool, ) -> Self
Creates a tester.
This method the root module, the library paths, the documentation library and the printer that prints the messages. The flags of cursors determines whether data from the standard output and the standard error are collect by the cursors.
Returns the shared environment.
Sourcepub fn stack_trace(&self) -> &[(Option<Value>, Pos)]
pub fn stack_trace(&self) -> &[(Option<Value>, Pos)]
Returns the stack trace.
Sourcepub fn test_results(&self) -> &[((Vec<String>, String), TestResult)]
pub fn test_results(&self) -> &[((Vec<String>, String), TestResult)]
Returns the test results.
Sourcepub fn has_stdout_cursors(&self) -> bool
pub fn has_stdout_cursors(&self) -> bool
Returns the flag of cursor of standard output.
Sourcepub fn has_stderr_cursors(&self) -> bool
pub fn has_stderr_cursors(&self) -> bool
Returns the flag of cursor of standard error.
Sourcepub fn run_test(&mut self, idents: &Vec<String>, ident: &String) -> Result<()>
pub fn run_test(&mut self, idents: &Vec<String>, ident: &String) -> Result<()>
Runs the specified test by the idenfiers of modules and the function identifer.
Sourcepub fn run_tests_in_test_suite(&mut self, idents: &Vec<String>) -> Result<()>
pub fn run_tests_in_test_suite(&mut self, idents: &Vec<String>) -> Result<()>
Runs the tests in the specified test suite by the identifiers of modules.
Sourcepub fn run_all_tests(&mut self) -> Result<()>
pub fn run_all_tests(&mut self) -> Result<()>
Runs all tests.
Sourcepub fn print_empty_line(&self)
pub fn print_empty_line(&self)
Prints an empty line.
Sourcepub fn print_successes(&self) -> Result<()>
pub fn print_successes(&self) -> Result<()>
Prints the test successes.
Sourcepub fn print_failures(&self) -> Result<()>
pub fn print_failures(&self) -> Result<()>
Prints the test failures.
Sourcepub fn print_test_counts(&self)
pub fn print_test_counts(&self)
Prints the number of passed tests and the number of failed tests.
Auto Trait Implementations§
impl !RefUnwindSafe for Tester
impl !Send for Tester
impl !Sync for Tester
impl !UnwindSafe for Tester
impl Freeze for Tester
impl Unpin for Tester
impl UnsafeUnpin for Tester
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.