[ITK-dev] Code coverage: using gcov in an itk external module

Pablo Hernández pablo.hernandez.cerdan at outlook.com
Thu May 25 19:56:39 EDT 2017


Hi Matt, thanks!
yeah, it works for single modules (external or core) modifying the flags in `test/CMakeLists.txt` for the specific ${itk_module}TestDriver.

Not sure if CodeCov is overwhelmed by running the tests, generating the `.gcda` files , or by the later stage of generating the lcov report with those files.

If the first case, it is hard to selectively modify flags of child targets from parent CMakeLists.txt, right? So other option would be to modify the CreateTestDriver macro to add coverage flags to some modules, depending on additional cmake variables, but I guess is not too elegant?

If the later, we can modify the lcov script to generate reports only in selected Modules. And maybe have a CodeCov report per module? In my case, the .gcda files are generated in subfolders, so it is easy to only generate the reports for that module.

export GCOV_PREFIX="$HOME/Software/ITK/build/Modules/Remote/IsotropicWavelets/test/CMakeFiles/IsotropicWaveletsTestDriver.dir

lcov --directory $GCOV_PREFIX --capture --output-file $GCOV_PREFIX/app.info<http://app.info>

It would be great to automatize this indeed!

Cheers,
Pablo


On Fri, May 26, 2017 at 2:59 AM, matt.mccormick at kitware.com<mailto:matt.mccormick at kitware.com> <matt.mccormick at kitware.com<mailto:matt.mccormick at kitware.com>> wrote:


On Thu, May 25, 2017 at 8:57 AM, Francois Budin <francois.budin at kitware.com<mailto:francois.budin at kitware.com>> wrote:
That's great! Thanks for sharing!

+1!

90%+ is not too shabby at all :-).


Jon and I have investigated CodeCov [1] for ITK [2], but ITK's test suite seems to overwhelm their system.  However, tests for a single external module could work?

Here are the scripts that we used:

  https://gist.github.com/thewtex/1f410c90e8b9e9826989c0e04e97738b
  https://gist.github.com/thewtex/e3f59fdfba4f30ad2580dbb4db7a22e9
  https://gist.github.com/thewtex/cc7ade395c7aa309f38b137b8934e075

These work together with the itk_common.cmake CTest script in ITK's Git repository dashboard branch.

Cheers,
Matt

[1] https://codecov.io/

[2] https://codecov.io/gh/InsightSoftwareConsortium/ITK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-developers/attachments/20170525/024b0d8c/attachment.html>


More information about the Insight-developers mailing list