You can use gcovr instead of running gcov .
gcovr does not rely on file name magic, but parses gcov coverage files.
Then it calls gcov with the appropriate parameters.
This works great with renaming Waf object files.
You can run gcovr from the Waf build subdirectory:
cd build gcovr --root=$(pwd) --keep lcov --capture --directory $(pwd) --base-directory $(pwd) --output-file coverage.info genhtml coverage.info --output-directory out
The --root removes the current directory prefix
The --keep option stores temporary gcov files used by lcov / genhtml .
You can also use the gcovr --xml option to output Cobertura -compatible xml.
It can then be used by various formatter (I use it with Jenkins Cobertura Plugin )
source share