11

I wanted to exclude external lib's code from my coverage report, so I've added --no-external flag to lcov command. Unfortunately, after adding this flag genhtml is unable to generate coverage reports.

Command used:

lcov --directory . -c -o coverage.info -t "coverage_result" --no-external

Result:

genhtml: ERROR: no valid records found in tracefile coverage.info

Also, the coverage.info file looks corrupted:

TN:coverage_result
TN:coverage_result
TN:coverage_result
TN:coverage_result

Did anyone have similar problem?

irky
  • 141
  • 2
  • 8
  • You can try specify `-b` option and pass a path to your sources. – Gluttton Nov 09 '17 at 17:04
  • 6
    After some fight with several options I've decided to use another solution with `--remove` option. `lcov --directory . -c -o coverage.info -t "coverage_result" -b .` `lcov --remove coverage.info "/usr/include/*" "/usr/local/*" "*asio/*" "*googletest/*" -o filtered_coverage.info` – irky Nov 10 '17 at 13:03

0 Answers0