colvars icon indicating copy to clipboard operation
colvars copied to clipboard

CTest coverage reporting

Open jhenin opened this issue 1 year ago • 1 comments

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?

jhenin avatar Oct 24 '23 22:10 jhenin

#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.

giacomofiorin avatar Oct 24 '23 23:10 giacomofiorin