]> Creatis software - clitk.git/blobdiff - tests/tools/CMakeLists.txt
Modification for nightly builds
[clitk.git] / tests / tools / CMakeLists.txt
index f915a5bbd177f9ac52a77fe724be2b51385b9e02..6f4bcbffeb2f188b0e0c17203d591217030d84c4 100644 (file)
@@ -1,17 +1,20 @@
-# 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(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)
+FILE(GLOB srcs *.cxx)
+ADD_EXECUTABLE(toolsTest ${srcs})
+ADD_DEFINITIONS(-DTOOLS_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(BUILD_TESTING)
+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