This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help on -fprofile-arcs -ftest-coverage


Hey,
As a part of build, i'm using "-fprofile-arcs -ftest-coverage" flags while
compiling and "-fprofile-arcs -ftest-coverage -lgcov" while linking. Once i
get the rpm files, i m installing it and running the application.
Just FYI, the option --coverage is a short-cut for "-fprofile-arcs -ftest-coverage" and furthermore you don't need to explicitly add the -lgcov option.
As I start the application in console, it displays that the app is started
and returns to console but the process continues to run in background.
Are you doing fork(2)s in your code?
The problem is that it is generating gcda files only between starting the
app and returning to console. Later if I run testcases against the app which
is running in the background, it is not generating/updating the gcda files,
so I m unable to get code coverage statistics for the testcases :(

This sounds like that the application somehow finishes once you return to the console. How are you exactly realizing the background thing?


Which version of gcc/gcov are you using?

Is your code complex or could you possible provide it? If possible, please don't send it to the mailing list directly, but use some kind of file hosting (e.g. http://uploaded.to).


Best regards, Andi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]