]> Creatis software - clitk.git/blobdiff - tests/tools/CMakeLists.txt
update of TOOLS_PATH in tests
[clitk.git] / tests / tools / CMakeLists.txt
index 6f4bcbffeb2f188b0e0c17203d591217030d84c4..b79dab4de686793797352b92162eebe56f45b8f4 100644 (file)
@@ -4,17 +4,33 @@ include_directories(
   ${GTEST_DIR}/include
 )
 
-FILE(GLOB srcs *.cxx)
-ADD_EXECUTABLE(toolsTest ${srcs})
-ADD_DEFINITIONS(-DTOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\")
-target_link_libraries(toolsTest vvLib ${vvExternalLibs} gtest)
+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)
 
 # Add all tests found in the source code, calling the executable to run them
 add_google_tests ( ${EXECUTABLE_OUTPUT_PATH}/toolsTest ${srcs})
 
 SET(BUILDNAME ${BUILDNAME}_tools CACHE INTERNAL DOCSTRING)
 
-ADD_EXECUTABLE(clitkImageInfoTest_oldWay clitkImageInfoTest_oldWay.cpp)
-target_link_libraries(clitkImageInfoTest_oldWay vvLib ${vvExternalLibs})
-ADD_TEST(clitkImageInfoTest_oldWay ${EXECUTABLE_OUTPUT_PATH}/clitkImageInfoTest_oldWay firstOne)
-ADD_TEST(clitkImageInfoTest_oldWay ${EXECUTABLE_OUTPUT_PATH}/clitkImageInfoTest_oldWay secondOne)
\ No newline at end of file
+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