Bazel C++ Code Coverage with a Custom Coverage Tool (Squish Coco)

I couldn't find anything in the official documentation on this. We're using Squish Coco for code coverage and can't use lcov for certification reasons, which is the only tool supported by bazel coverage.

We're trying to get this running in Bazel. For this we added a toolchain for the Squish Coco Wrappers. Which seems to be the standard way to add different compilers, shown here .

However linking fails with undefined reference to '__cs_tb...', because Bazel deletes all the instrumentation files (*.o.csmes and *.csmes). The same toolchain for clang or gcc works, as presented in the tutorial.

Is there any way to tell Bazel to keep any files with the ending *.csmes? I'd like to declare that cc_library produces .o files and maybe ( not always, depends on instrumentation options) *.o.csmes. cc_binary amd cc_test may create no extension files and .csmes files.

2
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article