Results 1 to 2 of 2
Hi, I am using gcov to get code coverage for my program written in C++, I am able to do it without any problem when i don't have a directory ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-14-2010 #1
- Join Date
- Jun 2009
I am using gcov to get code coverage for my program written in C++, I am able to do it without any problem when i don't have a directory structure, for my program I have a directory structure as below
./src/ -- containing all my source files ./obj/ -- containing all my object files ./header/ -- containing all my header files ../../lib/ -- containing a static library, which will be used by my program there is a makefile in the current directory which creates my executable
do i need to compile the static library also with the options of gcov i.e. -fprofile-arcs -ftest-coverage, because it is the library that i need to check for coverage.
- 09-14-2010 #2
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
See the --opject-directory option for gcov. You can tell it where your object and source files are with that. There is also the --preserve-paths argument so it will use the complete path information when creating the profiles. From the gcov man page:
--preserve-paths Preserve complete path information in the names of generated .gcov files. Without this option, just the filename component is used. With this option, all directories are used, with / characters translated to # characters, . directory components removed and .. components renamed to ^. This is useful if sourcefiles are in several different directories. It also affects the -l option.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!