Skip to content

Commit

Permalink
Ignore inconsistencies with genhtml too
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
pcolby committed Jan 19, 2025
1 parent f84688f commit c425fe9
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]+))\..*</\1\5\6</' \
Expand Down

0 comments on commit c425fe9

Please sign in to comment.