]> Creatis software - gdcm.git/blobdiff - Testing/CMakeLists.txt
ENH: Apply a patch of 1400 lines to bring the DICOM dict in sync with the 2006 editio...
[gdcm.git] / Testing / CMakeLists.txt
index d97a4c6ef13bac04be241c2a92ffc93104b91118..07cbf7889967795faabda4ac0ba69ce221514dfe 100644 (file)
@@ -8,25 +8,35 @@ SET(GDCM_TESTS ${CXX_TEST_PATH}/gdcmTests)
 # add test that does not require data:
 # They usally return if no argument is given
 SET(TEST_SOURCES
+  TestEmpty.cxx
   TestUtil.cxx
   TestBug.cxx
   TestHash.cxx
+  TestCommand.cxx
   TestTS.cxx
   TestVR.cxx
   TestDictGroupName.cxx
   TestDict.cxx
+  TestDataEntry.cxx
   TestWriteSimple.cxx
   TestImageSet.cxx
   TestDicomDirElement.cxx
   TestDicomString.cxx
-  #TestValidate.cxx
+  TestEnumVR.cxx
+
 )
+IF(UNIX)
+  SET(TEST_SOURCES ${TEST_SOURCES}
+    #TestInline.cxx
+  )
+ENDIF(UNIX)
 
 # add tests that require data
 IF (GDCM_DATA_ROOT)
   SET(TEST_SOURCES ${TEST_SOURCES}
     TestFileAccessors.cxx
     TestMakeIcon.cxx
+    TestLoadAllDocumentsNoPrivNoSeq.cxx # includes generated gdcmDataImages.h
     TestPrintAllDocument.cxx         # includes generated gdcmDataImages.h
     #TestAllEntryVerify.cxx           # includes generated gdcmDataImages.h
     TestAllReadCompareDicom.cxx      # includes generated gdcmDataImages.h
@@ -40,6 +50,8 @@ IF (GDCM_DATA_ROOT)
     TestBuildUpDicomDir.cxx          # writes a file named "NewDICOMDIR"
     TestMakeDicomDir.cxx             # writes a file named "NewDICOMDIR"
     TestSerieHelper.cxx              # uses gdcmData as a default root directory    
+    TestAllVM.cxx
+    TestValidate.cxx                 #Just to have on overviews of oddities ...  
   )
   # add test that require VTK:
   IF(GDCM_VTK)
@@ -58,7 +70,7 @@ IF (GDCM_DATA_ROOT)
       INCLUDE(${VTK_USE_FILE})
 
       INCLUDE_DIRECTORIES(
-        ${GDCM_SOURCE_DIR}/vtk/
+        ${GDCM_SOURCE_DIR}/vtk
       )
       SET(TEST_SOURCES ${TEST_SOURCES}
         VTKTestRead.cxx
@@ -74,14 +86,18 @@ ENDIF (GDCM_DATA_ROOT)
 
 # include stuff
 INCLUDE_DIRECTORIES(
-  ${GDCM_SOURCE_DIR}/src/
-  ${GDCM_BINARY_DIR}/
+  ${GDCM_SOURCE_DIR}/src
+  ${GDCM_BINARY_DIR}
 )
 
 CREATE_TEST_SOURCELIST(Tests gdcmTests.cxx ${TEST_SOURCES})
 ADD_EXECUTABLE(gdcmTests ${Tests})
 IF(GDCM_VTK)
-  TARGET_LINK_LIBRARIES(gdcmTests vtkgdcm vtkRendering)
+  IF(GDCM_DATA_ROOT)
+    TARGET_LINK_LIBRARIES(gdcmTests vtkgdcm vtkRendering)
+  ELSE(GDCM_DATA_ROOT)
+    TARGET_LINK_LIBRARIES(gdcmTests gdcm)
+  ENDIF(GDCM_DATA_ROOT)     
 ELSE(GDCM_VTK)
   TARGET_LINK_LIBRARIES(gdcmTests gdcm)
 ENDIF(GDCM_VTK)
@@ -123,23 +139,35 @@ SET(BLACK_LIST
   "ETIAM_video_002.dcm"
   #Something stupid occured in the code for LibIDO images.
   #I Black list them for a while. JP
-  "gdcm-ACR-LibIDO.acr"
+  #"gdcm-ACR-LibIDO.acr"
   "LIBIDO-24-ACR_NEMA-Rectangle.dcm"
   #16 Bits per pixel images with LUT 16 Bits.
   #I wait to be 100% sure before releasing them. JP
   "rle16sti.dcm"
   "rle16loo.dcm"   
+  # Jasper cannot handle this image, only kakadu so far, unless you patch jasper
+  # but then it breaks other images...
+  "CT_Phillips_JPEG2K_Decompr_Problem.dcm"
+  #
+  # ------------
+  #  
+  #Still cause troubles (see the .README.txt file for more details)  
+  "MR_Philips_Intera_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm"  
+  "MR_Philips_Intera_PrivateSequenceExplicitVR.dcm" 
+  #The 2 previous images are identical !
+  #--> Replaced by more significant name
+  "MR_Philips_Intera_PrivateSequenceExplicitVR_in_SQ_2001_e05f_item_wrong_lgt_use_NOSHADOWSEQ.dcm"
+
+  #hexedit shows something *very* strange around offset 0x76e !
+  #the images looks *over*corrupted (on disc, not from the manufacturer!)
+  "MR_Philips_Intera_PrivateSequenceImplicitVR.dcm"
+  
+  # Seems this one hangs on 64 bits processors ?!?
+  # I blacklist it untill the pb is solved.
+  # (to get some more green on the Dasboards)
+  "MR_Philips-Intera_BreaksNOSHADOW.dcm"
   )
 
-# Don't understand why jasper is segfaulting with borland...I bet a borland bug
-IF(BORLAND)
-  SET(BLACK_LIST
-    ${BLACK_LIST}
-    "D_CLUNIE_CT1_J2KR.dcm"
-    "D_CLUNIE_CT1_J2KI.dcm"
-    )
-ENDIF(BORLAND)
-
 # Create a specific list of dicom files that we know are part of a sequence
 SET(SEQ_LIST
   "SIEMENS_MAGNETOM-12-MONO2-FileSeq[0-9].dcm"
@@ -177,3 +205,34 @@ FILE(WRITE "${GDCM_BINARY_DIR}/gdcmDataImages.h"
 FILE(WRITE "${GDCM_BINARY_DIR}/gdcmDataSeqImages.h"
   "const char * const gdcmDataSeqImages[] = { ${GDCM_DATA_SEQ_IMAGES}\n0 };\n" 
 )
+
+#-----------------------------------------------------------------------------
+# Trying to solve a bizarre problem when loading shared lib if gdcm is static
+# Therefore I disable the test when building SHAREDLIBS
+IF(UNIX AND NOT BUILD_SHARED_LIBS)
+  ADD_LIBRARY(dynmodule MODULE dynmodule.cxx)
+  TARGET_LINK_LIBRARIES(dynmodule gdcm)
+  ADD_EXECUTABLE(loadmodule loadmodule.cxx )
+  TARGET_LINK_LIBRARIES(loadmodule gdcm -ldl)
+  ADD_TEST(loadmodule ${CXX_TEST_PATH}/loadmodule)
+ENDIF(UNIX AND NOT BUILD_SHARED_LIBS)
+
+
+#-----------------------------------------------------------------------------
+# Do the build against an installed gdcm
+SET(GDCM_TEST_INSTALL_LEFT "${CMAKE_INSTALL_PREFIX}")
+SET(GDCM_TEST_INSTALL_RIGHT "${GDCM_BINARY_DIR}/InstallTest/Root")
+STRING(COMPARE EQUAL "${GDCM_TEST_INSTALL_LEFT}" "${GDCM_TEST_INSTALL_RIGHT}"
+  GDCM_TEST_INSTALL)
+IF(GDCM_TEST_INSTALL)
+  ADD_TEST(Install
+    ${CMAKE_CTEST_COMMAND}
+    #  ${GDCM_INSTALL_TEST_CONFIG_TYPE}
+    --build-and-test ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}
+    --build-generator ${CMAKE_GENERATOR}
+    --build-project GDCM
+    --build-makeprogram ${CMAKE_MAKE_PROGRAM}
+    --build-noclean
+    --build-target install)
+ENDIF(GDCM_TEST_INSTALL)
+