diff --git a/ci-build.sh b/ci-build.sh index dcf3ccca..8e7dce78 100755 --- a/ci-build.sh +++ b/ci-build.sh @@ -259,16 +259,10 @@ build_and_test() { if [ "$run_coverage" = "yes" ]; then echo "--> Collecting coverage data..." if command -v lcov >/dev/null 2>&1; then - lcov --capture --directory . --output-file coverage.info \ + lcov --capture --directory . --output-file coverage-full.info \ --rc lcov_branch_coverage=1 --ignore-errors inconsistent 2>&1 || true - # Remove test files, stubs, system headers - only keep src/ production code - lcov --remove coverage.info \ - '/usr/*' \ - '*/tests/*' \ - '*test*.c' \ - '*stub*.c' \ - '*/functionaltests/*' \ - '*/unittests/*' \ + # Extract only production code from src/ directory, exclude tests + lcov --extract coverage-full.info '*/src/src/*' \ --output-file coverage.info \ --rc lcov_branch_coverage=1 --ignore-errors inconsistent 2>&1 || true if [ -f coverage.info ] && [ -s coverage.info ]; then