diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2024-11-15 14:31:53 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-11-15 16:54:28 +0100 |
commit | 238ddac1653fd94d402d97475d627374cd89ed8e (patch) | |
tree | 1ddeba41958c1defe101cc5d023df64ae8630f22 /test/test-functions | |
parent | boot: make .hwids PE section more flexible to cover more than DT one day (diff) | |
download | systemd-238ddac1653fd94d402d97475d627374cd89ed8e.tar.xz systemd-238ddac1653fd94d402d97475d627374cd89ed8e.zip |
test: ignore inconsistent coverage errors
lcov 2.1 introduced additional consistency checks [0] which make it trip
over our coverage results quite often:
Summary coverage rate:
source files: 915
lines.......: 36.9% (78950 of 214010 lines)
functions...: 53.3% (6906 of 12949 functions)
Message summary:
73 warning messages:
inconsistent: 73
lcov: ERROR: (corrupt) unable to read trace file '/var/tmp/systemd-test-TEST-04-JOURNAL/coverage-info.new': lcov: ERROR: (inconsistent) "/build/src/shutdown/umount.c":298: function 'umount_with_timeout' is not hit but line 317 is.
To skip consistency checks, see the 'check_data_consistency' section in man lcovrc(5).
(use "lcov --ignore-errors inconsistent ..." to bypass this error)
(use "lcov --ignore-errors corrupt ..." to bypass this error)
This is caused by coverage collected during shutdown which is a bit
unreliable, especially towards the final shutdown stage(s). Let's just
ignore the consistency errors for now.
[0] https://github.com/linux-test-project/lcov/releases/tag/v2.2
Diffstat (limited to 'test/test-functions')
-rw-r--r-- | test/test-functions | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test-functions b/test/test-functions index c64c511935..eb581d348d 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1712,18 +1712,18 @@ check_coverage_reports() { # Create a coverage report that will later be uploaded. Remove info about system # libraries/headers and generated files, as we don't really care about them. - lcov --directory "${root}/${BUILD_DIR:?}" --capture --exclude "*.gperf" --output-file "${dest}.new" + lcov --ignore-errors inconsistent --directory "${root}/${BUILD_DIR:?}" --capture --exclude "*.gperf" --output-file "${dest}.new" if [[ -f "$dest" ]]; then # If the destination report file already exists, don't overwrite it, but # merge it with the already present one - this usually happens when # running both "parts" of a test in one run (the qemu and the nspawn part). - lcov --add-tracefile "${dest}" --add-tracefile "${dest}.new" -o "${dest}" + lcov --ignore-errors inconsistent --add-tracefile "${dest}" --add-tracefile "${dest}.new" -o "${dest}" else # If there's no prior coverage report, merge the new one with the base # report we did during the setup phase (see test_setup()). - lcov --add-tracefile "${TESTDIR:?}/coverage-base" --add-tracefile "${dest}.new" -o "${dest}" + lcov --ignore-errors inconsistent --add-tracefile "${TESTDIR:?}/coverage-base" --add-tracefile "${dest}.new" -o "${dest}" fi - lcov --remove "$dest" -o "$dest" '/usr/include/*' '/usr/lib/*' "${BUILD_DIR:?}/*" + lcov --ignore-errors inconsistent --remove "$dest" -o "$dest" '/usr/include/*' '/usr/lib/*' "${BUILD_DIR:?}/*" rm -f "${dest}.new" # If the test logs contain lines like: |