Suppose a source file called xmpl.cpp
(the one described by Fröhlich, for instance). When compiling this file with gcc
with the flags -fprofile-arcs
and -ftest-coverage
, it generates in the usual binary executable file xmpl
and a gcov data file xmpl.gcno
. Then, when the program is executed another gcov data file xmpl.gcna
is generated, this one containing information gathered during the execution.
However, when I use an expect script to run that same program no xmpl.gcna
is generated. More specifically, the problem is with the spawn
command, with exec
everything is fine (but then, why use expect, right?).
I'm interested in solving this issue because we have lots of expect scripts performing some tests in our project and currently no coverage information is being generated for those tests. The code for the example described above can be fetched here.