Skip to main content

ScriptTestAdapter

Struct ScriptTestAdapter 

Source
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: bool

Whether this adapter was loaded from a global config

§source: String

Source of this adapter definition (e.g., “testx.toml”, “~/.config/testx/adapters/foo.toml”)

Implementations§

Source§

impl ScriptTestAdapter

Source

pub fn new(config: ScriptAdapterConfig) -> Self

Create a new adapter from a config.

Source

pub fn from_custom_config(cfg: &CustomAdapterConfig) -> Self

Build a ScriptTestAdapter from a CustomAdapterConfig (the TOML representation).

Source

pub fn with_confidence(self, confidence: f32) -> Self

Set the confidence score.

Source

pub fn with_check(self, check: Option<String>) -> Self

Set the check command.

Source

pub fn with_source(self, source: &str) -> Self

Set the source label.

Source

pub fn with_global(self, is_global: bool) -> Self

Set the global flag.

Trait Implementations§

Source§

impl TestAdapter for ScriptTestAdapter

Source§

fn name(&self) -> &str

Name of this adapter for display
Source§

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>

Build the command to run tests
Source§

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>

Check if the required test runner binary is available on PATH
Source§

fn filter_args(&self, pattern: &str) -> Vec<String>

Return framework-specific CLI arguments to filter tests by pattern. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.