Skip to content

Run procedures in tests the way a run does, and share the test DUTs - #60

Merged
jadamcrain merged 1 commit into
mainfrom
test-runner-helper
Oct 14, 2026
Merged

jadamcrain merged 1 commit into
mainfrom
test-runner-helper

Conversation

@jadamcrain

Copy link
Copy Markdown
Member

Item 1 of #59.

  • Shared runner for tests. TestRunner.runSteps is now private[conformance]. A new test helper, Run, runs a definition the way a run does: steps, then deferred checks, then cleanup. It offers outcome, passes and passing, where passing throws unless the procedure passes.
    • About 25 tests had their own loops. Many never evaluated the deferred checks, and only four ran the cleanup.
    • passes now counts a skipped procedure as not passing.
  • Run every step. Run.everyStep runs every step whatever happens and counts the failures, as before. It's for the tests that look at every request a procedure sends, or count the steps that fail.
  • Shared test DUTs. About 25 test DUTs move onto RespondingDriver, which now has enqueue (a message or hex), responseWaiting and close.
    • StubDriver builds its reporter lazily, either from a supplied reporter or from an overridable testPlugin. The eight DUTs whose plugin refers to their own state no longer build a reporter only to replace it.
  • Debug print. Removes a leftover debug print from CtoChecksTest.

Production behavior doesn't change: the only main-code change is runSteps's visibility. The full suite passes with the same number of tests, and now evaluates deferred checks it used to skip.

Tests that run a whole procedure now go through the runner's own step
execution (Run.outcome/passes/passing): the steps, then their deferred
checks, then the cleanup. About 25 tests had their own loops, many of
which never evaluated the deferred checks or ran the cleanup. Tests that
look at every request, or count the steps that fail, use Run.everyStep.

The test DUTs that each declared a response queue now extend
RespondingDriver, and StubDriver builds its reporter lazily from an
overridable plugin, so DUTs whose plugin refers to their own state no
longer build a reporter and replace it. A leftover debug print in
CtoChecksTest is gone.

Part of #59.
@jadamcrain
jadamcrain merged commit 090b33e into main Oct 14, 2026
5 checks passed
@jadamcrain
jadamcrain deleted the test-runner-helper branch October 14, 2026 21:04
@jadamcrain jadamcrain mentioned this pull request Oct 14, 2026
8 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant