pub struct TestRunner {
pub verbose: bool,
pub filter: Option<String>,
pub config: CompilerConfig,
}Expand description
Test runner configuration
Fields§
§verbose: boolShow verbose output
filter: Option<String>Filter pattern for test names
config: CompilerConfigCompiler configuration
Implementations§
Source§impl TestRunner
impl TestRunner
pub fn new(verbose: bool, filter: Option<String>) -> Self
Sourcepub fn discover_test_files(&self, paths: &[PathBuf]) -> Vec<PathBuf>
pub fn discover_test_files(&self, paths: &[PathBuf]) -> Vec<PathBuf>
Discover test files in the given paths
Sourcepub fn discover_test_functions(
&self,
source: &str,
) -> Result<(Vec<String>, bool), String>
pub fn discover_test_functions( &self, source: &str, ) -> Result<(Vec<String>, bool), String>
Discover test functions in a source file Returns (test_names, has_main) - test names and whether file has its own main
Sourcepub fn run_file(&self, path: &Path) -> FileTestResults
pub fn run_file(&self, path: &Path) -> FileTestResults
Run all tests in a file
Sourcepub fn run(&self, paths: &[PathBuf]) -> TestSummary
pub fn run(&self, paths: &[PathBuf]) -> TestSummary
Run tests and return summary
Sourcepub fn print_results(&self, summary: &TestSummary)
pub fn print_results(&self, summary: &TestSummary)
Print test results
Auto Trait Implementations§
impl Freeze for TestRunner
impl RefUnwindSafe for TestRunner
impl Send for TestRunner
impl Sync for TestRunner
impl Unpin for TestRunner
impl UnwindSafe for TestRunner
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