skuld¶
Test harness for Rust with runtime preconditions, fixture injection, and label filtering.
Rust’s built-in test framework has no way to mark a test as “ignored with reason” at runtime. Tests that need external tools (valgrind, docker, a built binary) either silently pass when the tool is missing, or hard-fail. skuld replaces the built-in harness with one that checks preconditions at runtime, reports unmet ones as ignored, and prints a summary showing exactly what’s missing.
Get started with the Getting Started guide.
Features¶
Runtime preconditions — declare what a test needs; unmet preconditions produce
ignored, not failures.Fixture injection — dependency-injected test resources with three lifetime scopes.
Label filtering — tag tests with sentinel
Labelvalues and filter via theSKULD_LABELSenvironment variable.Serial tests — tests that touch process-global state run under a mutex.
Dynamic tests — generate tests at runtime from data files or other sources.
Unavailability reporting — a summary after the test run shows exactly what’s missing.
How it works¶
#[skuld::test]is a proc macro that preserves the original function and appends aninventory::submit!call to register it with the harness.run_all()(orTestRunner::run_tests()) iterates all registered tests, checks preconditions and fixture requirements at runtime, and buildslibtest-mimic::Trials — marking unmet tests as ignored.After
libtest-mimic::run()completes, the unavailability summary is printed to stderr.
License¶
Copyright 2026, Anna Zhukova
This project is licensed under the Apache 2.0 license (full text).
About¶
Skuld is the youngest of the three Norns in Norse mythology — the weavers of fate who sit beneath the world-tree Yggdrasil. While her sisters Urðr and Verðanði govern the past and the present, Skuld presides over what shall be: obligations yet unfulfilled, debts yet unpaid. Her name shares its root with the English word should.