f0rmiga / gcc-toolchain

A fully-hermetic Bazel GCC toolchain for Linux.
Apache License 2.0
103 stars 24 forks source link

add/fix support for bazel coverage #151

Closed tobithiel closed 12 months ago

tobithiel commented 1 year ago

Type of change

bazel coverage <...> with C/C++ targets was not working because the gcov binary was not included in the runfiles. This was showing as a silent failure as an empty coverage report. The test log contains:

GCov does not exist at the given path: 'external/gcc_toolchain_x86_64/bin/gcov'

Test plan

$ bazel coverage --instrument_test_targets --combined_report=lcov //examples/hello_world_cpp:hello_world_cpp_test
$ genhtml --output genhtml "$(bazel info output_path)//_coverage/_coverage_report.dat"
CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

f0rmiga commented 1 year ago

Thanks for this! I think it makes sense to change one of the CI targets to call bazel coverage instead of bazel test. I can do it after we merge this, no problem.

tobithiel commented 1 year ago

Thanks for this! I think it makes sense to change one of the CI targets to call bazel coverage instead of bazel test. I can do it after we merge this, no problem.

No problem, thanks for the project. I gave it a try, but I can't really test it since I'm not sure how to actually trigger CI (or don't have permissions to). So feel free to revert and do it differently.

f0rmiga commented 1 year ago

I'll get to it today.

tobithiel commented 12 months ago

@f0rmiga Could you take another look please when you have some time? I merged in main to resolve the conflicts and use the new CI stuff.

f0rmiga commented 12 months ago

Awesome, thanks!