CMakeLists.txt 15 KB
Newer Older
1
2
3
 
IF( NOT OTB_DISABLE_CXX_TESTING )

4
5
6
7
8
9
10
11
12
SET(BASELINE ${OTB_DATA_ROOT}/Baseline/OTB/Images)
SET(BASELINE_FILES ${OTB_DATA_ROOT}/Baseline/OTB/Files)
SET(INPUTDATA ${OTB_DATA_ROOT}/Input)
#Images de teledetection (grosses images )
SET(IMAGEDATA ${OTB_DATA_ROOT}/LargeInput )
SET(TEMP ${OTBTesting_BINARY_DIR}/Temporary)

#Tolerance sur diff pixel image
SET(TOL 0.0)
13
SET(EPSILON 0.00000000001)
14
SET(EPSILON_10e6 0.000001)
15
16
17
18
19


SET(UTILITIES_TESTS ${CXX_TEST_PATH}/otbUtilitiesTests)


20
21
22
23
24
25
26
# Commentaire parce que trop long. Supprimer commentaire si besoin de tester integration lib Ossim
#ADD_TEST(utOssimIntegrationTest ${UTILITIES_TESTS}
#        ossimIntegrationTest
#        ossimTiffWriter
#        ${IMAGEDATA}/TOULOUSE/QuickBird/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
#        ${TEMP}/utOssimIntegration.tif
#)
27

28
ADD_TEST(utOssimKeywordlistToulouseQuickBirdTest ${UTILITIES_TESTS}
Julien Michel's avatar
Julien Michel committed
29
--compare-ascii ${EPSILON_10e6}  ${BASELINE_FILES}/utOssimKeywordlistToulouseQuickBird.txt
30
31
32
33
34
35
36
37
38
39
40
41
42
43
                        ${TEMP}/utOssimKeywordlistToulouseQuickBird.txt
        ossimKeywordlistTest
        ${IMAGEDATA}/TOULOUSE/QuickBird/000000128955_01_P001_PAN/02APR01105228-P1BS-000000128955_01_P001.TIF
        ${TEMP}/utOssimKeywordlistToulouseQuickBird.txt
        )

ADD_TEST(utOssimKeywordlistParisIkonosTest ${UTILITIES_TESTS}
--compare-ascii ${TOL}  ${BASELINE_FILES}/utOssimKeywordlistParisIkonos.txt
                        ${TEMP}/utOssimKeywordlistParisIkonos.txt
        ossimKeywordlistTest
        ${IMAGEDATA}/PARIS/Ikonos/po_79039_pan_0000000.tif
        ${TEMP}/utOssimKeywordlistParisIkonos.txt
        )

Thomas Feuvrier's avatar
Thomas Feuvrier committed
44
45
46
47
ADD_TEST(utOssimElevManagerTest ${UTILITIES_TESTS}
        ossimElevManagerTest
        )

48

49
ADD_TEST(utIjBSplineScatteredDataPointSetToImageFilterTest ${UTILITIES_TESTS}
50
--compare-image ${EPSILON}
51
52
53
54
55
56
		${BASELINE}/ijBSplineScatteredDataPointSetToImageFilterTestOutput.hdr
		${TEMP}/ijBSplineScatteredDataPointSetToImageFilterTestOutput.hdr
		ijBSplineScatteredDataPointSetToImageFilterTest
		${INPUTDATA}/brain.png
		${TEMP}/ijBSplineScatteredDataPointSetToImageFilterTestOutput.hdr
)
57

58
59
60
61
62
63
64
# -------            lib otbsvm   ------------------------------

ADD_TEST(utTuSvmKernelFunctorTest ${UTILITIES_TESTS}
                svmGenericKernelFunctor
)

ADD_TEST(utTvSvmTest ${UTILITIES_TESTS}
65
--compare-ascii ${TOL}  ${INPUTDATA}/svm_model
66
67
68
69
70
71
72
                ${TEMP}/svm_model_test
                svmTest
                ${INPUTDATA}/svm_model
                ${TEMP}/svm_model_test
)

ADD_TEST(utTvSvmTestNewVersionFileGenericModelTest ${UTILITIES_TESTS}
73
--compare-ascii ${TOL}  ${BASELINE_FILES}/utTvsvm_model_image_generic_version_test
74
75
76
77
78
79
80
                ${TEMP}/utTvsvm_model_image_generic_version_test
                svmTest
                ${INPUTDATA}/svm_model_image_generic_version
                ${TEMP}/utTvsvm_model_image_generic_version_test
)

ADD_TEST(utTvSvmTestGenericModelTest ${UTILITIES_TESTS}
81
--compare-ascii ${TOL}  ${INPUTDATA}/svm_model_image_generic_kernel
82
83
84
85
86
87
                ${TEMP}/svm_model_image_generic_kernel_test
                svmGenericKernelTest
                ${INPUTDATA}/svm_model_image_generic_kernel
                ${TEMP}/svm_model_image_generic_kernel_test
)

88
89
90
91
92
93
94
ADD_TEST(utTvSvmGenericKernelBasicOperationsTest ${UTILITIES_TESTS}
--compare-ascii ${TOL}  ${BASELINE_FILES}/utTvsvmGenericKernelBasicOperationsTest.txt
                	 ${TEMP}/svmGenericKernelBasicOperationsTest.txt
              svmGenericKernelBasicOperationsTest
		 ${TEMP}/svmGenericKernelBasicOperationsTest.txt
)

95
ADD_TEST(utTvSvmComposedKernelFunctorTest ${UTILITIES_TESTS}
96
97
98
99
100
101
102
103
104
--compare-n-ascii ${TOL} 3 
		  ${BASELINE_FILES}/utTvSVMComposedKernelFunctorResTest.txt
		  ${TEMP}/SVMComposedKernelFunctorTestRes.txt

		  ${BASELINE_FILES}/utTvSVMComposedKernelFunctorTest.txt
		  ${TEMP}/SVMComposedKernelFunctorTestOutputBis.txt
		  ${BASELINE_FILES}/utTvSVMComposedKernelFunctorTest.txt
		  ${TEMP}/SVMComposedKernelFunctorTestOutputBis.txt

105
               otbSVMComposedKernelFunctorTest
106
107
108
	           ${TEMP}/SVMComposedKernelFunctorTestRes.txt	
	           ${TEMP}/SVMComposedKernelFunctorTestOutput.txt
		   ${TEMP}/SVMComposedKernelFunctorTestOutputBis.txt
109
110
)	
	
111
# -------            lib otb6S   ------------------------------
112
113
114
115
116
117

# The file is not read. It a screen user scan. main.exe < 132.149.107.66.wloip20967.INP
#ADD_TEST(utTv6SMainTest ${UTILITIES_TESTS}
#                SIXSMainTest
#                ${INPUTDATA}/132.149.107.66.wloip20967.INP
#)
118

Thomas Feuvrier's avatar
Thomas Feuvrier committed
119
ADD_TEST(utTv6SFunctionMainTest ${UTILITIES_TESTS}
120
121
#--compare-ascii ${EPSILON_10e6}  ${BASELINE_FILES}/ut6S_function_main_test.txt
--compare-ascii ${TOL}  ${BASELINE_FILES}/ut6S_function_main_test.txt
122
                ${TEMP}/ut6S_function_main_test.txt
Thomas Feuvrier's avatar
Thomas Feuvrier committed
123
124
                SIXSFunctionMainOtbTest
                ${INPUTDATA}/in6S_otb
125
                ${TEMP}/ut6S_function_main_test.txt
Thomas Feuvrier's avatar
Thomas Feuvrier committed
126
)
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# -------            lib tinyXMLlib   ------------------------------
ADD_TEST(utTvTinyXMLTest ${UTILITIES_TESTS}
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utTinyXML_testStdout.txt 
                        ${TEMP}/utTinyXML_testStdout.txt
                tinyXMLlibTest
                ${INPUTDATA}/utf8test.xml
                ${INPUTDATA}/utf8testverify.xml
                ${TEMP}/demotest.xml
                ${TEMP}/utf8testout.xml
                ${TEMP}/passages.xml
                ${TEMP}/test5.xml
                ${TEMP}/test6.xml
                ${TEMP}/test7.xml
                ${TEMP}/textfile.txt
                ${TEMP}/utTinyXML_testStdout.txt
)


147
148
ADD_TEST(utOssimRadarSatSupport ${UTILITIES_TESTS}
        ossimRadarSatSupport
149
        ${IMAGEDATA}/RADARSAT2/SCENE01/DAT_01.001
150
        )
151

152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# -------            lib Galib   ------------------------------

FOREACH(num 1 12 14 16 17 25 27)
ADD_TEST( utTuGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        galibTests${num}
        seed 555 )
ENDFOREACH(num)

FOREACH(num 6 8 19 20)
        ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
                        ${TEMP}/utGalibTest${num}_bog.dat
        galibTests${num}
        score_filename ${TEMP}/utGalibTest${num}_bog.dat 
        seed 555 )
ENDFOREACH(num)
FOREACH(num 2 4 9 11 15)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
                        ${TEMP}/utGalibTest${num}_bog.dat
        galibTests${num}
        ${TEMP}/utGalibTest${num}_bog.dat 
        seed 555 )
ENDFOREACH(num)



SET(num 13)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
                        ${TEMP}/utGalibTest${num}_bog.dat
        galibTests${num}
        ${INPUTDATA}/galib-smiley.txt
        score_filename ${TEMP}/utGalibTest${num}_bog.dat 
        seed 555 )

FOREACH(num 3 18)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
                        ${TEMP}/utGalibTest${num}_bog.dat
                
        galibTests${num}
        file ${INPUTDATA}/galib-smiley.txt
        score_filename ${TEMP}/utGalibTest${num}_bog.dat 
        seed 555 )
ENDFOREACH(num)

SET(num 5)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}  
        --compare-ascii ${TOL}  
                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
                        ${TEMP}/utGalibTest${num}_bog.dat
         galibTests${num}
         score_filename ${TEMP}/utGalibTest${num}_bog.dat 
         graph ${INPUTDATA}/galib-smiley.txt
         values ${INPUTDATA}/galib-values.txt
         seed 555 )

# Test 7 commented becasue impossible to specific he bog.dat file name in the process ;-(
#SET(num 7)
#        ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
#        --compare-ascii ${TOL}  
#                        ${BASELINE_FILES}/utGalibTest${num}_bog.dat 
#                        ${TEMP}/utGalibTest${num}_bog.dat
#        galibTests${num}
#        ${TEMP}/utGalibTest${num}_bog.dat 
#        dfile ${INPUTDATA}/galib-smiley.txt
#        pfile ${INPUTDATA}/galib-settings.txt
#        seed 555 )


SET(num 10)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-n-ascii ${TOL} 4 
                        ${BASELINE_FILES}/utGalibTest${num}_sinusoid.dat 
                        ${TEMP}/utGalibTest${num}_sinusoid.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_pop.nospec.dat 
                        ${TEMP}/utGalibTest${num}_pop.nospec.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_pop.genespec.dat 
                        ${TEMP}/utGalibTest${num}_pop.genespec.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_pop.phenespec.dat 
                        ${TEMP}/utGalibTest${num}_pop.phenespec.dat 
        galibTests${num}
        ${TEMP}/utGalibTest${num}_sinusoid.dat 
        ${TEMP}/utGalibTest${num}_pop.nospec.dat 
        ${TEMP}/utGalibTest${num}_pop.genespec.dat 
        ${TEMP}/utGalibTest${num}_pop.phenespec.dat 
        seed 555 )

SET(num 21)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-n-ascii ${TOL} 5
                        ${BASELINE_FILES}/utGalibTest${num}_bog1.dat 
                        ${TEMP}/utGalibTest${num}_bog1.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_bog2.dat 
                        ${TEMP}/utGalibTest${num}_bog2.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_bog2a.dat 
                        ${TEMP}/utGalibTest${num}_bog2a.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_bog3.dat 
                        ${TEMP}/utGalibTest${num}_bog3.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_bog4.dat 
                        ${TEMP}/utGalibTest${num}_bog4.dat 
        galibTests${num}
        ${TEMP}/utGalibTest${num}_bog1.dat 
        ${TEMP}/utGalibTest${num}_bog2.dat 
        ${TEMP}/utGalibTest${num}_bog2a.dat 
        ${TEMP}/utGalibTest${num}_bog3.dat 
        ${TEMP}/utGalibTest${num}_bog4.dat 
        seed 555 )


SET(num 22)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        --compare-n-ascii ${TOL} 4
                        ${BASELINE_FILES}/utGalibTest${num}_sinusoid.dat 
                        ${TEMP}/utGalibTest${num}_sinusoid.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_pop.initial.dat 
                        ${TEMP}/utGalibTest${num}_pop.initial.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_pop.final.dat 
                        ${TEMP}/utGalibTest${num}_pop.final.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_blog.dat 
                        ${TEMP}/utGalibTest${num}_blog.dat 
        galibTests${num}
        ${TEMP}/utGalibTest${num}_sinusoid.dat 
        ${TEMP}/utGalibTest${num}_pop.initial.dat 
        ${TEMP}/utGalibTest${num}_pop.final.dat 
        score_filename ${TEMP}/utGalibTest${num}_blog.dat 
        seed 555 )

SET(num 23)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num} galibTests${num}  
        --compare-n-ascii ${TOL} 4
                        ${BASELINE_FILES}/utGalibTest${num}_popi.dat 
                        ${TEMP}/utGalibTest${num}_popi.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_popf.dat 
                        ${TEMP}/utGalibTest${num}_popf.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_sinusoid.dat 
                        ${TEMP}/utGalibTest${num}_sinusoid.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_blog.dat 
                        ${TEMP}/utGalibTest${num}_blog.dat 
        galibTests${num}
        ${TEMP}/utGalibTest${num}_popi.dat 
        ${TEMP}/utGalibTest${num}_popf.dat 
        ${TEMP}/utGalibTest${num}_sinusoid.dat 
        score_filename ${TEMP}/utGalibTest${num}_blog.dat 
        seed 555 )

SET(num 24)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num} galibTests${num}  
        --compare-n-ascii ${TOL} 3
                        ${BASELINE_FILES}/utGalibTest${num}_population.dat 
                        ${TEMP}/utGalibTest${num}_population.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_sinusoid.dat 
                        ${TEMP}/utGalibTest${num}_sinusoid.dat 
                        ${BASELINE_FILES}/utGalibTest${num}_blog.dat 
                        ${TEMP}/utGalibTest${num}_blog.dat 
        galibTests${num}
        ${INPUTDATA}/galib-settings.txt
        ${TEMP}/utGalibTest${num}_population.dat 
        ${TEMP}/utGalibTest${num}_sinusoid.dat 
        score_filename ${TEMP}/utGalibTest${num}_blog.dat 
        seed 555 )

SET(num 26)
ADD_TEST( utTvGalibTest${num}  ${CXX_TEST_PATH}/galibTests${num}   
        galibTests${num}
        ${INPUTDATA}/galib-tsp_rect_20.txt 
        seed 555 )



Julien Michel's avatar
Julien Michel committed
327
328

# -------            lib OpenJpeg   ------------------------------
329
330
#ADD_TEST(utOpenJpegEncoder ${UTILITIES_TESTS}
#	openJpegEncoder)
Julien Michel's avatar
Julien Michel committed
331

332
333
#ADD_TEST(utOpenJpegDecoder ${UTILITIES_TESTS}
#	openJpegDecoder)
Julien Michel's avatar
Julien Michel committed
334

335
# -------       Fichiers sources CXX -----------------------------------
336
337
SET(UtilitiesTests_SRCS
ossimIntegrationTest.cxx
338
ossimKeywordlistTest.cxx
Thomas Feuvrier's avatar
Thomas Feuvrier committed
339
ossimElevManagerTest.cxx
340
ijBSplineScatteredDataPointSetToImageFilterTest.cxx
341
342
343
svmGenericKernelFunctor.cxx
svmTest.cxx
svmGenericKernelTest.cxx
Thomas Feuvrier's avatar
Thomas Feuvrier committed
344
6SFunctionMainTest.cxx
345
tinyXMLlibTest.cxx
346
svmGenericKernelBasicOperationsTest.cxx
347
otbSVMComposedKernelFunctorTest.cxx
348
ossimRadarSatSupport.cxx
349
350
#openJpegEncoder.cxx
#openJpegDecoder.cxx
351
352
)

353
INCLUDE_DIRECTORIES("${OTBTesting_BINARY_DIR}")
354

355
ADD_EXECUTABLE(otbUtilitiesTests otbUtilitiesTests.cxx ${UtilitiesTests_SRCS})
356
357
#TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon otbossim otbsvm otb6S tinyXML openjpeg)
TARGET_LINK_LIBRARIES(otbUtilitiesTests OTBIO OTBCommon gdal ITKIO ITKAlgorithms ITKStatistics ITKCommon otbossim otbsvm otb6S tinyXML )
358
359
360
IF(UNIX)
    TARGET_LINK_LIBRARIES (otbUtilitiesTests m)
ENDIF(UNIX)
361

362
363
364
365
366
367
368
369
370
371
# -------       CXX and EXECUTABLES files for GALIB Tests -----------------------------------
FOREACH(loop_var RANGE 1 27 1)
        ADD_EXECUTABLE(galibTests${loop_var} galibTests${loop_var}.cxx)
        IF(UNIX)
                TARGET_LINK_LIBRARIES (galibTests${loop_var} m)
        ENDIF(UNIX)
        TARGET_LINK_LIBRARIES(galibTests${loop_var} otbgalib OTBIO OTBCommon)
ENDFOREACH(loop_var)


372
# Original 6S main executable in C
Thomas Feuvrier's avatar
Thomas Feuvrier committed
373
374
375
376
377
378
379
380
381
382
383
384
#     ADD_EXECUTABLE(otb6SMain 6SMainTest.cxx )
#     TARGET_LINK_LIBRARIES(otb6SMain OTBCommon ITKCommon otb6S)
#     IF(UNIX)
#         TARGET_LINK_LIBRARIES (otb6SMain m)
#     ENDIF(UNIX)

# OTB 6S main executable in C (call 6S main function.
#     ADD_EXECUTABLE(otb6SMainWithCallFunction 6SMainOtbWithCallFunctionTest.cxx )
#     TARGET_LINK_LIBRARIES(otb6SMainWithCallFunction OTBCommon ITKCommon otb6S)
#     IF(UNIX)
#         TARGET_LINK_LIBRARIES (otb6SMainWithCallFunction m)
#     ENDIF(UNIX)
385

386
387

ENDIF( NOT OTB_DISABLE_CXX_TESTING )