Skip to content

Commit

Permalink
vagrant(coverage): drop the gperf files when capturing coverage
Browse files Browse the repository at this point in the history
Instead of dropping them from the merged report, as recent lcov started
complaining about unknown lines in gperf files:

Capturing coverage data from /systemd-meson-build
geninfo cmd: '/usr/bin/geninfo /systemd-meson-build --output-filename /tmp/tmp.GTvgfBWpZt/build_dir_initial.coverage-info --initial'
Found gcov version: 13.2.1
Using intermediate gcov format
...
geninfo: ERROR: (range) unknown line '114' in /systemd-meson-build/src/basic/af-from-name.gperf: there are only 56 lines in the file.
  Use 'geninfo --filter range' to remove out-of-range lines.
        (use "geninfo --ignore-errors range ..." to bypass this error)

Complements systemd/systemd@9fe1805.
  • Loading branch information
mrc0mmand committed May 1, 2024
1 parent b4c4000 commit 1d14839
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ lcov_collect() {
local build_dir="${2:?}"
shift 2

if ! lcov "$@" --directory "$build_dir" --capture --output-file "$output_file"; then
if ! lcov "$@" --directory "$build_dir" --capture --exclude "*.gperf" --output-file "$output_file"; then
_err "Failed to capture coverage data from '$build_dir'"
return 1
fi
Expand Down
6 changes: 1 addition & 5 deletions vagrant/test_scripts/test-arch-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,7 @@ exectask "lcov_collect-build_dir-final" "lcov_collect $COVERAGE_DIR/build_dir.co
exectask "coredumpctl_collect" "coredumpctl_collect"

# Merge all "coverage-info" files from the integration tests into one file
exectask "lcov-merge-coverage" "lcov_merge all-integration-tests.coverage-info $COVERAGE_DIR"
# Drop *.gperf files from the lcov files
# See: https://github.com/eddyxu/cpp-coveralls/issues/126#issuecomment-946716583
# for reasoning
exectask "lcov-drop-gperf" "lcov -r all-integration-tests.coverage-info '*.gperf' -o everything.coverage-info"
exectask "lcov-merge-coverage" "lcov_merge everything.coverage-info $COVERAGE_DIR"
exectask "lcov-dump-coverage-report" "lcov --list everything.coverage-info"
# Coveralls repo token is set via the .coveralls.yml configuration file generated
# in vagrant/vagrant-ci-wrapper.sh
Expand Down

0 comments on commit 1d14839

Please sign in to comment.