codecov / engineering-team

This is a general repo to use with GH Projects
1 stars 1 forks source link

How to get coverage from clang (C++) #2144

Open drazisil-codecov opened 1 month ago

drazisil-codecov commented 1 month ago

I got Node.js' C++ coverage working again last night. For future reference, if someone is trying to use gcovr to create a coverage report for codecov, and they switch their compiler to clang from gcc at some point, you need to do this:

--gcov-executable="llvm-cov-18 gcov"

https://app.codecov.io/github/nodejs/node/commit/0821fe53a6b2a05e893dc8426eef284a4fde6dc1/tree/src

Slack Message

bcoe commented 1 month ago

Documentation from gcovr: https://gcovr.com/en/5.1/guide/compiling.html#choosing-the-right-gcov-executable

The annoying thing is, in my case, I needed to figure out the llvm-cov version, so that I could call llvm-cov-18. This was achieved by running ls -l in /usr/bin and looking for bins matching llvm-cov.