user2361687
user2361687

Reputation: 1

is Gcov an application based coverage or system based coverage

Is Gcov an application based coverage or system based coverage

.gcda files doesn't get generated for all the files. the gcda files are created only for few source files. gcno files are created for all the source files complied with the gcov complilation flags. My project also has QT based modules for which i don't get .gcda files.

Question here is : is gcov application based coverage tool or system based coverage tool ??

I have added the -fprofile-arcs -ftest-coverage in CFLAGS LDFLAGS and CXXFLAGS.

Upvotes: 0

Views: 440

Answers (2)

Peter Teoh
Peter Teoh

Reputation: 6753

To answer your question, you need to understand how gcov work. Just read this (essentially there are four steps):

How do the code coverage options of GCC work?

To summarize even further, basically gcc will compile and "instrument" the functions so every execution of the function will increase or update some counters. In this way, you can get functions statistics when the program end.

To answer your question: you have just compile some C program with gcov, but did not compile Qt with gcov, but only link to it as a Qt library, so definitely there will be no gcov related statistics.

So it is not application nor system based generated statistics, but is depending on which C files which have gcov enabled during compilation.

Upvotes: 0

vinay hunachyal
vinay hunachyal

Reputation: 3901

Compiling your code with -fprofile-arcs -ftest-coverage will generate .gcno files.

After executing your binary .gcda will be generated.So in your case some of the binary will not be executed . If .gcno files are w.r.t files then surely it will generate .gcda after executing your binary.

Upvotes: 0

Related Questions