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 validate_paths(&self, paths: &[PathBuf]) -> Result<(), String>
pub fn validate_paths(&self, paths: &[PathBuf]) -> Result<(), String>
Validate explicit paths before discovery. Any path ending in
.seq is treated as a file path and must match test-*.seq;
directories are fine (descent already filters). The check is
name-based, not filesystem-state-based, so it’s deterministic in
tests and surfaces the naming rule even before the file is
stat’d. Converts the previously silent zero-tests outcome on
misnamed files into a loud error.
Sourcepub fn discover_test_functions(
&self,
source: &str,
) -> Result<(Vec<String>, Vec<SkippedTest>, bool), String>
pub fn discover_test_functions( &self, source: &str, ) -> Result<(Vec<String>, Vec<SkippedTest>, bool), String>
Discover test functions in a source file.
A word is a test entry point iff its name starts with test- AND
its declared stack effect is exactly ( -- ). Words matching the
name pattern but with a different effect (e.g. a test-flag
helper with ( Int Int -- Bool )) are reported as skipped so
the runner can tell the user why the synthetic main isn’t calling
them — see issue #435 for the original confusion.
Returns (test_names, skipped, has_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