mirror of
https://github.com/unittest-cpp/unittest-cpp
synced 2026-09-29 04:35:29 +03:00
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.
This commit is contained in:
parent
bd11339b2d
commit
2ee151af76
1 changed files with 4 additions and 8 deletions
|
|
@ -40,14 +40,10 @@ endif()
|
|||
|
||||
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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue