Expand description
v0.59: the bynkc test --format json result model, plus the parser that
folds the runner’s NDJSON event stream into it.
The generated tests/main.ts runner emits one JSON event per line when
BYNK_TEST_FORMAT=ndjson (an internal protocol — proposal v0.59,
Decision 2); run_test captures that stream and renders the single pinned
document below. The document is built from #[derive(Serialize)] structs
in declaration order — field order is the contract (the discipline
bynk/src/report.rs calls out); we never use serde_json::json!, so the
preserve_order feature some workspace crates enable can’t reorder it.
There are three terminal states, distinguished by the consumer on the
presence/kind of error:
- normal —
suitespresent, noerror(may havefailed > 0); - compile — the project never compiled: no
suites,error.kind == "compile"carrying thebynkcdiagnostic lines; - runtime — the runner started then died before
run-end: the observedsuitesprefix anderror.kind == "runtime"with the captured stderr.
Structs§
- Case
- Location
- Parsed
Run - The outcome of parsing the runner’s NDJSON stream: the suites observed, the
running tallies, and whether a
run-endevent was seen (a missingrun-endmeans the runner died mid-stream — a crashed/incomplete run). - Suite
- Test
Error - TestRun
- The pinned
bynkc test --format jsondocument.
Functions§
- parse_
ndjson - Parse the runner’s NDJSON stdout into a
ParsedRun. Unparseable or unrecognised lines are skipped (the stream is an internal protocol; a stray line should never abort the whole report).