On one server with GCC 4.4.7/GCOV 4.4.7, I'm able to run the tests successfully. However on a different server with GCC 4.8.5/GCOV 4.8.5, running the tests results in this error:
profiling:/path/to/foo.gcda:Version mismatch - expected 700e got 408R
Here are the output of the versions:
$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
$ gcov --version
gcov (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36)
After searching for this error, it seems that it is often caused by mismatched versions between gcc and gcov, however mine have the same versions.
We recently upgraded gcc on this server from 4.4.7 to 4.8.5. This issue seems to be caused by the upgrade.
I should mention that I'm testing a Python C Extension, which I think is a bit different from testing a normal C application.
I do the following:
export CFLAGS="--coverage"
python setup.py build_ext --inplace
python tests.py
On both servers, that second command creates the .gcno files appropriately.
On the server with 4.4.7, the third command will successfuly create the .gcda files. But the server with 4.8.5 prints that error message