Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncovered files not reported when using gcov 4.7 #33

Closed
markwil opened this issue Jan 30, 2014 · 4 comments
Milestone

Comments

@markwil
Copy link

@markwil markwil commented Jan 30, 2014

gcovr 3.1 does not include uncovered files in its report when used in conjunction with gcov 4.7.2 (on Ubuntu 12.10).

From examination, it seems the issue might stem from gcov 4.7.2 not producing .gcov files for source files that do not have corresponding .gcda files.

Separately invoking gcov on an uncovered source file produces output indicating that no .gcov file is generated. E.g.:
gcov src/Foo.cpp --branch-counts --branch-probabilities --preserve-paths --object-directory build/src
produces output containing:

File 'src/Foo.cpp'
No executable lines
No branches
No calls
Removing 'src#Foo.cpp.gcov'

Where Foo.cpp is not exercised by test code.

@schlauch

This comment has been minimized.

Copy link

@schlauch schlauch commented Feb 8, 2014

I can confirm this issue. I have tried this with:

  • gcov 4.6.0 => Works. gcov file is created.
  • gcov 4.8.0 => No gcov file created.
  • gcov 4.8.1 => No gcov file created.
  • gcov 4.8.2 => No gcov file created.

This is a serious problem to me becuase it is not so easy to workaround it. But maybe it is more related to gcc/gcov:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35568

Possible workaround ideas (not just for gcovr):

  • Parse gcno file => not so easy
  • Create empty gcda file => not so easy as it needs to have the right format
  • Force to include all header files into the test executable to make sure that the gcda files are created => not clean but might be ok
  • Create empty coverage information about those from gcovr => we completely miss the related lines of code
  • Make sure to have a test for every file of your production code ;)
@whart222 whart222 added this to the Gcovr 3.2 milestone Jul 4, 2014
@whart222

This comment has been minimized.

Copy link
Member

@whart222 whart222 commented Jul 4, 2014

It isn't clear that there is a gcovr issue to be resolved here. I don't anticipate creating empty gcda files within gcovr, which seems the only gcovr-centric solution to the inconsistent support of gcov for uncovered files.

I'm closing this, but please reopen if you have a specific request for gcovr functionality.

@whart222 whart222 closed this Jul 4, 2014
@itavero

This comment has been minimized.

Copy link

@itavero itavero commented Apr 20, 2015

Did anyone manage to work around this?
I'm still running into this issue.

gcc (Ubuntu 4.8.2-19ubuntu1) 4.8.2
gcov (Ubuntu 4.8.2-19ubuntu1) 4.8.2
gcovr 3.2
@schlauch

This comment has been minimized.

Copy link

@schlauch schlauch commented Apr 20, 2015

From the options listed above, I selected "Force to include all header files into the test executable":

  • Basically, we have a test executable for every module (simply a sub-directory).
  • We make sure that all headers of this module are included.
  • Thus, we are able to see all files in the report.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.