X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=tests%2Ftools%2FCMakeLists.txt;h=6f4bcbffeb2f188b0e0c17203d591217030d84c4;hb=12317efdc0a451f877e41a13c26d56931798af0b;hp=f915a5bbd177f9ac52a77fe724be2b51385b9e02;hpb=765020625fbc092d283e221e36c83e60a1844cb7;p=clitk.git diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index f915a5b..6f4bcbf 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -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