I have a project which I used to build with gcc toolchain version 10.2.0 (Rev6, Built by MSYS2 project) and analyze test coverage with gcov:
C:\test>gcov.exe "C:\test\Appl.c.gcda"
File 'C:/test/Appl.c'
Lines executed:27.54% of 207
Creating 'Appl.c.gcov'
C:\test>
However, after an upgrade to gcc version 12.2.0 (Rev5, Built by MSYS2 project), the line summary is duplicated in the output:
C:\test>gcov.exe "C:\test\Appl.c.gcda"
File 'C:/test/Appl.c'
Lines executed:27.54% of 207
Creating 'Appl.c.gcov'
Lines executed:27.54% of 207
C:\test>
I have a small shell script that uses this output to print out files with insufficient coverage which is now broken. Should I adapt it to the new output format, or is it a bug and I should just skip the buggy version until a fix comes out?
In the new version, the last line of
gcovoutput summarizes the line coverage of all files which have produced code in a given compilation unit. This happens for instance when a .c file includes header files containing inline functions: