Skip to main content

Crate skuld

Crate skuld 

Source
Expand description

Unified test harness with runtime preconditions and unavailability reporting.

Provides #[skuld::test] for annotating test functions. Tests can declare runtime preconditions (e.g. “valgrind must be installed”), fixture injection, custom display names, and labels for filtering. Tests whose preconditions are not met show as ignored with an unavailability summary after all tests run.

For dynamic test generation (e.g. from data files), use TestRunner::add to register tests at runtime alongside attribute-registered ones.

See the README for usage instructions.

Re-exports§

pub use fixture::cleanup_process_fixtures;
pub use fixture::collect_fixture_requires;
pub use fixture::collect_fixture_serial;
pub use fixture::enter_test_scope;
pub use fixture::fixture;
pub use fixture::fixture_get;
pub use fixture::fixture_registry;
pub use fixture::merge_serial_filters;
pub use fixture::warm_up;
pub use fixture::FixtureDef;
pub use fixture::FixtureHandle;
pub use fixture::FixtureRef;
pub use fixture::FixtureScope;
pub use fixture::TestScope;
pub use fixtures::cwd::cwd;
pub use fixtures::cwd::CwdGuard;
pub use fixtures::env::env;
pub use fixtures::env::EnvGuard;
pub use fixtures::temp_dir::temp_dir;
pub use fixtures::temp_dir::TempDir;
pub use fixtures::test_name::test_name;
pub use fixtures::test_name::TestName;
pub use label::Label;
pub use label::LabelFilter;
pub use label::ModuleLabels;
pub use metadata::FixtureMetadata;
pub use metadata::RequirementInfo;
pub use metadata::TestMetadata;
pub use runner::run_all;
pub use runner::TestRunner;
pub use inventory;

Modules§

fixture
Name-based fixture system with three scopes: Variable, Test, and Process.
fixtures
Built-in fixtures provided by skuld.
label
Label types, filtering, validation, and module-level defaults.
metadata
Serializable metadata about tests and fixtures for debugging and observability.
runner
Test runner: collects and executes tests via libtest-mimic.

Macros§

default_labels
Set default labels for all #[skuld::test] functions in the current module.

Structs§

CurrentTest
Metadata about the currently executing test, set by enter_test_scope.
Requirement
A named precondition check. Carries both a human-readable name and the check function itself so that metadata can be serialized without losing identity.
TestDef
A test registered by #[skuld::test(...)] via inventory.

Enums§

Ignore
Whether a test is statically ignored.
ShouldPanic
Whether a test expects a panic.

Constants§

SERIAL_ALL
Test is serial with everything — no other test may run concurrently.
SERIAL_NONE
Test is not serial — runs concurrently with everything.

Functions§

current_test
Get the current test context. Panics if called outside a test body.
test_registry
Lazily-built index from (name, module) to TestDef. O(1) lookup for metadata construction.

Attribute Macros§

fixture
Define a fixture from a function.
label
Declare a label constant. The label’s string name is the identifier lowercased (FOO"foo").
test
Register a test function with the skuld harness.