Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake/CTest & gcovr: filename extensions?

After compiling with CMake with flags --coverage, and running my boost unit test programs, files with extension .cpp.gcda and .cpp.gcno are created. If I then run gcovr it claims it cannot find the .gcno files (error message ".gcno:cannot open graph file"). I could possibly move all output files but that would be really awkward/silly.

Related problems of other people could be solved by using CTest but as I am using Jenkins I'd like to stick to gcovr and use the cobertura xml output.

Ps. Maybe I should simply ask: how should I combine CMake with gcovr?

like image 359
ikku100 Avatar asked Nov 13 '22 01:11

ikku100


1 Answers

This is the solution we are using for the same setup inside jenkins: http://www.semipol.de/archives/320. You can simply grab the CMake macro from the linked RSC library for your own purposes.

Apart from that read something about a slightly changed format of the coverage files in recent gcc versions and it seems gcovr didn't keep up with that. But I cannot remember where I read this.

like image 81
languitar Avatar answered Jan 04 '23 02:01

languitar