Change unit tests to run as post-build step. This is how it used to be in most of the old project files. The CMake conversion required the tests to be run manually after the build, either by running the binary directly or by calling CTest. This commit removes the 'dependency' on CTest and restores the old build process.
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b2482d..f94881b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -40,14 +40,10 @@ target_link_libraries(TestUnitTest++ UnitTest++) -# turn on testing -enable_testing() -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V) - -# add the test runner as a test -add_test(NAME TestUnitTest++ COMMAND TestUnitTest++ ${CONFIG_PATH} ${CONFIG_TASKS_PATH} ${SOUND_LOG_PATH}) -add_dependencies(check TestUnitTest++) - +# run unit tests as post build step +add_custom_command(TARGET TestUnitTest++ + POST_BUILD COMMAND TestUnitTest++ + COMMENT "Running unit tests") # add install targets # need a custom install path?