How to run ctest after building my project with cmake
问题 I want my tests to be launched each time my project is successfully built. And if some tests are broken I want my build to be broken too. By default I need to run tests manually by running ctest command. CTest can actually build project but I use IDE that invokes make to build sources. And make doesn't run tests. I add this command to my root CMakeLists.txt file but it doesn't work. add_custom_command(OUTPUT tests.txt POST_BUILD COMMAND ctest --output-on-failure) CMake doesn't return any