0

I have a number of source files in my project which are not tested at all. So they have gcno files but no gcda files. gcovr just skips them entirely, which artificially inflates my test coverage reporting. I've looked through the various options in gcov and gcovr, but I haven't seen any way of generating a 0% coverage metric for untested files. Is there any way to do this?

Nickolai
  • 1,579
  • 2
  • 12
  • 19

1 Answers1

1

Gcovr does try to report coverage for uncovered files, but:

  • your gcc/gcov version must be sufficiently up to date
  • the file must contain executable code, e.g. the compiler might remove inline functions that are never called

For details, see the gcovr FAQ: https://gcovr.com/en/master/faq.html#why-are-uncovered-files-not-reported

amon
  • 57,091
  • 2
  • 89
  • 149