Search code examples
code-coveragebazellcov

C++ code coverage with Bazel 6 and lcov fails


I recently switched from Bazel 5 to Bazel 6. The following commands generated in the past a working code coverage report for me:

git clone https://github.com/Vertexwahn/FlatlandRT.git
cd FlatlandRT/devertexwahn
bazel coverage --config=gcc11 --instrumentation_filter="[:]" --instrument_test_targets=true --combined_report=lcov -- //...
output_path=$(bazel info output_path)
genhtml "$output_path"/_coverage/_coverage_report.dat -o coverage_report

In Bazel 6 the following error is reported:

genhtml: ERROR: cannot read /home/vertexwahn/dev/FlatlandRT/devertexwahn/external/Imath/src/Imath/ImathMatrixAlgo.h

Any ideas/hints on how to get a proper code coverage report with Bazel 6?


Solution

  • When I remove --instrumentation_filter="[:]" everything seems to work with Bazel 6.0. With Bazel 5.4.0 I do not need remove this flag.