Colvars/colvars

CTest coverage reporting

jhenin opened this issue · 1 comments

jhenin commented

I am trying to get CTest coverage reporting to work for our unit/functional tests, but no success so far.
I've had to add include(CTest) to the make CMakeLists.txt.

Then enabling the coverage option, building using cmake, and running
ctest -T test -T coverage
does give a report, but not a very informative one:

        Covered LOC:         0
        Not covered LOC:     0
        Total LOC:           0
        Percentage Coverage: 0.00%

I'm missing something here. Any idea?

#608 disabled coverage by default. Did you re-enable it via variable?

Other than that I have not tried previously using CTest for this, I only ran gcov manually, seeing that coverage was at reasonably high values in most files.

To be more useful than that, one would want to display which sections are covered. The LAMMPS repo seems to have a nice toolchain set up, but I have not tried using it yet.