You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm working on a company codebase and really want to get code coverage working. So far I've failed do so and would like to ask for help. What I am seeing is that I'm unable to generate code coverage reports for a code base I am working in. I see that .dat files are generated but they're usually empty for some reason.
Which category does this issue belong to?
C++/Objective-C Rules, CLI
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
You may enjoy some success by doing the following:
Add tool_path(name = "gcov", path = "/usr/bin/llvm-cov-13") to your set of tool paths in your tool chain (as well as the original llvm-cov definition).
Use a version of Bazel that includes 7f628d7 (I think 6.3.0 is the first)
Description of the bug:
Hello, I'm working on a company codebase and really want to get code coverage working. So far I've failed do so and would like to ask for help. What I am seeing is that I'm unable to generate code coverage reports for a code base I am working in. I see that .dat files are generated but they're usually empty for some reason.
Which category does this issue belong to?
C++/Objective-C Rules, CLI
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
I've created an extremely small version of the project with a simplistic cpp file and test to demonstrate the issue, you can find that code in: https://github.com/tsr-boxbot/bazel_code_coverage_problems
A key thing to note here is we are using clang-13 via a toolchain spec.
Here's what I see:
Where although everything completes okay but I still get:
WARNING: There was no coverage found.
I've also tried crazy things like:
Which operating system are you running Bazel on?
Ubuntu 22.04
What is the output of
bazel info release
?release 5.4.0
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.
Unsure
Have you found anything relevant by searching the web?
I've found tons of stuff that seems related but so far they haven't solved my problem, I will link some of the resources here
#16208
#7719
#11059
#8284
bazelbuild/rules_apple#338
https://github.com/bazelbuild/rules_scala/blob/master/docs/coverage.md
#11962
https://stackoverflow.com/questions/60751912/output-coverage-coverage-report-dat-was-not-created-when-using-bazel-coverag
Any other information, logs, or outputs that you want to share?
I've looked all over for a functional guide for code coverage but I cannot seem to tell what the correct way to use coverage is.
The text was updated successfully, but these errors were encountered: