Skip to content

Main content

Development: LCOV Branch Record Line Parser Tool

Parse one bounded LCOV BRDA branch record with unknown execution retained separately from zero; not a coverage report or merger.

Loading tool…

Description

Parse one bounded LCOV branch record.

Coverage records distinguish source locations, hit counts and unknown observations. Parsing one LCOV line or branch token preserves its metadata but does not establish that source mapping, collection or overall coverage is correct.

Parse one bounded LCOV branch record.

When to use this tool

Use Development: LCOV Branch Record Line Parser when inspecting one bounded coverage-record token.

How to use the tool and how it works

  1. Enter line. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read result. Expand result to inspect the returned fields.

Parse one bounded LCOV branch record. Accept BRDA: with numeric line/block/branch and numeric taken or -; line must be positive; unknown taken returns -1 with executionKnown = false.1

Input fieldMeaning and unitsAccepted input
lineLineRequired. Text. Implementation limit: 8192 Unicode code points and 16384 UTF-16 code units.
Output fieldInterpretationReturned shape
resultReturned object; expand its named members below.Required. Object.
result.lineNumberLine NumberCalculated result member: number.
result.blockBlockCalculated result member: number.
result.branchBranchCalculated result member: number.
result.takenParsed count, or -1 sentinel for the literal unknown token.Calculated result member: number.
result.executionKnownFalse when the taken field is the unknown marker; inspect before using taken numerically.Calculated result member: boolean.
json
{
  "input": {
    "line": "BRDA:10,0,1,-"
  },
  "output": {
    "result": {
      "lineNumber": 10,
      "block": 0,
      "branch": 1,
      "taken": -1,
      "executionKnown": false
    }
  }
}

Limitations and assumptions

  • This sentinel differs from the separate count parser's zero; no source branch is verified.
  • Outputs are nested inside result. Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.

Alternative or Complementary methods

Use the complete coverage report and matching source revision for aggregation, validation and meaningful testing conclusions.

References

  1. Calculation and input contract: development/lcov-branch-record-line-parser — tool.io

Similar or alternative tools