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

Maksim Bakirov via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 27 02:45:46 PDT 2018


?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/

I have found several ways to do so, correct me please if I'm wrong:

  1.  ?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??

  2.  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.

  3.  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.'

?All of them look strange, so please, give me some advice or share your experience.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180927/23612cf3/attachment.html>


More information about the llvm-dev mailing list