David Doria
David Doria

Reputation: 10273

Cannot locate CTest configuration

I am trying to perform a coverage analysis of a project in which I use CMake+CTest. I have created a simple TestingScript.cmake that looks like:

set(CTEST_SOURCE_DIRECTORY .)
set(CTEST_BINARY_DIRECTORY build_coverage)

ctest_start(TestCoverage)

ctest_coverage(BUILD ${CTEST_BINARY_DIR})

and am trying to run it with:

doriad@david-desktop:~/build/Examples/Coverage$ ctest -S ~/src/Examples/Coverage/TestingScript.cmake 
Cannot locate CTest configuration: in BuildDirectory: /home/doriad/build/Examples/Coverage/build_coverage/CTestConfig.cmake
Cannot locate CTest configuration: in SourceDirectory: /home/doriad/build/Examples/Coverage/CTestConfig.cmake
 Cannot find any coverage files. Ignoring Coverage request.

What do I need to do to produce this CTestConfig.cmake file that it is looking for?

Upvotes: 3

Views: 1988

Answers (1)

Melebius
Melebius

Reputation: 6695

The file CTestConfig.cmake is usually generated by CDash. While logged in to CDash, select Settings > Project > Miscellaneous > Download CTestConfig. The file holds the configuration to submit the results to a dashboard server.

The default settings of the module are to submit the dashboard to Kitware's Public Dashboard, where you can register your project for free.

In order to submit to some other server, CTestConfig.cmake in the top level directory of your source, and set your own dashboard preferences. If you are using a CDash server, you can download a preconfigured file from the respective project page on that server (Settings / Project, tab Miscellaneous).

Source: https://gitlab.kitware.com/cmake/community/wikis/doc/ctest/Testing-With-CTest

Another problem is that you have no coverage files to submit since you skipped the build and test steps in your testing script.

Upvotes: 3

Related Questions