[scripts] lcov.sh: Ignore some more errors.

TODO: Figure out what's causing these errors and fix them.
For now, they're being ignored, since they prevent the coverage report
from being generated.
This commit is contained in:
David Korth 2025-02-01 11:06:57 -05:00
parent f4318755e6
commit d6d929aa67

View File

@ -33,7 +33,7 @@ lcov ${LCOV_RC} --directory . --zerocounters
# References: # References:
# - https://stackoverflow.com/questions/44203156/can-lcov-genhtml-show-files-that-were-never-executed # - https://stackoverflow.com/questions/44203156/can-lcov-genhtml-show-files-that-were-never-executed
# - https://stackoverflow.com/a/45105825 # - https://stackoverflow.com/a/45105825
lcov ${LCOV_RC} --ignore-errors inconsistent,mismatch \ lcov ${LCOV_RC} --ignore-errors inconsistent,inconsistent,mismatch \
-c -i -d . -o "${coverage_base_info}" -c -i -d . -o "${coverage_base_info}"
# Run tests. # Run tests.
@ -43,17 +43,17 @@ if [ "$?" != "0" ]; then
fi fi
# Capture lcov output from the unit tests. # Capture lcov output from the unit tests.
lcov ${LCOV_RC} --ignore-errors inconsistent,mismatch \ lcov ${LCOV_RC} --ignore-errors inconsistent,inconsistent,mismatch \
-c -d . -o "${coverage_test_info}" -c -d . -o "${coverage_test_info}"
# Combine baseline and unit test output. # Combine baseline and unit test output.
lcov ${LCOV_RC} --ignore-errors inconsistent,corrupt,mismatch \ lcov ${LCOV_RC} --ignore-errors inconsistent,inconsistent,corrupt,mismatch \
-a "${coverage_base_info}" \ -a "${coverage_base_info}" \
-a "${coverage_test_info}" \ -a "${coverage_test_info}" \
-o "${coverage_info}" -o "${coverage_info}"
# Remove third-party libraries and generated sources. # Remove third-party libraries and generated sources.
lcov ${LCOV_RC} --ignore-errors unused \ lcov ${LCOV_RC} --ignore-errors unused,inconsistent \
-o "${coverage_cleaned}" -r "${coverage_info}" \ -o "${coverage_cleaned}" -r "${coverage_info}" \
'*/tests/*' '/usr/*' '*/extlib/*' \ '*/tests/*' '/usr/*' '*/extlib/*' \
'*/moc_*.cpp' '*.moc' '*/ui_*.h' '*/qrc_*.cpp' \ '*/moc_*.cpp' '*.moc' '*/ui_*.h' '*/qrc_*.cpp' \
@ -69,6 +69,7 @@ lcov ${LCOV_RC} --ignore-errors unused \
'*/libi18n/gettext.h' '*/libi18n/gettext.h'
# Generate the HTML report. # Generate the HTML report.
genhtml ${LCOV_RC} -o "${outputname}" "${coverage_cleaned}" genhtml ${LCOV_RC} --ignore-errors inconsistent,corrupt \
-o "${outputname}" "${coverage_cleaned}"
rm -f "${coverage_base_info}" "${coverage_test_info}" "${coverage_info}" "${coverage_cleaned}" rm -f "${coverage_base_info}" "${coverage_test_info}" "${coverage_info}" "${coverage_cleaned}"
exit 0 exit 0