litnik 0.2.1

An embedded Lit and FileCheck runner for compiler test suites.
Documentation
//! Preparation and execution of Lit `RUN:` directives.

use crate::config::LitConfig;
use crate::runner::RunContext;
use crate::test::{Test, TestResult};

/// Prepares and runs one discovered test.
///
/// Use the same configuration for discovery and execution. Execution settings
/// from `config` replace the snapshot stored in `test`. The function applies
/// feature conditions, substitutions, retries, time limits, and `XFAIL:`
/// mapping. It stores a clone of the returned result in [`Test::result()`].
///
/// # Blocking
///
/// This function reads the test file and waits for child processes. A time
/// limit can stop child processes but cannot interrupt an embedded command
/// while that command is running.
pub fn run(test: &mut Test, config: &LitConfig) -> TestResult {
    let runner = RunContext::new(config.clone());
    runner.run_with_retries(test)
}