This is my Makefile
gcc --coverage -c ../file.c -o file.o
gcc --coverage ut1.c -o ut1 file.o -lcmocka
gcc --coverage ut2.c ../file.c -o ut2 -lcmocka
./ut2
./ut1
gcov -bc file.gcda file.gcno
Output :-
file.gcda:stamp mismatch with notes file
file.gcda:stamp mismatch with notes file
File '../file.c'
No executable lines
No branches
No calls
Removing 'file.c.gcov'
No executable lines
My understanding is that when we compile file.c then file.o and file.gcno get created when ut2 is compiled then gcno is overwritten , so its should be the case of partial coverage , but i am getting stamp mismatch with note file .
can anyone explain what is note file and what does it actually mean by stamp mismatch .
Also if i change the order ut execution i am getting coverage !
gcc --coverage -c ../file.c -o file.o
gcc --coverage ut1.c -o ut1 file.o -lcmocka
gcc --coverage ut2.c ../file.c -o ut2 -lcmocka
./ut1
./ut2
gcov -bc file.gcda file.gcno