Exclude Bison-generated files from coverage report, and use dark theme (#1742)

This commit is contained in:
Rangi
2025-07-12 10:11:23 -04:00
committed by GitHub
parent ddb2acb652
commit 611b0041c4
2 changed files with 12 additions and 10 deletions

View File

@@ -14,20 +14,18 @@ popd
gcov src/**/*.cpp
mkdir -p coverage
# Generate coverage report, excluding Bison-generated files
COVERAGE_INFO=coverage/coverage.info
lcov -c --no-external -d . -o "$COVERAGE_INFO"
lcov -r "$COVERAGE_INFO" src/asm/parser.{hpp,cpp} src/link/script.{hpp,cpp} -o "$COVERAGE_INFO"
genhtml --dark-mode -f -s -o coverage/ "$COVERAGE_INFO"
# Check whether running from coverage.yml workflow
if [ "$1" != "false" ]; then
# Generate coverage report
lcov -c --no-external -d . -o coverage/coverage.info --ignore-errors format,inconsistent,unsupported
genhtml -f -s -o coverage/ coverage/coverage.info --ignore-errors category,corrupt,inconsistent
# Open report in web browser
if [ "$(uname)" == "Darwin" ]; then
open coverage/index.html
else
xdg-open coverage/index.html
fi
else
# Generate coverage report
lcov -c --no-external -d . -o coverage/coverage.info
genhtml -f -s -o coverage/ coverage/coverage.info
fi