gcov and autotools - filename issues
Sat Apr 10 05:59:00 GMT 2010
>> $ gcov tests/tests.cpp
>> tests.gcno:cannot open graph file
>> Which is correct, because the autotools name it as tests/tests-tests.gcno.
>> Likewise all the other .gcno files are in subdirectories with the directory
>> name prepended onto the filename.
> Note the -o option.
I had a look at the -o option, but I'm not sure how to use it. For example,
this is the only way I can get gcov to run:
$ gcov tests/tests.cpp -o tests/tests-tests
But then it produces tests.cpp.gcov that contains a bunch of lines like this:
I'm also a bit confused about why I should supply a .cpp filename instead of a
program name. How does it know which program to run? If I run "gcov
string.cpp" how does gcov know that it needs to run some other program with
certain parameters to actually execute the code in that file?
More information about the Gcc-help