Computer Assisted Medical Intervention Tool Kit  version 5.2
 
Loading...
Searching...
No Matches
CamiTKDisableTests.h
Go to the documentation of this file.
1
42#
45 set(options "")
46 set(oneValueArgs REASON)
47 set(multiValueArgs TESTS)
48 cmake_parse_arguments(CAMITK_DISABLE_TESTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
49
50 if (NOT BUILD_TESTING)
51 message(STATUS "Build testing is off, no test to disable for ${CAMITK_DISABLE_TESTS_TESTS}")
52 return()
53 endif()
54
55 foreach(TEST_NAME ${CAMITK_DISABLE_TESTS_TESTS})
56 # CMake < 3.9 did not have the DISABLED test property. Use WILL_FAIL instead
57 if(${CMAKE_VERSION} VERSION_LESS "3.9")
58 set_tests_properties(${TEST_NAME} PROPERTIES WILL_FAIL true)
59 else()
60 set_tests_properties(${TEST_NAME} PROPERTIES DISABLED true)
61 endif()
62 endforeach()
63
64 # message to the developper
65 string(REPLACE "" " " CAMITK_DISABLE_TESTS_TESTS_STRING "${CAMITK_DISABLE_TESTS_TESTS}")
66 set(DISABLE_MESSAGE "Unconditionally disabling tests:\n Disabled tests: ${CAMITK_DISABLE_TESTS_TESTS_STRING}\n")
67 if(${CMAKE_VERSION} VERSION_LESS "3.9")
68 set(DISABLE_MESSAGE ${DISABLE_MESSAGE} " (using WILL_FAIL property because CMake < 3.9)\n")
69 endif()
70 set(DISABLE_MESSAGE ${DISABLE_MESSAGE} " Reason: ${CAMITK_DISABLE_TESTS_REASON}")
71 message(STATUS ${DISABLE_MESSAGE})
72
73end(){)
cmake modules macros camitk test endif() add_custom_target(camitk-ce-iwyu COMMAND $
Definition CamiTKIncludeWhatYouUse.h:37
iwyu out CACHE PATH Output filename for include what you use set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_EXECUTABLE}) if(NOT EXISTS $
Definition CamiTKIncludeWhatYouUse.h:22
camitk_disable_tests()
camitk_disable_tests is a macro to unconditionally disable one or more tests.
Definition CamiTKDisableTests.h:44