File: CMakeLists.txt

package info (click to toggle)
eccodes 2.12.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 480,184 kB
  • sloc: ansic: 163,815; makefile: 21,266; sh: 8,507; python: 6,026; f90: 5,762; perl: 2,891; yacc: 818; lex: 356; cpp: 305; fortran: 116; awk: 66
file content (286 lines) | stat: -rw-r--r-- 8,605 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
147
148
149
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
# tests/CMakeLists.txt
#
# Configure the file which all CMake tests will include
configure_file( include.ctest.sh.in  include.ctest.sh @ONLY )

execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/include.sh ${CMAKE_CURRENT_BINARY_DIR} )
execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/utils.sh   ${CMAKE_CURRENT_BINARY_DIR} )
execute_process( COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/number_compare.pl ${CMAKE_CURRENT_BINARY_DIR} )

# Build the executables used by test scripts
################################################
list( APPEND test_bins
      grib_double_cmp
      read_any
      julian
      index
      multi_from_message
      read_index
      unit_tests
      bufr_keys_iter
      gauss_sub
      grib_util_set_spec
      grib_local_MeteoFrance
      grib_2nd_order_numValues
      optimize_scaling
      optimize_scaling_sh
      grib_ecc-386
      bufr_ecc-517
      bufr_get_element
      grib_sh_ieee64
      ieee
      grib_sh_imag
)

foreach( tool ${test_bins} )
    # here we use the fact that each tool has only one C file that matches its name
    ecbuild_add_executable( TARGET    ${tool}
                            NOINSTALL
                            SOURCES   ${tool}.c
                            LIBS      eccodes
    )
endforeach()

# Now add each test (shell scripts)
#################################################
# These tests do not require any data downloads
list( APPEND tests_no_data_reqd
    definitions
    grib_calendar
    unit_tests
    md5
    uerra
    grib_2nd_order_numValues
    julian
    bufr_dump_samples
    bufr_json_samples
    bufr_ecc-359
    bufr_ecc-517
    bufr_rdbSubTypes
    grib_efas
    grib_sh_imag
)
# These tests do require data downloads
list( APPEND tests_data_reqd
    grib_double_cmp
    grib_change_packing
    bufr_dump_data
    bufr_dump_decode_filter
    bufr_dump_encode_filter
    bufrdc_desc_ref
    bufrdc_ref
    bufr_compare
    bufr_copy
    bufr_count
    bufr_get
    bufr_filter
    bufr_filter_extract_datetime
    bufr_filter_extract_area
    bufr_json_data
    bufr_ls
    bufr_change_edition
    bufr_keys_iter
    bufr_get_element
    bufr_wmo_tables
    bufr_ecc-197
    bufr_ecc-286
    bufr_ecc-288
    bufr_ecc-313
    bufr_ecc-616
    bufr_ecc-686
    bufr_ecc-690
    bufr_ecc-379
    bufr_ecc-393
    bufr_ecc-433
    bufr_ecc-750
    bufr_ecc-875
    grib_ecc-490
    grib_ecc-756
    grib_ecc-873
    bufr_ecc-556
    gts_get
    gts_ls
    gts_compare
    metar_ls
    metar_get
    metar_dump
    metar_compare
    bufr_set
    ieee
    grib_sh_ieee64
    optimize_scaling
    optimize_scaling_sh
    grib1to2
    grib2to1
    grib1to3
    grib2to3
    grib3_templates
    badgrib
    grib_ls
    grib_filter
    grib_multi
    budg
    grib_gridType
    grib_octahedral
    grib_global
    grib_concept
    decimalPrecision
    grib_bitsPerValue
    get_fail
    missing
    grib_local
    grib_step
    grib_set
    grib_iterator
    grib_compare
    grib_copy
    grib_level
    index
    grib_bitmap
    list
    grib_second_order
    multi_from_message
    grib_change_scanning
    grib_statistics
    tigge
    read_any
    grib_dump
    grib_dump_debug
    grib_dump_json
    grib_local_MeteoFrance
    grib_neg_fctime
    codes_split_file
    grib_mars_types
)
if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
    list(APPEND tests_data_reqd bufr_dump_encode_fortran)
    list(APPEND tests_data_reqd bufr_dump_decode_fortran)
endif()
if( ENABLE_EXTRA_TESTS )
    list(APPEND tests_data_reqd grib_util_set_spec)
    list(APPEND tests_data_reqd grib_padding)
    list(APPEND tests_data_reqd tigge_conversions)
    list(APPEND tests_data_reqd bufr_dump_encode_C)
    list(APPEND tests_data_reqd bufr_dump_decode_C)
endif()

# These tests do not require any data downloads
foreach( test ${tests_no_data_reqd} )
    ecbuild_add_test( TARGET eccodes_t_${test}
                      TYPE SCRIPT
                      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
    )
endforeach()
ecbuild_add_test( TARGET eccodes_t_grib_check_gaussian_grids
                  TYPE SCRIPT
                  CONDITION ECCODES_INSTALL_EXTRA_TOOLS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_gaussian_grids.sh
)


# Note: making the test dependent on the grib files (with DEPENDS)
#       means they will be downloaded at "make" time
#       rather than when you do "ctest". Use TEST_DEPENDS instead
foreach( test ${tests_data_reqd} )
    ecbuild_add_test( TARGET eccodes_t_${test}
                  TYPE SCRIPT
                  CONDITION ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
                  RESOURCES asca_139.t1.ref
                  # TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs
                  # eccodes_download_bufrs eccodes_download_metars eccodes_download_gts
    )
endforeach()

if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
    set_tests_properties ( eccodes_t_bufr_dump_encode_fortran PROPERTIES TIMEOUT 2500)
endif()
if( ENABLE_EXTRA_TESTS )
    set_tests_properties ( eccodes_t_bufr_dump_encode_C PROPERTIES TIMEOUT 2500)
endif()


if( HAVE_PYTHON AND ENABLE_EXTRA_TESTS )
    list( APPEND ptests bufr_dump_encode_python bufr_dump_decode_python )
    foreach( test ${ptests} )
        ecbuild_add_test( TARGET eccodes_t_${test}
                          TYPE SCRIPT
                          COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
                          ENVIRONMENT PYTHON=${PYTHON_EXECUTABLE} PYTHONPATH=${PROJECT_BINARY_DIR}/${ECCODES_PYTHON_DIR}
                          # TEST_DEPENDS eccodes_download_bufrs
        )
    endforeach()
endif()

###########################################
# Note: the reference file is in the tests dir not data dir!
ecbuild_add_test( TARGET eccodes_t_lamb_az_eq_area
                  TYPE SCRIPT
                  CONDITION ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lamb_az_eq_area.sh
                  RESOURCES lamb_az_eq_area.ref
                  # TEST_DEPENDS eccodes_download_gribs
)

# These ones are conditional
###########################################
if( ENABLE_EXTRA_TESTS AND HAVE_ECCODES_THREADS )
    ecbuild_add_executable( TARGET    grib_encode_pthreads
                            NOINSTALL
                            SOURCES   grib_encode_pthreads.c
                            LIBS      eccodes
    )
    ecbuild_add_test( TARGET eccodes_t_grib_encode_pthreads
                      TYPE SCRIPT
                      COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_encode_pthreads.sh
    )
endif()

ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf
                  TYPE SCRIPT
                  CONDITION HAVE_NETCDF AND ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh
                  # TEST_DEPENDS eccodes_download_gribs
)

ecbuild_add_test( TARGET eccodes_t_grib_jpeg
                  TYPE SCRIPT
                  CONDITION HAVE_JPEG AND ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_jpeg.sh
                  # TEST_DEPENDS eccodes_download_gribs
)

ecbuild_add_test( TARGET eccodes_t_grib_png
                  TYPE SCRIPT
                  CONDITION HAVE_PNG AND ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_png.sh
                  # TEST_DEPENDS eccodes_download_gribs
)

ecbuild_add_test( TARGET eccodes_t_grib_ccsds
                  TYPE SCRIPT
                  CONDITION HAVE_AEC AND ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ccsds.sh
		  # TEST_DEPENDS eccodes_download_gribs
)

ecbuild_add_test( TARGET eccodes_t_grib_check_param_concepts
                  TYPE SCRIPT
                  CONDITION ENABLE_EXTRA_TESTS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_param_concepts.sh
)

ecbuild_add_test( TARGET eccodes_t_bufr_split_by_rdbSubtype
                  TYPE SCRIPT
                  CONDITION ENABLE_EXTRA_TESTS AND ECCODES_INSTALL_EXTRA_TOOLS
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_split_by_rdbSubtype.sh
                  # TEST_DEPENDS eccodes_download_bufrs
)

# Performance test. Must have -DENABLE_GRIB_TIMER=ON
ecbuild_add_test( TARGET eccodes_t_grib_ecc-386
                  TYPE SCRIPT
                  CONDITION ENABLE_EXTRA_TESTS AND ENABLE_GRIB_TIMER
                  COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_ecc-386.sh
                  # TEST_DEPENDS eccodes_download_gribs
)