]> Creatis software - gdcm.git/commitdiff
ENH: Adding automatic testing
authormalaterre <malaterre>
Sun, 25 Apr 2004 18:31:48 +0000 (18:31 +0000)
committermalaterre <malaterre>
Sun, 25 Apr 2004 18:31:48 +0000 (18:31 +0000)
1. Need a DartConfig.cmake to submit to public
2. Add a test driver gdcmTest.cxx
3. gdcmTestMain, an helper for the main test driver gdcmTest
4. Files in Test don't have a main anymore, this becomes intersting when we add more and more tests, thus dsw don't have to load too many projects

CMakeLists.txt
DartConfig.cmake [new file with mode: 0644]
Testing/CMakeLists.txt
Testing/TestBug.cxx
Testing/TestChangeHeader.cxx
Testing/TestDicomDir.cxx
Testing/TestHash.cxx
src/gdcmParser.cxx

index 4433fd5f6c2732a7cddf18f4281ebedb8f4d5143..4cb746f9512461683a8a02d927ac608f34470e62 100644 (file)
@@ -58,6 +58,16 @@ SUBDIRS(
   Test\r
 )\r
 \r
+#-----------------------------------------------------------------------------\r
+# Add the testing directories\r
+OPTION(GDCM_BUILD_TESTING "Test the project" ON)\r
+IF(GDCM_BUILD_TESTING)\r
+  ENABLE_TESTING()\r
+  INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)\r
+  SUBDIRS(Test)\r
+ENDIF(GDCM_BUILD_TESTING)\r
+\r
+\r
 #-----------------------------------------------------------------------------\r
 OPTION(GDCM_VTK "Build VTK-GDCM Lib." OFF)\r
 IF(GDCM_VTK)\r
@@ -116,7 +126,7 @@ EXPORT_LIBRARY_DEPENDENCIES(
   ${GDCM_BINARY_DIR}/gdcmLibraryDepends.cmake\r
   )\r
 \r
-# Intall the รขckaging files for use by FIND_PACKAGE(GDCM) in user projects.\r
+# Intall the packaging files for use by FIND_PACKAGE(GDCM) in user projects.\r
 INSTALL_FILES(/lin/gdcm FILES\r
   ${GDCM_SOURCE_DIR}/gdcmUse.cmake\r
   ${GDCM_BINARY_DIR}/gdcmConfig.cmake\r
diff --git a/DartConfig.cmake b/DartConfig.cmake
new file mode 100644 (file)
index 0000000..b8cd686
--- /dev/null
@@ -0,0 +1,37 @@
+# Dashboard is opened for submissions for a 24 hour period starting at\r
+# the specified NIGHLY_START_TIME. Time is specified in 24 hour format.\r
+SET (NIGHTLY_START_TIME "1:00:00 EDT")\r
+\r
+# Dart server to submit results (used by client)\r
+SET (DROP_SITE "public.kitware.com")\r
+SET (DROP_LOCATION "/incoming")\r
+SET (DROP_SITE_USER "ftpuser")\r
+SET (DROP_SITE_PASSWORD "public")\r
+SET (DROP_METHOD "ftp")\r
+SET (TRIGGER_SITE \r
+       "http://${DROP_SITE}/cgi-bin/Submit-Public-TestingResults.pl")\r
+\r
+# Project Home Page\r
+SET (PROJECT_URL "http://www.creatis.insa-lyon.fr/Public/Gdcm")\r
+\r
+# Dart server configuration \r
+SET (ROLLUP_URL "http://${DROP_SITE}/cgi-bin/Public-rollup-dashboard.sh")\r
+SET (CVS_WEB_URL "http://${DROP_SITE}/cgi-bin/cvsweb.cgi/Public/")\r
+SET (CVS_WEB_CVSROOT "Public")\r
+\r
+OPTION(BUILD_DOXYGEN "Build source documentation using doxygen" "Off")\r
+SET (DOXYGEN_CONFIG "${PROJECT_BINARY_DIR}/doxygen.config" )\r
+SET (USE_DOXYGEN "On")\r
+SET (DOXYGEN_URL "http://${DROP_SITE}/Public/Doxygen/html/" )\r
+\r
+SET (USE_GNATS "On")\r
+SET (GNATS_WEB_URL "http://${DROP_SITE}/Bug/index.php")\r
+\r
+# Continuous email delivery variables\r
+SET (CONTINUOUS_FROM "luis.ibanez@kitware.com")\r
+SET (SMTP_MAILHOST "public.kitware.com")\r
+SET (CONTINUOUS_MONITOR_LIST "luis.ibanez@kitware.com")\r
+SET (CONTINUOUS_BASE_URL "http://www.kitware.com/Testing")\r
+\r
+MARK_AS_ADVANCED(BUILD_DOXYGEN)\r
+\r
index aff9d67aaf65cbac9c5a86500a9987fec10f9562..0b27899a2762221658936f06381f75dcb1193395 100644 (file)
@@ -2,6 +2,10 @@
 # http://www.cmake.org/pipermail/cmake/2001-November/002491.html
 # So that dll is copied to each subdir where needed
 
+SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
+
+SET(GDCM_TESTS ${CXX_TEST_PATH}/gdcmTests)
+
 INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
 CHECK_INCLUDE_FILE("stdint.h"    CMAKE_HAVE_STDINT_H)
 
@@ -18,6 +22,9 @@ SET(TEST_SOURCES
   bug1.cxx
   pourFindTaggs.cxx
   dcm2acr.cxx
+  PrintDicomDir.cxx
+  makeDicomDir.cxx
+  testDicomDir.cxx
 )
 
 # include stuff
@@ -35,6 +42,11 @@ FOREACH(file ${TEST_SOURCES})
   )
   ENDIF(GDCM_TEST_COMPILE_FLAGS)
   GET_FILENAME_COMPONENT(name ${file} NAME_WE)
-  ADD_EXECUTABLE(${name} ${file})
-  TARGET_LINK_LIBRARIES(${name} gdcm)
+  ADD_TEST(${name} ${GDCM_TESTS} ${name})
 ENDFOREACH(file ${TEST_SOURCES})
+
+
+ADD_EXECUTABLE(gdcmTests gdcmTests.cxx ${TEST_SOURCES})
+TARGET_LINK_LIBRARIES(gdcmTests gdcm)
+
+
index 51383677f11b4af22c42d47c2e3beaa7325b7169..c63e0091ec0cb425fe1a8698967ac0a44a2f279c 100644 (file)
@@ -1,7 +1,7 @@
 // The following crashes on Win32
 #include "gdcm.h"
 
-int main(int argc, char* argv[])
+int bug1(int argc, char* argv[])
 {  
        gdcmHeader* e1;
        
index 3f2d5b818c9cc9c3582a36d7930a240a3b11921e..d33fc1f2bdcc59ec41232c4207b8879bfcfce2c9 100644 (file)
@@ -9,7 +9,7 @@
        // et des pixels d'une autre image
        
        
-int main(int argc, char* argv[]) {  
+int testChangeEntete(int argc, char* argv[]) {  
        std::string premier, deuxieme;
        char resultat[200];
        
index e47753c9243ac9cc43f94b0a113c42f80054d156..9b6855b701d89420ce598f5ac0fee3bf50ac3d29 100644 (file)
@@ -16,9 +16,8 @@
 #define  ostringstream ostrstream
 //extern "C"
 
-using namespace std;
 
-int main(int argc, char* argv[])
+int testDicomDir(int argc, char* argv[])
 {  
    gdcmDicomDir *e1;
    ListTag::iterator deb , fin;
@@ -80,7 +79,7 @@ int main(int argc, char* argv[])
    }   
  */
  
-   cout << std::endl << std::endl  
+   std::cout << std::endl << std::endl  
             << " = Liste des PATIENT/STUDY/SERIE ==========================================" 
             << std::endl<< std::endl;  
  
@@ -136,7 +135,7 @@ int main(int argc, char* argv[])
    }   
  */  
 
-   cout << std::endl << std::endl  
+   std::cout << std::endl << std::endl  
         << " = Contenu Complet du DICOMDIR ==========================================" 
         << std::endl<< std::endl;      
    e1->Print();
index 19112e09322610cf2fb86514795d21eb15499408..f0af57bb6745d2b756724ff48b983752e96a4fe3 100644 (file)
@@ -3,7 +3,7 @@
 #include <iostream>
 #include <stdio.h>
 
-int main() {
+int hashtest( int, char * [] ) {
 
   typedef std::map<std::string, char*> dict;
   
index 0ec0e22f9731edc23beab9e3b06c5d34dc5e1c51..14ed156457d5256f06fcea4ea2f676ffae9d13d4 100644 (file)
@@ -187,9 +187,9 @@ void gdcmParser::PrintEntryNiceSQ(std::ostream & os) {
                std::cout << "Kaie ! Kaie! SQ stack overflow" << std::endl;
               return;
             }
-        if (DEBUG) cout << "\n >>>>> empile niveau " << top 
+        if (DEBUG) std::cout << "\n >>>>> empile niveau " << top 
                         << "; Lgr SeQ: " << (*i)->GetReadLength() 
-                         << "\n" <<endl;
+                         << "\n" <<std::endl;
                 
         pile[top].totalSQlength = (*i)->GetReadLength();
         pile[top].alreadyParsedlength = 0; 
@@ -221,11 +221,11 @@ void gdcmParser::PrintEntryNiceSQ(std::ostream & os) {
                                << std::endl; 
                } else {
                  if (DEBUG) 
-                       cout << "alrdyPseLgt:"
+                       std::cout << "alrdyPseLgt:"
                       << pile[top].alreadyParsedlength << " totSeQlgt: " 
                       << pile[top].totalSQlength << " curPseLgt: " 
                       << currentParsedlength
-                      << endl;
+                      << std::endl;
                   while (pile[top].alreadyParsedlength==pile[top].totalSQlength) {
                  
                     if (DEBUG)