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.
The code is built in /usr/src/profanity/ inside Docker, so
excluding '/usr/*' removes all source files!
Fix: exclude only system headers/libs (/usr/include/*, /usr/lib/*),
not the entire /usr/ tree.
Also add --ignore-errors empty to handle edge cases.
- Add --enable-coverage option to configure.ac
- Add coverage and coverage-html targets to Makefile.am
- Add coverage CI job with Codecov upload
- Add lcov to all Dockerfiles (arch, debian, fedora, tumbleweed, ubuntu)
Usage:
./configure --enable-coverage
make check
make coverage-html