This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcov and autotools - filename issues
- From: Ian Lance Taylor <iant at google dot com>
- To: Adam Nielsen <a dot nielsen at shikadi dot net>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Fri, 09 Apr 2010 21:46:28 -0700
- Subject: Re: gcov and autotools - filename issues
- References: <hpotau$d33$1@dough.gmane.org>
Adam Nielsen <a.nielsen@shikadi.net> writes:
> Having just discovered gcov, I would like to use it with my autoconf-based
> project. Unfortunately all the examples seem to use only one source file,
> whereas I have many and they're in different subfolders.
>
> If I compile my code with the appropriate GCC options, the .gcno files get
> created but I'm not sure how to run gcov. For example I have some unit tests
> in a tests/ subdirectory:
>
> $ 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.
>
> If anyone can shed some light on how gcov should be run in this situation
> please let me know!
http://gcc.gnu.org/onlinedocs/gcc-4.4.3/gcc/Invoking-Gcov.html
Note the -o option.
Ian