Skip to main content

grommet_testkit/
lib.rs

1//! Testing tools for schedulers and processors built on `grommet`.
2//!
3//! The runtime can be proven correct on its own, but your processor is where
4//! the interesting failures live: a lost acknowledgement, a retry that applies
5//! twice, a cache that outlives the value it caches. This crate provides the
6//! machinery to find those, generic over your fault labels and your workload.
7//!
8//! - [`FaultPlan`] injects failures at points you label, either in a fixed
9//!   order, at one chosen position, or steered by a fuzzer.
10//! - [`conformance::single_fault_campaign`] runs your workload once per
11//!   reachable failure position and insists every one of them recovers.
12//! - [`conformance::assert_idempotent`] replays one request and insists only
13//!   the first application changed anything.
14//! - [`conformance::scheduler_sweep`] drives your scheduler configuration
15//!   through a mixed workload, checking every structural invariant and
16//!   measuring the starvation bound.
17//! - [`Deterministic`] plus [`conformance::assert_deterministic`] turn "this is
18//!   reproducible" from an unchecked claim into a test.
19//!
20//! Nothing here is a marker trait that grants correctness by being implemented.
21//! Every check runs your code and reports what it observed.
22
23#![deny(unsafe_code)]
24
25pub mod conformance;
26pub mod determinism;
27pub mod fault;
28
29pub use conformance::{CampaignReport, CaseOutcome, SweepReport, SweepSpec};
30pub use determinism::Deterministic;
31pub use fault::{FaultPlan, FaultPoint};
32
33pub use grommet::clock::ManualClock;
34pub use grommet::offload::InlineOffload;