]> Creatis software - clitk.git/commitdiff
renaming clitk_data_path in clitk_test_data_path
authormpech <maxime.pech@insa-lyon.fr>
Wed, 29 Jun 2011 16:02:26 +0000 (18:02 +0200)
committermpech <maxime.pech@insa-lyon.fr>
Wed, 29 Jun 2011 16:02:26 +0000 (18:02 +0200)
"factorizing" git repo in CTestConfig

CTestConfig.cmake
tests/CMakeLists.txt
tests/fetch_data_test.sh
tests/tools/clitkAffineTransformTest.cxx
tests/tools/clitkImageInfoTest.cxx
tests/tools/clitkImageInfoTest_oldWay.cpp
tests/tools/clitkWriteDicomSeriesTest.cxx
tests/vv/vvRegisterFormTest.cxx

index 1f71d14..6eb9c86 100644 (file)
@@ -5,3 +5,14 @@ set(CTEST_DROP_METHOD "http")
 set(CTEST_DROP_SITE "my.cdash.org")
 set(CTEST_DROP_LOCATION "/submit.php?project=VV")
 set(CTEST_DROP_SITE_CDASH TRUE)
+
+
+#=========================================================
+SET(CLITK_TEST_DATA_PATH ${PROJECT_BINARY_DIR}/tests/data CACHE INTERNAL DOCSTRING)
+# Get the data tests
+IF(WIN32)
+  SET(scriptExt bat)
+ELSE(UNIX)
+  SET(scriptExt sh)
+ENDIF()
+EXEC_PROGRAM(${PROJECT_SOURCE_DIR}/tests/fetch_data_test.${scriptExt} ARGS ${CLITK_TEST_DATA_PATH} http://russule/data/.git)
\ No newline at end of file
index 479b144..0ad6b85 100644 (file)
@@ -3,18 +3,8 @@ cmake_policy(SET CMP0005 NEW)
 
 #=========================================================
 # Data tests path
-
-OPTION(CLITK_DATA_PATH ${CMAKE_CURRENT_BINARY_DIR}/data)
-ADD_DEFINITIONS(-DCLITK_DATA_PATH=\"${CLITK_DATA_PATH}/\")
-#=========================================================
+ADD_DEFINITIONS(-DCLITK_TEST_DATA_PATH=\"${CLITK_TEST_DATA_PATH}/\")
 #=========================================================
-# Get the data tests
-IF(WIN32)
-  SET(scriptExt bat)
-ELSE(UNIX)
-  SET(scriptExt sh)
-ENDIF()
-EXEC_PROGRAM(${CMAKE_CURRENT_SOURCE_DIR}/fetch_data_test.${scriptExt} ARGS ${CLITK_DATA_PATH})
 #=========================================================
 # Google test macro
 macro(ADD_GOOGLE_TESTS executable)
index ce581b6..f516146 100755 (executable)
@@ -2,22 +2,11 @@
 #
 # arg[1] is TESTING_BINARY_DIR
 # This script has been edited from itk/Modules/ThirdParty/NIFTI/src/nifti/Testing/nifti_regress_test/cmake_testscripts/fetch_data_test.sh
-if [ $# -lt 1 ]
-then
-echo Missing Binary directory name
-exit 1
-fi
-
-repo=http://localhost/data/.git
-
 if cd $1
 then
-git pull
+  git pull
 else
-git clone $repo $1
-exit 1
+  git clone $2 $1
 fi
-
-
 exit 0
 
index 82d4df9..2a7fe92 100644 (file)
@@ -52,8 +52,8 @@ static inline void compare(std::string mhd, std::string refMhd, std::string refR
   remove("out.raw");
 }
 TEST(identity, clitkAffineTransformTest){
-  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
-  std::string refMhd1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.mhd";
-  std::string refRaw1=std::string(CLITK_DATA_PATH)+"Deformation4DRef.raw";
+  std::string mhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4D.mhd";
+  std::string refMhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4DRef.mhd";
+  std::string refRaw1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4DRef.raw";
   compare(mhd1, refMhd1, refRaw1);
 }
\ No newline at end of file
index 4f8413c..0b3f303 100644 (file)
@@ -31,14 +31,14 @@ static inline void compare(std::string mhd, std::string ref){
   remove("clitkImageInfoTest.out");
 }
 TEST(clitkImageInfoTest, main){
-  std::string mhd1=std::string(CLITK_DATA_PATH)+"Deformation4D.mhd";
+  std::string mhd1=std::string(CLITK_TEST_DATA_PATH)+"Deformation4D.mhd";
   ASSERT_TRUE(itksys::SystemTools::FileExists(mhd1.c_str(), true));
   
-  std::string mhd2=std::string(CLITK_DATA_PATH)+"Lung3D.mhd";
+  std::string mhd2=std::string(CLITK_TEST_DATA_PATH)+"Lung3D.mhd";
   ASSERT_TRUE(itksys::SystemTools::FileExists(mhd2.c_str(), true));
   
   mhd1+=" "+mhd2;
-  std::string ref1=std::string(CLITK_DATA_PATH)+"clitkImageInfoTestRef.out";
+  std::string ref1=std::string(CLITK_TEST_DATA_PATH)+"clitkImageInfoTestRef.out";
   ASSERT_TRUE(itksys::SystemTools::FileExists(ref1.c_str(), true));
   compare(mhd1, ref1);
 }
\ No newline at end of file
index fa60e44..634a68c 100644 (file)
@@ -24,8 +24,8 @@
 #include <itksys/SystemTools.hxx>
 int main(int argc, char** argv){
   int fail = 1;
-  std::string mhd = std::string(CLITK_DATA_PATH);
-  std::string ref = std::string(CLITK_DATA_PATH);
+  std::string mhd = std::string(CLITK_TEST_DATA_PATH);
+  std::string ref = std::string(CLITK_TEST_DATA_PATH);
   
   //We select which image we use to test clitkImageInfo
   int idImg = atoi(argv[1]);
index bc63080..2e0c505 100644 (file)
@@ -21,8 +21,8 @@
 #include <itksys/SystemTools.hxx>
 TEST(clitkWriteDicomSeriesTest, main){
   
-  std::string fIn=std::string(CLITK_DATA_PATH)+"/3d/mhd/00.mhd";
-  std::string fOut=std::string(CLITK_DATA_PATH)+"/3d/dcm/1.2.840.113704.1.111.536.1248695032.26";
+  std::string fIn=std::string(CLITK_TEST_DATA_PATH)+"/3d/mhd/00.mhd";
+  std::string fOut=std::string(CLITK_TEST_DATA_PATH)+"/3d/dcm/1.2.840.113704.1.111.536.1248695032.26";
   ASSERT_TRUE(itksys::SystemTools::FileExists(fIn.c_str(), true));
   std::ostringstream cmd_line;
   cmd_line << TOOLS_PATH <<"clitkWriteDicomSeries -i " << fIn << " -d " << fOut << " -o dcm --verbose";
index 15d88c4..6c623df 100644 (file)
@@ -22,7 +22,7 @@
 #include "vvConfiguration.h"
 #include <stdio.h>
 #include <fstream>
-const std::string data_path = CLITK_DATA_PATH;
+const std::string data_path = CLITK_TEST_DATA_PATH;
 TEST(vvRegisterForm, canPush){
   QUrl url;
   //the file exists with some old lines