Lockstep.Runner (Lockstep v0.1.0)

Copy Markdown View Source

Runs a controlled test body N times. On bug: saves the trace and raises Lockstep.BugFound with a formatted schedule.

Summary

Functions

Run a single iteration and return the outcome instead of raising.

Functions

run(test_fun, opts \\ [])

@spec run(
  (-> any()),
  keyword()
) :: :ok

try_iteration(test_fun, opts)

@spec try_iteration(
  (-> any()),
  keyword()
) :: {:pass, list()} | {:fail, term(), list()}

Run a single iteration and return the outcome instead of raising.

Useful for tools that need to introspect bug-finding (e.g., Lockstep.Shrink) rather than fail the surrounding test.

Same options as run/2 but :iterations is ignored (always 1). Returns {:pass, trace} or {:fail, reason, trace}.