Skip to main content

TestRunnerTrait

Trait TestRunnerTrait 

Source
pub trait TestRunnerTrait: Send + Sync {
    // Required methods
    fn run_syntax_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run_tests<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn run_build_check<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn name(&self) -> &str;

    // Provided methods
    fn run_lint<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn run_stage<'life0, 'async_trait>(
        &'life0 self,
        stage: VerifierStage,
    ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Expand description

PSP-5: Language-agnostic test runner trait

Allows the orchestrator to run verification steps through any language’s toolchain without hardcoding Python paths.

Required Methods§

Source

fn run_syntax_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run syntax/type check (e.g., cargo check, uv run ty check .)

Source

fn run_tests<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run the test suite (e.g., cargo test, uv run pytest)

Source

fn run_build_check<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run build check (e.g., cargo build)

Source

fn name(&self) -> &str

Name of the runner (for logging)

Provided Methods§

Source

fn run_lint<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run lint check (e.g., cargo clippy, uv run ruff check .)

Default: returns a no-op pass for plugins without a lint stage.

Source

fn run_stage<'life0, 'async_trait>( &'life0 self, stage: VerifierStage, ) -> Pin<Box<dyn Future<Output = Result<TestResults>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run a specific verifier stage by enum variant.

Dispatches to the appropriate method. Convenience for generic callers.

Implementors§