Run

Trait Run 

Source
pub trait Run {
    // Required methods
    fn dry_run(
        &self,
        context: &LightContext<'_>,
        source_file: &Path,
    ) -> Result<()>;
    fn instrument_source_file(
        &self,
        context: &LightContext<'_>,
        rewriter: &mut Rewriter<'_>,
        source_file: &SourceFile,
        n_instrumentable_statements: usize,
    ) -> Result<()>;
    fn statement_prefix_and_suffix(
        &self,
        span: &Span,
    ) -> Result<(String, String)>;
    fn build_source_file(
        &self,
        context: &LightContext<'_>,
        source_file: &Path,
    ) -> Result<()>;
    fn exec(
        &self,
        context: &LightContext<'_>,
        test_name: &str,
        span: &Span,
    ) -> Result<Option<(Exec, Option<Box<Postprocess>>)>>;
}

Required Methods§

Source

fn dry_run(&self, context: &LightContext<'_>, source_file: &Path) -> Result<()>

Source

fn instrument_source_file( &self, context: &LightContext<'_>, rewriter: &mut Rewriter<'_>, source_file: &SourceFile, n_instrumentable_statements: usize, ) -> Result<()>

Source

fn statement_prefix_and_suffix(&self, span: &Span) -> Result<(String, String)>

Source

fn build_source_file( &self, context: &LightContext<'_>, source_file: &Path, ) -> Result<()>

Source

fn exec( &self, context: &LightContext<'_>, test_name: &str, span: &Span, ) -> Result<Option<(Exec, Option<Box<Postprocess>>)>>

Execute test test_name with span removed. Returns Ok(None) if the test could not be built.

In most cases, just span.source_file is used. But in the implementation of RunLow::exec, span is used for error reporting.

Implementors§

Source§

impl<T: AsRun> Run for T