From c425fe973cbcd27fc258deb79503275a16aad3ca Mon Sep 17 00:00:00 2001 From: Paul Colby Date: Sun, 19 Jan 2025 16:14:49 +1100 Subject: [PATCH] Ignore inconsistencies with genhtml too Required for LCOV v2.3+ Note, these inconsistencies arise because Clang and GCC instrumentation differs in their record of which lines some function begin and end, especially when the functions' openning `{` is on the following line from the function declartion. Hopefully the two will agree one day, but I very much doubt it. Possibly the `lcov` and `genhtml` commands will reconcile, but I wouldn't expect that to be any time soon. Also added `x86-64` to the `removeHtmlDates.sh` script path, because since Linux arm64 support in #d54fbbc, the glob was matching two instances, which the Bash invocation was silently ignoring. --- .github/workflows/build.yaml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f00730053..cb1a3611f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -732,14 +732,12 @@ jobs: sed -i -Ee 's|^SF:/Users|SF:/home|' artifacts/*.macos-*/**/coverage.info # Update source code paths from Windows tracefiles to match Linux, and remove all \r chars from line endings. sed -i -Ee 's|\r$||' -e 's|\\|/|g' -e 's|^SF:D:/a|SF:/home/runner/work|' artifacts/*.win.*/**/coverage.info - # Combine all tracefiles into one. - tee -a "$HOME/.lcovrc" <<< 'check_data_consistency = 0' - lcov $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info - # Generate the HTML report. - tee -a "$HOME/.lcovrc" <<< 'genhtml_sort = 0' - genhtml --output-directory coverage/coverage coverage.info - # Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu GCC Qt6 job's version will do. - /usr/bin/env bash ./artifacts/test-results-*.gcc.qt-6/coverage/removeHtmlDates.sh + # Combine all tracefiles into one. Note, ignoring inconsistencies between Clang and GCC reports :| + lcov --ignore-errors inconsistent $(find artifacts -name '*.info' -type f -printf '-a %p\n') -o coverage.info + # Generate the HTML report. Note, ignoring inconsistencies between Clang and GCC reports :| + genhtml --ignore-errors inconsistent --no-sort --output-directory coverage/coverage coverage.info + # Can use any of the removeHtmlDates.sh scripts here, so the Ubuntu x86-64 GCC Qt6 job's version will do. + /usr/bin/env bash ./artifacts/test-results-*.x86-64.gcc.qt-6/coverage/removeHtmlDates.sh # Remove build numbers from pre-releases, and remove extra build info (such as ".linux.x86-64.gcc.qt-6") # from all releases, since this coverage report is an aggregation of many build hosts. sed -i -Ee 's/(headerValue">([0-9]+\.){2}[0-9]+)(((-pre)\+[0-9]+)|(\+[0-9]+))\..*