From: mpech Date: Fri, 1 Jul 2011 13:30:24 +0000 (+0200) Subject: clitkImageInfo tests X-Git-Tag: v1.3.0~300^2^2~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=0624167920352550d4e66444b97a957b6053a50c;p=clitk.git clitkImageInfo tests --- diff --git a/CTestConfig.cmake b/CTestConfig.cmake index 6eb9c86..52561be 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -8,7 +8,7 @@ set(CTEST_DROP_SITE_CDASH TRUE) #========================================================= -SET(CLITK_TEST_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data CACHE INTERNAL DOCSTRING) +SET(CLITK_TEST_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data/ CACHE INTERNAL DOCSTRING) # Get the data tests IF(WIN32) SET(scriptExt bat) diff --git a/tests/tools/CMakeLists.txt b/tests/tools/CMakeLists.txt index 7713d09..b79dab4 100644 --- a/tests/tools/CMakeLists.txt +++ b/tests/tools/CMakeLists.txt @@ -9,7 +9,7 @@ SET (CUSTOM_TEST_SRC vvMainTest.cxx ) ADD_EXECUTABLE(toolsTest ${CUSTOM_TEST_SRC}) -ADD_DEFINITIONS(-DTOOLS_PATH=\"${PROJECT_BINARY_DIR}/bin/\") +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 @@ -23,12 +23,14 @@ SET (srcs 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 Deformation4D.mhd Deformation4D_ref.info) -ADD_TEST(clitkImageInfo_2 ${exe} clitkImageInfo Lung3D.mhd Lung3D_ref.info) +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 Deformation4D.mhd Cropped_Deformation4D_ref.spacing) -ADD_TEST(clitkGetSpacing_2 ${exe} clitkGetSpacing Lung3D.mhd Cropped_Deformation4D_ref.spacing) -UNSET(exe) \ No newline at end of file +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 diff --git a/tests/tools/toolTestRunner.cxx b/tests/tools/toolTestRunner.cxx index 4e13ec0..0eb1f90 100644 --- a/tests/tools/toolTestRunner.cxx +++ b/tests/tools/toolTestRunner.cxx @@ -32,18 +32,14 @@ int getOutputOptionIndex(int argc, char** argv){ } return NO_OUTPUT_OPTION; } -char* getTmpFileName(){ +inline char* getTmpFileName(){ char buffer [L_tmpnam]; - char * pointer; - char* back = tmpnam (buffer); if(back==NULL){ - std::cout<<"fail to get temporary file name"< "<