Coverage report. Clang-7.0.

​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 –covera****ge’ 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.

Hi,

​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 –covera****ge’ 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.’

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.

vedant