pub trait TestAdapter {
// Required methods
fn detect(&self, project_dir: &Path) -> Option<DetectionResult>;
fn build_command(
&self,
project_dir: &Path,
extra_args: &[String],
) -> Result<Command>;
fn parse_output(
&self,
stdout: &str,
stderr: &str,
exit_code: i32,
) -> TestRunResult;
fn name(&self) -> &str;
// Provided methods
fn check_runner(&self) -> Option<String> { ... }
fn filter_args(&self, pattern: &str) -> Vec<String> { ... }
}Expand description
Trait that each language adapter must implement
Required Methods§
Sourcefn detect(&self, project_dir: &Path) -> Option<DetectionResult>
fn detect(&self, project_dir: &Path) -> Option<DetectionResult>
Check if this adapter can handle the project at the given path
Sourcefn build_command(
&self,
project_dir: &Path,
extra_args: &[String],
) -> Result<Command>
fn build_command( &self, project_dir: &Path, extra_args: &[String], ) -> Result<Command>
Build the command to run tests
Sourcefn parse_output(
&self,
stdout: &str,
stderr: &str,
exit_code: i32,
) -> TestRunResult
fn parse_output( &self, stdout: &str, stderr: &str, exit_code: i32, ) -> TestRunResult
Parse stdout/stderr from the test runner into structured results
Provided Methods§
Sourcefn check_runner(&self) -> Option<String>
fn check_runner(&self) -> Option<String>
Check if the required test runner binary is available on PATH
Sourcefn filter_args(&self, pattern: &str) -> Vec<String>
fn filter_args(&self, pattern: &str) -> Vec<String>
Return framework-specific CLI arguments to filter tests by pattern.
Different test frameworks accept filters in different ways:
- Rust: positional arg (regex)
- Go:
-run <pattern> - Python:
-k <pattern> - JS:
-t <pattern>
Returns arguments to append to extra_args.