Skip to main content

Module testrun

Module testrun 

Source
Expand description

The largo test runner core.

Studio-reusable: everything here is CLI-independent. The runner discovers ## Test blocks in a parsed program, executes each in a FRESH interpreter world (fixture pollution is structurally impossible), applies the constitution’s semantics — Expect records-and-continues, Expect this to fail fails on success, Expect output: compares byte-exact, deterministic op budgets, loud skips — and renders a DETERMINISTIC report (name-ordered, byte-identical across -j N; the golden in test_runner_lock.rs).

Structs§

Inventory
The whole inventory: every classified claim plus its rolled-up summary.
InventoryItem
ONE classified claim in the inventory.
InventorySummary
The rolled-up census the inventory carries alongside its items — the internally-consistent counts (examples + properties + theorems + axioms + admitted == claims; proven ⊆ properties + theorems).
PropertyInfo
The For all property a test exercised, if any — its domain (for bound disclosure) and how many variables it quantified (for the exhaustion bound).
ProvenClaim
A theorem/axiom claim handed to the inventory by the prove path. Kept tiny so the CLI’s Outcome/prove report can map onto it without a dependency cycle.
RunReport
The whole run, name-ordered (report order is part of determinism).
TestConfig
Runner configuration.
TestOutcome
One executed (or skipped) test.
TierSummary
A machine-readable census of which EXECUTION TIERS a largo test run actually exercised — the runner’s answer to G14’s “a green run must be legible about what it proved”. The tree-walking interpreter is the always-on reference tier (every ## Test runs on it); the bytecode VM tier is a cross-tier VALIDATOR that only runs under --tiers all, and when it does, each test’s TierEvidence says whether the VM agreed, refused, or diverged. Derived purely from the report, so the census can never drift from the evidence it summarizes.

Enums§

ClaimKind
The KIND of a claim — the top-level partition the inventory reports over.
ClaimStatus
The honest per-item status.
PropertyDomain
The finite domain a For all property quantified over, with the concrete bound the runner actually enumerated/sampled — the disclosure that keeps a green property from silently meaning “unbounded proof” (G13-full). Carried on the TestOutcome so the inventory can classify a property honestly.
Rank
The earned rank of a run — a ladder computed from EVIDENCE, never self-declared. The higher rungs (COVERED/HARDENED/PROVEN/BATTLE-READY) require coverage, mutation, proofs, and the full inspection, which light up as those waves land; the runner computes the base rungs honestly today.
TierEvidence
Cross-tier evidence for one test under --tiers all (footgun F18): what the bytecode VM did with the test’s computation, machine-readable in the JSON report. Absent (None on TestOutcome::tier) when the guard did not run — evidence is never invented.
Verdict
One test’s verdict.

Functions§

render_fitness
Render the fitness report (§1.12) — the last block of every run: the earned rank and the evidence behind it, with the next rung named.
render_report
Render the human report — deterministic, golden-locked (test_runner_lock).
render_report_json
Render the machine report (--format json).
render_test_inventory_json
Render the largo test --json inventory document: the classified claims plus their summary, the seed, and the raw outcomes (so a consumer keeps both the classification and the underlying detail from one call).
render_tier_summary
Render the machine-readable tier census as ONE greppable line, mirroring the LOGOS_VALIDATORS_RAN: convention the Rust suite uses for external validators. A CI/release gate greps LOGOS_TIERS_RAN: to see, at a glance, which execution tiers a green largo test actually exercised — the interpreter always, the VM cross-tier validator only under --tiers all. When the VM validator was OFF, the line says so explicitly (vm=off), so a fast default run never masquerades as having proven cross-tier agreement it never ran.
run_tests
Discover and execute every ## Test in source. Each test runs in a fresh interpreter world; the report is deterministic and name-ordered.
run_tests_with_launcher
run_tests, with a live crate::page_host::RemotePageLauncher so a MOUNTED test’s TestConfig::page_tiers can also exercise a Browser candidate — the seam largo test --browser calls through once a real one exists (apps/logicaffeine_cli/src/browser/**). None reports a Browser candidate as tier: refused, never a silent skip.
tier_divergence
Compare one test computation’s run on the interpreter against its run on the bytecode VM — the --tiers all comparison, PURE so it is unit-lockable with synthetic divergent inputs. Both outputs are newline-joined lines (the shared engine convention), compared byte-for-byte in FULL; error text is compared exactly; the outcome class (clean vs errored) falls out of the error comparison. Returns None on agreement, or the divergence bundle.