pub struct ScriptTestAdapter {
pub is_global: bool,
pub source: String,
/* private fields */
}Expand description
A custom adapter that wraps ScriptAdapterConfig and implements the
TestAdapter trait, allowing it to participate in the detection engine
alongside built-in adapters.
Fields§
§is_global: boolWhether this adapter was loaded from a global config
source: StringSource of this adapter definition (e.g., “testx.toml”, “~/.config/testx/adapters/foo.toml”)
Implementations§
Source§impl ScriptTestAdapter
impl ScriptTestAdapter
Sourcepub fn new(config: ScriptAdapterConfig) -> Self
pub fn new(config: ScriptAdapterConfig) -> Self
Create a new adapter from a config.
Sourcepub fn from_custom_config(cfg: &CustomAdapterConfig) -> Self
pub fn from_custom_config(cfg: &CustomAdapterConfig) -> Self
Build a ScriptTestAdapter from a CustomAdapterConfig (the TOML representation).
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
Set the confidence score.
Sourcepub fn with_check(self, check: Option<String>) -> Self
pub fn with_check(self, check: Option<String>) -> Self
Set the check command.
Sourcepub fn with_source(self, source: &str) -> Self
pub fn with_source(self, source: &str) -> Self
Set the source label.
Sourcepub fn with_global(self, is_global: bool) -> Self
pub fn with_global(self, is_global: bool) -> Self
Set the global flag.
Trait Implementations§
Source§impl TestAdapter for ScriptTestAdapter
impl TestAdapter for ScriptTestAdapter
Source§fn 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
Source§fn 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
Source§fn 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
Source§fn check_runner(&self) -> Option<String>
fn check_runner(&self) -> Option<String>
Check if the required test runner binary is available on PATH
Auto Trait Implementations§
impl Freeze for ScriptTestAdapter
impl RefUnwindSafe for ScriptTestAdapter
impl Send for ScriptTestAdapter
impl Sync for ScriptTestAdapter
impl Unpin for ScriptTestAdapter
impl UnsafeUnpin for ScriptTestAdapter
impl UnwindSafe for ScriptTestAdapter
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