5

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?

ikku100
  • 809
  • 1
  • 7
  • 16
  • I had answered another likely question: a ugly method https://stackoverflow.com/a/46232989/4204540 – yee Sep 15 '17 at 06:41
  • Right, nice to know I wasn't the only one, and that we agree on the ugliness of that workaround! – ikku100 Sep 27 '17 at 12:27

1 Answers1

1

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.

languitar
  • 6,554
  • 2
  • 37
  • 62