diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/gen_coverage_report.sh | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/scripts/gen_coverage_report.sh b/scripts/gen_coverage_report.sh index b569251..46eb98f 100755 --- a/scripts/gen_coverage_report.sh +++ b/scripts/gen_coverage_report.sh @@ -9,8 +9,9 @@ BUILD_DIR="${PROJECT_ROOT}/build_coverage" REPORT_DIR="${PROJECT_ROOT}/build_coverage/coverage_report" TARGET_FILTER="$1" -# Common lcov options to handle AppleClang quirks -LCOV_OPTS="--ignore-errors mismatch,inconsistent,gcov,format,unsupported,category" +# Common lcov options to handle AppleClang quirks and missing source files +# (source errors can occur when files are moved/renamed between coverage runs) +LCOV_OPTS="--ignore-errors mismatch,inconsistent,gcov,format,unsupported,category,source" echo "=== Code Coverage Report Generator ===" echo "Project Root: ${PROJECT_ROOT}" @@ -25,8 +26,12 @@ if ! command -v lcov &> /dev/null; then exit 1 fi -# Cleanup previous build if requested (optional, but safer for coverage) -# rm -rf "${BUILD_DIR}" +# Cleanup previous build to avoid stale coverage data from moved/renamed files +echo "--- Cleaning Previous Coverage Build ---" +if [ -d "${BUILD_DIR}" ]; then + echo "Removing stale build directory: ${BUILD_DIR}" + rm -rf "${BUILD_DIR}" +fi mkdir -p "${BUILD_DIR}" cd "${BUILD_DIR}" |
