pub struct TestRunner { /* private fields */ }Expand description
Test runner that manages and executes package tests.
Actual process spawning is deferred to user-space. The runner validates test definitions and creates placeholder results.
Implementations§
Source§impl TestRunner
impl TestRunner
Sourcepub fn add_test(&mut self, test: PackageTest) -> Result<(), KernelError>
pub fn add_test(&mut self, test: PackageTest) -> Result<(), KernelError>
Add a test definition to the runner.
Returns an error if the test definition is invalid.
Sourcepub fn run_all(&mut self) -> Vec<TestResult>
pub fn run_all(&mut self) -> Vec<TestResult>
Run all registered tests and return results.
NOTE: Actual process spawning is deferred to user-space. This method
validates test definitions and creates placeholder TestResult entries
with TODO(user-space) markers. When user-space process execution is
available, this will spawn test processes and capture real output.
Sourcepub fn run_single(&mut self, name: &str) -> Option<TestResult>
pub fn run_single(&mut self, name: &str) -> Option<TestResult>
Run a single test by name and return its result.
Returns None if no test with the given name is registered.
Sourcepub fn test_count(&self) -> usize
pub fn test_count(&self) -> usize
Return the number of registered tests.
Sourcepub fn results(&self) -> &[TestResult]
pub fn results(&self) -> &[TestResult]
Return accumulated test results.
Sourcepub fn pass_count(&self) -> usize
pub fn pass_count(&self) -> usize
Count how many tests passed.
Sourcepub fn fail_count(&self) -> usize
pub fn fail_count(&self) -> usize
Count how many tests failed.