[CMake] CTest coverage test and external subdirs

Johannes Stallkamp johannes.stallkamp at rub.de
Wed Nov 11 05:53:31 EST 2009


Hello,

I am still trying to get ctest working on our directory structure.
Thanks to the bugfix in 2.8, running the test itself works fine.
However, there seems to be an issue with code coverage testing.

Assuming the following directory structure:

projects/
    libFoo/
       cmake
          CMakeLists.txt
          CTestConfig.cmake
       include
          Foo.h
       src
          Foo.cpp
          FooTest.cpp
    appBar/
       cmake
          CMakeLists.txt
          CTestConfig.cmake
       include
          Bar.h
       src
          Bar.cpp


Bar is an application that relies on libFoo. After building appBar,
"make test" runs flawlessly. However, running
ctest -T Coverage
reports Covered/Total LOC of zero. I think this is related to the
fact, that ctest tries to exclude system libraries and other external
files from the coverage check by ignoring external directories.
However, since CTest now allows absolute paths in its SUBDIRS command,
I think it should consider the files in those directories as well (or
to be more precise, the files in/below the "SourceDirectory" in that
directory's/component's DartConfiguration.tcl).

Or am I missing something?

Kind regards
Johannes




More information about the CMake mailing list