coverage#

Configure (if needed) and generate a coverage report, or check coverage against configured thresholds.

clibra coverage --preset coverage          # generate HTML report
clibra coverage --preset coverage --check  # check thresholds
clibra coverage --preset coverage --open   # generate and open in browser

Requires LIBRA_COVERAGE to be ON in the preset’s CMake cache.

CMake equivalent#

clibra coverage discovers the first available HTML-generating target from the ordered list [gcovr-report, llvm-report] by querying the help-targets output. The check target (gcovr-check) is looked up directly.

# HTML report (gcovr)
cmake --build --preset <n> --target gcovr-report

# HTML report (llvm-cov, used if gcovr-report unavailable)
cmake --build --preset <n> --target llvm-report

# Threshold check
cmake --build --preset <n> --target gcovr-check

Coverage thresholds are configured via LIBRA_GCOVR_LINES_THRESH, LIBRA_GCOVR_FUNCTIONS_THRESH, LIBRA_GCOVR_BRANCHES_THRESH, and LIBRA_GCOVR_DECISIONS_THRESH. See Analysis and formatting targets for the full target reference.

Flag reference#

clibra coverage#

Configure (if needed) and generate a coverage report/check coverage.

Fails if neither of those operations are possible. Requires LIBRA_COVERAGE=ON in the preset’s CMake cache. The preset defaults to coverage if not given.

Usage: clibra coverage [OPTIONS]

Options:#

  • --html — Generate HTML report.

    Tries gcovr and LLVM-based generation in order.

  • --check — Check code coverage with gcovr

  • --open — Open the HTML report in the system browser after generation

  • -D <VAR=VALUE>

  • -r, --reconfigure — Force the configure step even if the build directory exists

  • -f, --fresh — Reconfigure with a –fresh cmake build directory