Well it seems you have already figured the root cause of the problem and looking for the work around.
I have successfully configured few projects for code coverage with gcov.
I would like to clear few things for you:
- we get
.gcno
files for each of the source files instrumented with --coverage
option during compilation.
- And at the time of execution we get
.gcda
files for each one of gcno files.
.gcno
files are just flow charts structure of the relevant source code files.
.gcda
files are the actual coverage data generated at the time of execution.
So, in your situation .gcda
(used to be .da
in earlier versions) are having conflicts when two or more execution tries to write the same .gcda
file simultaneously.
Simplest work around would be running the tests serially. (At least that's what I did )
you don't need to worry about losing coverage data as .gcda
gets appended with every execution and not overwritten. Keep this in mind that you don't have to do re-compilation because it would change the .gcno
files and the .gcda
files from before will become useless.