CMake + Jenkins to cover code with an unverified file

I am looking for a solution to get code coverage statistics among all C source files compiled in one cmake project and published under Jenkins.

I use CMake 2.8.9, gcovr 3.1, Jenkins 1.564 and have tried many different versions of gcc / gcov (4.7.2 and> = 4.8.0).

As far as I know, I have two different solutions:

On the one hand, using gcovr leads to a cobertura xml file that can be used to publish to jenkins, but I could not take into account the uncovered file in the coverage statistics. This is because an unverified file is not taken into account by gcov, although .gcno exists (but not .gcda), in fact, a .gcov file is not generated only for .gcno files, instead, gcov prints the message "Deleting ... " I suspect gcov has changed its behavior so that gcovr no longer works with an unchecked file (but I never saw it), however I cannot find the correct version of gcc / gcov and I tried a lot (4.7.2 and> = 4.8 .0).

Cmake, on the other hand, calculates the correct statistics based on an unverified file, but cannot generate a cobertura report for publication in jenkins ...

I need a workaround in gcovr or cmake coverage for cobertura xslt or any other option that could answer this problem.

Thanks so much for your suggestions.

Pierre

+4
source share

Source: https://habr.com/ru/post/1544339/


All Articles