CMakeLists.txt 6.36 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
otb_module_test()

set(OTBExtendedFilenameTests
otbExtendedFilenameTestDriver.cxx
otbExtendedFilenameToReaderOptionsTest.cxx
otbExtendedFilenameToWriterOptionsTest.cxx
otbExtendedFilenameTest.cxx
)

add_executable(otbExtendedFilenameTestDriver ${OTBExtendedFilenameTests})
target_link_libraries(otbExtendedFilenameTestDriver ${OTBExtendedFilename-Test_LIBRARIES})
otb_module_target_label(otbExtendedFilenameTestDriver)

# Tests Declaration
Julien Michel's avatar
Julien Michel committed
15 16 17
set(streaming_sizevalue_auto "8")
set(streaming_sizevalue_nbsplits "10")
set(streaming_sizevalue_height "100")
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
foreach(streaming_type "Tiled" "Stripped")
  foreach(streaming_sizemode "Auto" "Nbsplits" "Height")
    string(TOLOWER ${streaming_type} type)
    string(TOLOWER ${streaming_sizemode} sizemode)

    set(_test_name "ioTvImageFileWriterExtendedFileName_Streaming${streaming_type}${streaming_sizemode}")

    otb_add_test(NAME ${_test_name} COMMAND otbExtendedFilenameTestDriver
      --compare-image ${NOTOL}
               ${INPUTDATA}/maur_rgb_24bpp.tif
               ${TEMP}/${test_name}.tif
      otbImageFileWriterWithExtendedFilename
              ${INPUTDATA}/maur_rgb_24bpp.tif
              ${TEMP}/${test_name}.tif?&streaming:type=${type}&streaming:sizemode=${sizemode}&streaming:sizevalue=${streaming_sizevalue_${sizemode}}
    )
  endforeach()
endforeach()

otb_add_test(NAME ioTvExtendedFilenameToReaderOptions_FullOptions COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioTvExtendedFilenameToReaderOptions_FullOptions.txt
  ${TEMP}/ioTvExtendedFilenameToReaderOptions_FullOptions.txt
  otbExtendedFilenameToReaderOptions
  /home/data/filename.tif?&geom=/home/dev/custom.geom&sdataidx=2&resol=4&skipcarto=On
  ${TEMP}/ioTvExtendedFilenameToReaderOptions_FullOptions.txt
  )

otb_add_test(NAME ioTvExtendedFilenameToReaderOptions_NoOptions COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioTvExtendedFilenameToReaderOptions_NoOptions.txt
  ${TEMP}/ioTvExtendedFilenameToReaderOptions_NoOptions.txt
  otbExtendedFilenameToReaderOptions
  /home/data/filename.tif
  ${TEMP}/ioTvExtendedFilenameToReaderOptions_NoOptions.txt
  )

otb_add_test(NAME ioTvExtendedFilenameToWriterOptions_FullOptions COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioTvExtendedFilenameToWriterOptions_FullOptions.txt
  ${TEMP}/ioTvExtendedFilenameToWriterOptions_FullOptions.txt
  otbExtendedFilenameToWriterOptions
  /home/data/filename.tif?&writegeom=ON&gdal:co:QUALITY=75&gdal:co:TILED=YES&gdal:co:BLOCKYSIZE=1024
  ${TEMP}/ioTvExtendedFilenameToWriterOptions_FullOptions.txt
  )

otb_add_test(NAME ioTvExtendedFilenameToWriterOptions_NoOptions COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioTvExtendedFilenameToWriterOptions_NoOptions.txt
  ${TEMP}/ioTvExtendedFilenameToWriterOptions_NoOptions.txt
  otbExtendedFilenameToWriterOptions
  /home/data/filename.tif
  ${TEMP}/ioTvExtendedFilenameToWriterOptions_NoOptions.txt
  )

otb_add_test(NAME ioTvImageFileWriterExtendedFileName_StreamingNone COMMAND otbExtendedFilenameTestDriver
  --compare-image ${NOTOL}
  ${INPUTDATA}/maur_rgb_24bpp.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_streamingNone.tif
  otbImageFileWriterWithExtendedFilename
  ${INPUTDATA}/maur_rgb_24bpp.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_streamingNone.tif?&streaming:type=none)

otb_add_test(NAME ioTvImageFileReaderExtendedFileName_GEOM COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioImageFileReaderWithExternalGEOMFile.txt
  ${TEMP}/ioImageFileReaderWithExternalGEOMFile.txt
  otbImageFileReaderWithExtendedFilename
  ${INPUTDATA}/ToulouseExtract_WithGeom.tif?&geom=${INPUTDATA}/ToulouseExtract_ModifiedGeom.geom
  ${TEMP}/ioImageFileReaderWithExternalGEOMFile.txt
  ${TEMP}/ioImageFileReaderWithExternalGEOMFile_pr.txt
  )

otb_add_test(NAME ioTvImageFileWriterExtendedFileName_GEOM COMMAND otbExtendedFilenameTestDriver
  --ignore-order --compare-ascii ${NOTOL}
  ${INPUTDATA}/ToulouseExtract_WithGeom.geom
  ${TEMP}/ioImageFileWriterExtendedFileName_GEOM.geom
  --ignore-lines-with 2 ce90_absolute ce90_relative
  otbImageFileWriterWithExtendedFilename
  ${INPUTDATA}/ToulouseExtract_WithGeom.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_GEOM.tif?&writegeom=ON
  )

otb_add_test(NAME ioTvImageFileWriterExtendedFileName_StreamingAuto COMMAND otbExtendedFilenameTestDriver
  --compare-image ${NOTOL}
  ${INPUTDATA}/maur_rgb_24bpp.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_streamingAuto.tif
  otbImageFileWriterWithExtendedFilename
  ${INPUTDATA}/maur_rgb_24bpp.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_streamingAuto.tif?&streaming:type=auto&streaming:sizevalue=${streaming_sizevalue_auto})

otb_add_test(NAME ioTvImageFileReaderExtendedFileName_mix1 COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioImageFileReaderExtendedFileName_mix1pr.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_mix1pr.txt
  otbImageFileReaderWithExtendedFilename
  ${INPUTDATA}/bretagne.j2k?&skipcarto=true&resol=2
  ${TEMP}/ioImageFileReaderExtendedFileName_mix1kwl.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_mix1pr.txt
  )

otb_add_test(NAME ioTvImageFileWriterExtendedFileName_gdalco COMMAND otbExtendedFilenameTestDriver
  --compare-image ${NOTOL}
  ${BASELINE}/ioTvGDALImageIO_JPEG_20.jpg
  ${TEMP}/ioImageFileWriterExtendedFileName_gdalco.jpg
  otbImageFileWriterWithExtendedFilename
  ${INPUTDATA}/maur_rgb_24bpp.tif
  ${TEMP}/ioImageFileWriterExtendedFileName_gdalco.jpg?&gdal:co:QUALITY=20
  )

otb_add_test(NAME ioTvImageFileReaderExtendedFileName_SkipGeom COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioImageFileReaderExtendedFileName_Skipgeom_pr.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_Skipgeom_pr.txt
  otbImageFileReaderWithExtendedFilename
  ${INPUTDATA}/ToulouseExtract_WithGeom.tif?&skipgeom=true
  ${TEMP}/ioImageFileReaderExtendedFileName_Skipgeom_kwl.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_Skipgeom_pr.txt
  )

otb_add_test(NAME ioTvImageFileReaderExtendedFileName_SkipPR COMMAND otbExtendedFilenameTestDriver
  --compare-ascii ${NOTOL}
  ${BASELINE}/ioImageFileReaderExtendedFileName_SkipPR.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_SkipPR.txt
  otbImageFileReaderWithExtendedFilename
  ${INPUTDATA}/ToulouseExtract_WithGeom.tif?&skipcarto=true
  ${TEMP}/ioImageFileReaderExtendedFileName_SkipPR_kwl.txt
  ${TEMP}/ioImageFileReaderExtendedFileName_SkipPR.txt
  )