[llvm-dev] Request for local llvm source code coverage for developers

Vedant Kumar via llvm-dev llvm-dev at lists.llvm.org
Wed May 31 11:29:00 PDT 2017


Hi Arvind,

You can use "llvm/utils/prepare-code-coverage-artifact.py" to generate coverage reports. Here's how:

1) Build llvm with coverage reporting enabled.
See: https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#collecting-coverage-reports-for-the-llvm-project <https://clang.llvm.org/docs/SourceBasedCodeCoverage.html#collecting-coverage-reports-for-the-llvm-project>
2) Collect profiles by running tests.
3) Use prepare-code-coverage-artifact.py in "--only-merge" mode to merge your profiles together.
4) 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.

best,
vedant

> On May 31, 2017, at 9:23 AM, Arvind Sudarsanam via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> 
> Hi,
> 
>  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 <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
> 
> implementation”
> 
> 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
> 
> Arvind
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170531/1fc8585d/attachment.html>


More information about the llvm-dev mailing list