[CMake] problem: No test configuration file found!

David Cole david.cole at kitware.com
Tue Jun 19 16:26:10 EDT 2012


Do:

include(CTest)

instead of:

enable_testing()

Including CTest.cmake will automatically enable_testing(), but it also
configures the "test configuration file" it's complaining about...


HTH,
David


On Tue, Jun 19, 2012 at 5:19 PM, Robert Ramey <ramey at rrsd.com> wrote:

> I'm working through my first CMake/CTest project.
>
> My directory structure looks like
>
> safe_numerics/
>    CMakeLists.txt // #1
>    build/ // out of source build directory
>    include/
>    examples/
>    doc/
>    tests/
>        CMakeLists.txt // #2
>
>
> #1 looks like
> cmake_minimum_required(VERSION 2.6)
> project(safe_numerics)
> if(MSVC)
> add_definitions(
>    /Gy
>    /wd4244 # converting 'std::streamsize' in 'size_t'
>    /D_CRT_SECURE_NO_WARNINGS
>    /D_SCL_SECURE_NO_WARNINGS
> )
> endif(MSVC)
> set(CMAKE_VERBOSE_MAKEFILE on)
> set(CMAKE_BUILD_TYPE Debug)
> message("BOOST_ROOT = $ENV{BOOST_ROOT}" )
> include_directories($ENV{BOOST_ROOT})
> # walk the tests directory to run tests
> add_subdirectory(tests)
>
> #2 looks like
> ENABLE_TESTING()
> add_executable(test_subtract
>    test_subtract.cpp
>    test_subtract1.cpp
>    test_subtract2.cpp
>    test_subtract3.cpp
> )
> add_test(
>    test_subtract
>    test_subtract
> )
>
> Here is what I do
>
> cd build
> cmake ..
> $ ls -1
> ALL_BUILD.vcproj
> CMakeCache.txt
> CMakeFiles
> ZERO_CHECK.vcproj
> cmake_install.cmake
> safe_numerics.ncb
> safe_numerics.sln
> tests
>
>
> when I bring up safe_numerics.sln, I do see the test_subtract project, it
> builds and executes.
>
> BUT when I try to run CTest I get (among other stuff)
>
> $ctest
> *********************************
> No test configuration file found!
> *********************************
> ...
>
> Things I've tried.
>
> I eliminate the add_subdirectory and put all the sommand into file #1 .
> This did in fact build RUN_TESTS.vcproj.  But I can't see what I did wroing
> and what the "right way" to fix it is.
>
> I'm lost as to what's wrong with this.  Any help appreciated.
>
> Robert Ramey
>
>
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120619/852519a8/attachment.htm>


More information about the CMake mailing list