2016-12-06 13:46:21 +00:00
|
|
|
# Adding test output on failure
|
|
|
|
enable_testing ()
|
2017-03-22 16:59:02 +00:00
|
|
|
|
2016-12-06 13:46:21 +00:00
|
|
|
if (CMAKE_CONFIGURATION_TYPES)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND}
|
|
|
|
--force-new-ctest-process --output-on-failure --build-config "$<CONFIGURATION>"
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
2016-12-06 13:46:21 +00:00
|
|
|
else ()
|
2017-04-01 07:20:54 +00:00
|
|
|
add_custom_target (check COMMAND ${CMAKE_CTEST_COMMAND}
|
|
|
|
--force-new-ctest-process --output-on-failure
|
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
|
2016-12-06 13:46:21 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
macro (add_check target)
|
2017-04-01 07:20:54 +00:00
|
|
|
add_test (NAME test_${target} COMMAND ${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_dependencies (check ${target})
|
2016-12-06 13:46:21 +00:00
|
|
|
endmacro (add_check)
|