Target `test' empty

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Target `test' empty


Dear users,

I'm new to the build system. I am trying to create the target `test' to run all test suites. I'm using GoogleTest to make a test suite:

in test/CMakeLists.txt

file(GLOB test_files LIST_DIRECTORIES false *.cpp)
add_executable(test_driver ${test_files})
target_link_libraries(test_driver gtest_main)
add_test(NAME test_driver COMMAND test_driver)

in /CMakeLists.txt

this effectively creates the test suite so that can be invoked through test/test_driver. However I thought that the suite, at least if I set the param EXCLUDE_FROM_ALL in add_executable, would be built and executed as part of `make test', similarly to `make check' in AutoTools builds.

What is the correct way to integrate the test suite with CTest?




Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: