Documentation
¶
Overview ¶
Package mcov is m-cli's coverage runner (spec §3.1/§8). On YottaDB it uses built-in line tracing: `view "TRACE":1:"^ycov":""` makes every executed line increment ^ycov(routine, LABEL, offset) where offset is from the owning label's declaration line. The host enumerates executable lines from the parse tree (the denominator), runs the suites under trace, then joins the ^ycov dump (the numerator) back to absolute lines for LCOV.
(IRIS coverage via ^%MONLBL — absolute lines, no offset reconciliation — is the parity follow-up; this package implements the YDB path.)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildScript ¶
BuildScript composes the YDB direct-mode trace script: reset ^ycov, enable line tracing, run every suite entry, disable tracing, dump ^ycov, halt.
Types ¶
type ExecLine ¶
ExecLine is one executable source line, with the YDB trace offset (the line's distance from its owning label's declaration line).
func DiscoverExecutables ¶
DiscoverExecutables walks each routine file and returns its executable lines. A line is executable iff its `line` AST node has a `command_sequence` child (comment-only and label-only lines are excluded — YDB's TRACE emits no hits for them, so their absence never means "uncovered"). Each line carries the owning label and its YDB trace offset = lineNumber − labelDeclarationLine.
type FileCov ¶
FileCov is one source file's coverage rollup.
type Result ¶
Result is the aggregate coverage outcome.
func FromMonitor ¶
FromMonitor builds a coverage Result from a raw ##MON block (the MLINE lines the resident harness's IRIS line monitor emits, design §3.2) joined to the executable lines of routinePaths. The executable-line denominator stays host-side (the parse tree) and the monitor data is identical to what the host-orchestrated runIris collects, so resident coverage == file-side coverage by construction (G4). The host owns the parse tree the resident M side lacks.
func ParseLCOV ¶
ParseLCOV reads an LCOV tracefile into a Result. It is the inverse of LCOV: a coverage payload that arrives as text (the resident harness ##LCOV frame block, §3.2) parses back here so it feeds the same ByFile / Percent / gutter consumers a host-side mcov.Run produces — the parity contract. Only SF: and DA: lines carry data; TN:/LF:/LH:/end_of_record and anything else are ignored (so output of this package's own LCOV, with its TN:/LF:/LH: lines, round-trips and a foreign producer's extra records do not break the parse).
func Run ¶
func Run(ctx context.Context, p *parse.Parser, eng engine.Engine, routinePaths, suiteEntries []string) (Result, error)
Run enumerates executable lines in routinePaths, runs the suites under the engine's line tracer, and joins per-line hits back to those lines. YDB uses view "TRACE" → ^ycov (label-relative offsets); IRIS uses the LineByLine monitor (absolute lines).