feat(vm): count line coverage of a run lowered for the debugger #222
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/191-coverage-threshold"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Refs #191
First slice of option A (line coverage in the VM): the measurement only, not yet wired into
torb test.docs/design/PROJECT.mdsection 10 records the decision: unit (a line a statement begins on, the places the debugger lowering marks), scope (the package'ssrc/files, top-level code excluded), measured in the VM only when the threshold is above 0,--nativewith a threshold is an error, the one-line failure message after the summary, rounding down and exact comparison, the--report jsoncoverageevent, known limits.compiler/src/vm/coverage.trb:Coverage, the runtime half;atStatementnotes each reached statement's location when a run has one. It imports only the bytecode format, so a binary embedding the VM carries nothing more.compiler/src/vm/coverage-report.trb:statementLinesOfreads the statement lines off the syntax tree (a function no test calls has no chunk, so the lines cannot come from the bytecode),coverageOfintersects them with the reached locations,CoverageReport.percent/meets.runProgramtakescoverage:; a coverage run keeps tasks on one thread, like a debugged run.Nodescollects every statement and every match-arm body.compiler/tests/coverage.test.trb: lines, reached lines, percent and threshold comparison of a small program.Follow-ups (next slices): wiring the setting into
torb test(message, exit code, JSON event,--nativeerror, the game-engine manifest's threshold vs the native gate), then the user documentation.c391af0a2cc314b29550Approved. Checklist for
c314b29:compiler/tests/coverage.test.trbcovers the statement lines (called, uncalled, match arms, top-level excluded), the reached lines, rounded-down percent, exactmeetsand the empty report. CI green on this head (tier A, bootstrap, gates, pdisc).statementlocations. The top-level exclusion, non-block arm bodies and the declaration skip match DEBUGGER.md section 5. Themeetscomparison is exact and safe at zero lines. Coverage runs keep tasks on one thread, so the unsynchronisedreachedlist is single-writer.torb test. The design record lands before the code, as the acceptance criteria ask.Optioncheck inside the existingstatementarm.docs/tooling/*are announced as the later slice, which is where #191 stays open.Non-blocking: none.
test { coverageThreshold }(coverage measurement) #191