Colvars / colvars

Collective variables library for molecular simulation and analysis programs
http://colvars.github.io/
GNU Lesser General Public License v3.0
195 stars 56 forks source link

CTest coverage reporting #613

Open jhenin opened 8 months ago

jhenin commented 8 months ago

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?

giacomofiorin commented 8 months ago

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.