Project Home
Project Home
Source Code
Source Code
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Code coverage with gcov: (3 Items)
   
Code coverage with gcov  
Hi

We have little problems using gcov (ntox86-gcov, GNU gcov version 1.5) to measure code coverage, because it results:
Abort (code dumped).

We use QNX:
$ uname -a
QNX nautilus 6.3.0 2005/08/09-15:05:10EDT x86pc x86

Compiling and linking:
$ make -B all
QCC -V 3.3.5,gcc_ntox86 -w9 -lang-c++ -Wc,-fprofile-arcs -Wc,-ftest-coverage -p -c -D__NTO__ -o x86/isabus.o   -I. -I/
usr/include   -Wall -O0 isabus.c
QCC -V 3.3.5,gcc_ntox86 -w9 -lang-c++ -Wc,-fprofile-arcs -Wc,-ftest-coverage -p -M -o  x86/isabus.x x86/isabus.o  -L .:.
/x86 -l cpp -lsocket

After that, there are new files:
-rw-rw-r--  1 ehe       users          1600 Mar 25 17:05 isabus.bb
-rw-rw-r--  1 ehe       users          3572 Mar 25 17:05 isabus.bbg

After running isabus.x, there are file:
-rw-rw-r--  1 ehe       users          1416 Mar 25 17:06 isabus.da

And then after trying gcov (all isabus-files are copied in the same directory):
$ ntox86-gcov isabus.c
Abort (core dumped)

What could be the problem ?

We dont want to use the IDE to measure code coverage.

---
Esa
Re: Code coverage with gcov  
Esa Heikkinen wrote:
> And then after trying gcov (all isabus-files are copied in the same directory):
> $ ntox86-gcov isabus.c
> Abort (core dumped)
> 
> What could be the problem ?

Use ntox86-gcov-3.3.5 instead. ntox86-gcov is the gcov for gcc 2.95.3 
and you need match the gcov version with the compiler version.

Regards,

Ryan Mansfield
Re: Code coverage with gcov  
Thanks you. It seems to work now :)

Another question yet: how can we measure overall code coverage of a process which have many source files ?

Regards
Esa