-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Description
Coverage with gcov:
- GCOV_PREFIX_STRIP is set incorrectly
With a value of 3, the paths end up like this:
bazel-testlogs/cpp/foo_test/_coverage/_bazel_ulfjack/312a82d9f5d7857ee9e5303755329142/sandbox/darwin-sandbox/4/execroot/main/bazel-out/darwin-fastbuild/bin/cpp/_objs/foo_test/main.gcda
The collect-coverage.sh script doesn't allow overriding GCOV_PREFIX_STRIP. I have a patch to not set it if it's already set in the test env. On this machine, I have to set it to 10.
-
The latest gcov does not support the -i flag
The -i flag is hard-coded in collect_cc_coverage.sh with no override possible. -
The gcov log uses lower-case "creating"
The collect_cc_coverage.sh only checks for upper-case "Creating". -
The generated output is not in intermediate gcov format as expected by lcov_merger.
Coverage with llvm-profdata (--features=llvm_coverage_map_format):
-
COVERAGE_GCOV_PATH is set to gcov
This is obviously wrong. It needs to be set to llvm-profdata. However, llvm-profdata is not on the path, and there does not seem to be a way to override the location of gcov. I tried setting GCOV=/path/to/llvm-profdata before calling Bazel, but that had no effect. -
The lcov_merger simply copies the .profdata file to coverage.dat
At least this allows users to post-process manually, but it's still unfortunate.