0

gcovr, despite providing complete arguments list, generates empty reports?

Command: gcovr -r /home/<username>/Projects/ --object-directory <Path to Build Directory>

Result:

------------------------------------------------------------------------------
                           GCC Code Coverage Report
Directory: /home/<username>/Projects/
------------------------------------------------------------------------------
File                                       Lines    Exec  Cover   Missing
------------------------------------------------------------------------------
------------------------------------------------------------------------------
TOTAL                                          0       0    --%
------------------------------------------------------------------------------
amon
  • 57,091
  • 2
  • 89
  • 149
  • 1
    Could you clarify how your project directory is laid out? Where are the source files, where are build artifacts? In particular, have you compiled with --coverage so that there are gcno files in the build directory? Have you tried running gcovr without extra options? At least the object-directory option has subtle effects that are typically not helpful. – amon Sep 22 '21 at 06:49

1 Answers1

0

You can check if you have filter option pointing to your source directory.

By default filter option points at the same directory as root, and root contains gcov and gcda files. Root directory may not contain sources when building in different directory.

mcz
  • 1
  • 1