X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Ftools%2FCMakeLists.txt;h=b79dab4de686793797352b92162eebe56f45b8f4;hb=627ed56d8b46f182a45781a6a26aa099638371b1;hp=950194e4b0d9d898c538e3ff7135eea12dac97f3;hpb=4a97517996cc04de6f0285cdd4fbbb40b269a6b3;p=clitk.git diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index 950194e..b79dab4 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -1,17 +1,36 @@ -# Add test apps and test executions to this part -# Test apps are compiled as any other app in the -# project. Test executions are run using "make test" -# -IF(CLITK_BUILD_TESTING) +include_directories( + ${PROJECT_SOURCE_DIR}/common + ${PROJECT_SOURCE_DIR}/tools + ${GTEST_DIR}/include +) - # clitkImageInfo - ADD_EXECUTABLE(clitkImageInfoTest clitkImageInfoTest.cxx) - TARGET_LINK_LIBRARIES(clitkImageInfoTest ITKIO) - ADD_TEST(NAME clitkImageInfoTest COMMAND clitkImageInfoTest) +SET (CUSTOM_TEST_SRC + clitkImageInfoTest.cxx + vvMainTest.cxx +) +ADD_EXECUTABLE(toolsTest ${CUSTOM_TEST_SRC}) +ADD_DEFINITIONS(-DCLITK_TEST_TOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\") +TARGET_LINK_LIBRARIES(toolsTest vvLib ${vvExternalLibs} gtest) - # clitkWriteDicomSeries - ADD_EXECUTABLE(clitkWriteDicomSeriesTest clitkWriteDicomSeriesTest.cxx) - TARGET_LINK_LIBRARIES(clitkWriteDicomSeriesTest ITKIO) - ADD_TEST(NAME clitkWriteDicomSeriesTest COMMAND clitkWriteDicomSeriesTest) +# Add all tests found in the source code, calling the executable to run them +add_google_tests ( ${EXECUTABLE_OUTPUT_PATH}/toolsTest ${srcs}) -ENDIF(CLITK_BUILD_TESTING) +SET(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING) + +SET (srcs + toolTestRunner.cxx +) +ADD_EXECUTABLE(toolTestRunner ${srcs}) +TARGET_LINK_LIBRARIES(toolTestRunner vvLib ${vvExternalLibs}) +SET(exe ${EXECUTABLE_OUTPUT_PATH}/toolTestRunner) +SET(p ${CLITK_TEST_DATA_PATH}) +#========================================================= +# clitkImageInfo +ADD_TEST(clitkImageInfo_1 ${exe} clitkImageInfo ${p}Deformation4D.mhd ${p}Deformation4D_ref.info) +ADD_TEST(clitkImageInfo_2 ${exe} clitkImageInfo ${p}Lung3D.mhd ${p}Lung3D_ref.info) +#========================================================= +# clitkGetSpacing +ADD_TEST(clitkGetSpacing_1 ${exe} clitkGetSpacing ${p}Deformation4D.mhd ${p}Deformation4D_ref.spacing) +ADD_TEST(clitkGetSpacing_2 ${exe} clitkGetSpacing ${p}Lung3D.mhd ${p}Deformation4D_ref.spacing) +UNSET(exe) +UNSET(p) \ No newline at end of file