This request is related to a previous thread titled ‘A new code coverage bot’ (http://lists.llvm.org/pipermail/llvm-dev/2016-September/105094.html).
“The purpose of the bot is to make high-quality coverage reports available to
llvm developers, and to provide additional testing for clang’s code coverage
I am wondering if there is a framework in place to get the code coverage information locally.
I have to get code coverage information of a llvm development branch which resides on my local machine. I also need to get the coverage numbers by running my own set of test suites.
Thanks and Best Regards
You can use “llvm/utils/prepare-code-coverage-artifact.py” to generate coverage reports. Here’s how:
- Build llvm with coverage reporting enabled.
- Collect profiles by running tests.
- Use prepare-code-coverage-artifact.py in “–only-merge” mode to merge your profiles together.
- Use prepare-code-coverage-artifact.py again to emit an html report, passing in “–use-existing-profdata path/to/merged/profile”.
If you need coverage reporting for multiple binaries, pass in the paths to the binaries you’re interested in, along with the “–unified-report” option.
If you only want coverage for a particular set of files or directories, you can specify this with the “–restrict” option.