Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Request: Report no coverage (hits=0 for all lines) for files that were not executed #290
This would be a good feature to add this, because today we need to use lcov tool to do so.
Thank you for this suggestion, but gcovr will already report zero coverage for uncovered files! It is sufficient if the source file is referenced in a .gcno file that the compiler generates, and it is not necessary that a .gcda file was created during test execution.
However, gcov/gcovr cannot know about dead code that the compiler eliminated. If a file only consists of dead code (like a C++ template that was never instantiated, or a static function that was never called), it will not be considered as uncovered – it simply does not exist as far as gcovr is concerned. There is no good workaround.
I'm closing this issue because AFAIK this feature already exists. If you have a problem with un-executed files, please add the relevant details so that I can reopen. E.g. the output of running gcovr in