1 # Create TestDriver and default tests for MITK
3 # CMake variables used:
5 # ${${KITNAME}_GUI_TESTS} : filenames of all tests that run without a parameter
6 # ${${KITNAME}_IMAGE_GUI_TESTS : filenames of all tests that run with an image filename as parameter
7 # ${${KITNAME}_TESTS} : filenames of all tests that run without a parameter
8 # ${${KITNAME}_IMAGE_TESTS : filenames of all tests that run with an image filename as parameter
9 # ${${KITNAME}_TESTIMAGES} : list of images passed as parameter for the IMAGE_TESTS
10 # ${${KITNAME}_CUSTOM_TESTS} : filenames of custom tests which are just added to the TestDriver. Execution
11 # of these has to be specified manually with the ADD_TEST CMake command.
14 # add tests which need a GUI if it is not disabled
15 if(NOT MITK_GUI_TESTS_DISABLED)
16 set( ${KITNAME}_TESTS ${${KITNAME}_TESTS} ${${KITNAME}_GUI_TESTS} )
17 set( ${KITNAME}_IMAGE_TESTS ${${KITNAME}_IMAGE_TESTS} ${${KITNAME}_IMAGE_GUI_TESTS} )
21 # Create the TestDriver binary which contains all the tests.
23 create_test_sourcelist(MITKTEST_SOURCE ${KITNAME}TestDriver.cpp
24 ${${KITNAME}_TESTS} ${${KITNAME}_IMAGE_TESTS} ${${KITNAME}_CUSTOM_TESTS}
26 add_executable(${KITNAME}TestDriver ${MITKTEST_SOURCE})
27 set_property(
TARGET ${KITNAME}TestDriver PROPERTY LABELS ${PROJECT_NAME})
28 target_link_libraries(${KITNAME}TestDriver ${${KITNAME}_CORE_LIBRARIES} ${${KITNAME}_LIBRARIES} ${LIBRARIES_FOR_${KITNAME}_CORE})
30 # Now tell
CMake which tests should be run. This is done automatically
31 #
for all tests
in ${KITNAME}_TESTS and ${KITNAME}_IMAGE_TESTS. The IMAGE_TESTS
32 # are run for each image in the TESTIMAGES list.
34 foreach(
test ${${KITNAME}_TESTS} )
35 get_filename_component(TName ${
test} NAME_WE)
36 add_test(${TName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KITNAME}TestDriver ${TName})
37 set_property(TEST ${TName} PROPERTY LABELS ${PROJECT_NAME})
40 foreach(image ${${KITNAME}_TESTIMAGES} ${ADDITIONAL_TEST_IMAGES} )
42 set(IMAGE_FULL_PATH ${image})
44 # todo: maybe search other paths as well
45 # yes, please in mitk/Testing/Data, too
46 set(IMAGE_FULL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/Data/${image})
49 if(EXISTS "${IMAGE_FULL_PATH}
")
50 foreach( test ${${KITNAME}_IMAGE_TESTS} )
51 get_filename_component(TName ${test} NAME_WE)
52 get_filename_component(ImageName ${IMAGE_FULL_PATH} NAME)
53 add_test(${TName}_${ImageName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KITNAME}TestDriver ${TName} ${IMAGE_FULL_PATH})
54 set_property(TEST ${TName}_${ImageName} PROPERTY LABELS ${PROJECT_NAME})
57 message("!!!!! No such file: ${IMAGE_FULL_PATH} !!!!!
")
Follow Up Storage - Class to facilitate loading/accessing structured follow-up data.
MITK_CREATE_DEFAULT_TESTS()
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)