[llvm-dev] Coverage report. Clang-7.0.

Vedant Kumar via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 27 09:17:33 PDT 2018


Hi,

> On Sep 27, 2018, at 2:45 AM, Maksim Bakirov via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> ​Hi! 
> 
> I want to build coverage report of a program compiled with clang-7.0 in html.
> 
> My goal is to get summary report with information about coverage of source code files and links to them something like this https://llvm.org/reports/coverage/ <https://llvm.org/reports/coverage/> 
> 
> I have found several ways to do so, correct me please if I'm wrong:
> ​co​mpile 'clang --coverage' and then, after getting .gcno and .gcda files use lcov or gcovr based on gcov of version 4.2​
> BUT 
> I can't make a report with gcov of version 7.3.0 or 5.5.0. Is there any way to generate html from .gcov files?​
> 
> compile 'clang -fsanitize-coverage=...', get .sancov files, make .symcov files and display them via coverage-report-server.py
> BUT 
> I can't get .sancov files because clang-7.0 gives an error '.text.sancov.module_ctor' referenced in section '.init_array.[sancov.module_ctor.]' of obj.o: 
> defined in discarded section .text.sancov.module_ctor.[sancov.module_ctor]'. 
> Actually I just need a set of html-files and html-index instead of a server.
> 
> compile 'clang -fcoverage-mapping -fprofile-instr-generate', get .profraw file, make .profdata file, then use llvm-cov to get html file for every file of src
> BUT 
> It is possible to get html file for every source file, but it is impossible to get a summary report in html because of 
> error 'HTML output for summary reports is not yet supported.’
llvm-cov emits an index page which summarizes coverage across the program whenever it’s writing out a directory of coverage reports, see e.g http://lab.llvm.org:8080/coverage/coverage-reports/llvm/index.html <http://lab.llvm.org:8080/coverage/coverage-reports/llvm/index.html>.

vedant


> ​All of them look strange, so please, give me some advice or share your experience.
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <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/20180927/0fc9c5b7/attachment.html>


More information about the llvm-dev mailing list