From f6b621ad400980e9e8c18498be1ea22cbb778830 Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Mon, 19 Jan 2026 15:53:52 +0300 Subject: [PATCH] ci: add branch coverage to lcov Enable branch coverage with --rc lcov_branch_coverage=1. This provides more detailed coverage metrics: - Line coverage: % of code lines executed - Function coverage: % of functions called - Branch coverage: % of if/else/switch branches taken Branch coverage is a step towards MC/DC (Modified Condition/Decision Coverage) used in safety-critical systems. Also add coverage/ to .gitignore. --- .github/workflows/ci-code.yml | 5 ++++- .gitignore | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-code.yml b/.github/workflows/ci-code.yml index 14d11848..25b2f957 100644 --- a/.github/workflows/ci-code.yml +++ b/.github/workflows/ci-code.yml @@ -113,10 +113,13 @@ jobs: make -j$(nproc) make check || true make check-functional-parallel || true - lcov --capture --directory . --output-file /coverage/coverage.info --ignore-errors inconsistent + lcov --capture --directory . --output-file /coverage/coverage.info \ + --rc lcov_branch_coverage=1 \ + --ignore-errors inconsistent lcov --remove /coverage/coverage.info \ "/usr/include/*" "*/tests/*" \ --output-file /coverage/coverage.info \ + --rc lcov_branch_coverage=1 \ --ignore-errors inconsistent,empty,unused ' - name: Upload coverage to Codecov diff --git a/.gitignore b/.gitignore index 6e24b69c..59b5eab2 100644 --- a/.gitignore +++ b/.gitignore @@ -107,3 +107,4 @@ breaks *.tar.* *.zip *.log* +coverage/