litnik 0.1.0

A Rust-native, libtest-mimic integrated runner for LLVM/MLIR-style lit tests.
Documentation
litnik-0.1.0 has been yanked.

litnik

litnik is a Rust-native test runner for LLVM/MLIR-style lit suites.

It parses RUN:/XFAIL:/REQUIRES:/UNSUPPORTED: directives, executes shell-like command lines, and integrates with libtest-mimic so tests are visible as regular cargo test cases.

Quick usage

use libtest_mimic::Arguments;

fn main() {
    let suite = litnik::Suite::new(concat!(env!("CARGO_MANIFEST_DIR"), "/tests/lit"))
        .tool("butcher-opt", env!("CARGO_BIN_EXE_butcher-opt"))
        .suffix(".mlir");

    std::process::exit(suite.run(Arguments::from_args()).exit_code());
}

Integration example

You can run this crate from an examples/ binary and wire it into your src/bin-style tooling:

cargo run --example integration -- --list
cargo test

See examples/integration.rs for a minimal end-to-end setup:

  • discovers tests/lit/** recursively,
  • applies configured suffix and exclusions,
  • wires tools with Suite::tool,
  • uses libtest-mimic arguments directly.

Scope

The crate is project-agnostic:

  • Define test roots and suffixes
  • Configure tools via tool(name, path)
  • Add custom substitutions and features
  • Tune timeout, retries, and shell behavior via config builder methods

litnik intentionally keeps behavior close to upstream LLVM lit while remaining Rust-native and embeddable from Rust workspaces.