2014-03-31 12:57:06 +00:00
|
|
|
# tests/CMakeLists.txt
|
|
|
|
#
|
|
|
|
# Configure the file which all CMake tests will include
|
|
|
|
configure_file( include.ctest.sh.in include.ctest.sh @ONLY )
|
|
|
|
|
2015-07-02 12:02:54 +00:00
|
|
|
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} )
|
|
|
|
|
2014-03-31 12:57:06 +00:00
|
|
|
# Build the executables used by test scripts
|
|
|
|
################################################
|
2020-07-31 14:07:35 +00:00
|
|
|
list(APPEND test_bins
|
|
|
|
grib_bpv_limit
|
|
|
|
grib_double_cmp
|
|
|
|
read_any
|
|
|
|
julian
|
|
|
|
grib_indexing
|
|
|
|
grib_multi_from_message
|
|
|
|
grib_read_index
|
|
|
|
unit_tests
|
|
|
|
bufr_keys_iter
|
|
|
|
gauss_sub
|
|
|
|
grib_nearest_test
|
|
|
|
grib_util_set_spec
|
|
|
|
grib_local_MeteoFrance
|
|
|
|
grib_2nd_order_numValues
|
|
|
|
grib_optimize_scaling
|
|
|
|
grib_optimize_scaling_sh
|
|
|
|
grib_ecc-386
|
|
|
|
bufr_ecc-517
|
|
|
|
bufr_get_element
|
|
|
|
bufr_extract_headers
|
|
|
|
bufr_check_descriptors
|
|
|
|
grib_sh_ieee64
|
|
|
|
ieee
|
|
|
|
grib_sh_imag
|
|
|
|
grib_lam_bf
|
|
|
|
grib_lam_gp)
|
2014-06-18 16:14:01 +00:00
|
|
|
|
2014-03-31 12:57:06 +00:00
|
|
|
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
|
2020-03-30 13:07:31 +00:00
|
|
|
LIBS eccodes )
|
2014-03-31 12:57:06 +00:00
|
|
|
endforeach()
|
|
|
|
|
2015-01-24 19:00:15 +00:00
|
|
|
# Now add each test (shell scripts)
|
2014-03-31 12:57:06 +00:00
|
|
|
#################################################
|
2020-08-07 21:36:59 +00:00
|
|
|
if( HAVE_BUILD_TOOLS )
|
2016-07-19 16:05:25 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# These tests do not require any data downloads
|
|
|
|
list(APPEND tests_no_data_reqd
|
|
|
|
unit_tests
|
|
|
|
julian
|
|
|
|
grib_dump_samples
|
|
|
|
bufr_dump_samples
|
|
|
|
bufr_check_descriptors
|
|
|
|
definitions
|
|
|
|
grib_calendar
|
|
|
|
grib_md5
|
|
|
|
filter_substr
|
|
|
|
grib_uerra
|
|
|
|
grib_2nd_order_numValues
|
|
|
|
grib_ecc-136
|
|
|
|
grib_ecc-967
|
|
|
|
grib_ecc-1065
|
|
|
|
grib_ecc-1053
|
|
|
|
bufr_json_samples
|
|
|
|
bufr_ecc-359
|
|
|
|
bufr_ecc-517
|
|
|
|
bufr_rdbSubTypes
|
|
|
|
grib_efas
|
|
|
|
grib_sh_imag
|
|
|
|
pseudo_diag
|
|
|
|
grib_grid_unstructured
|
|
|
|
grib_grid_lambert_conformal
|
|
|
|
grib_grid_polar_stereographic
|
|
|
|
grib_grid_space_view
|
|
|
|
grib_g1fcperiod)
|
2015-09-25 16:09:27 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# These tests do require data downloads
|
|
|
|
list(APPEND tests_data_reqd
|
|
|
|
grib_data_quality_checks
|
|
|
|
grib_bpv_limit
|
|
|
|
grib_complex
|
|
|
|
grib_double_cmp
|
|
|
|
grib_change_packing
|
|
|
|
bufr_dump_data
|
|
|
|
bufr_dump_descriptors
|
|
|
|
bufr_dump_subset
|
|
|
|
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_ls_json
|
|
|
|
bufr_change_edition
|
|
|
|
bufr_keys_iter
|
|
|
|
bufr_get_element
|
|
|
|
bufr_wmo_tables
|
|
|
|
bufr_extract_headers
|
|
|
|
bufr_ecc-673
|
|
|
|
bufr_ecc-428
|
|
|
|
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-765
|
|
|
|
bufr_ecc-875
|
|
|
|
bufr_ecc-887
|
|
|
|
grib_ecc-490
|
|
|
|
grib_ecc-756
|
|
|
|
grib_ecc-873
|
|
|
|
grib_ecc-600
|
|
|
|
grib_ecc-923
|
|
|
|
grib_ecc-979
|
|
|
|
grib_ecc-984
|
|
|
|
grib_ecc-1000
|
|
|
|
grib_ecc-1001
|
|
|
|
grib_ecc-1030
|
|
|
|
bufr_ecc-556
|
|
|
|
gts_get
|
|
|
|
gts_ls
|
|
|
|
gts_count
|
|
|
|
gts_compare
|
|
|
|
metar_ls
|
|
|
|
metar_get
|
|
|
|
metar_dump
|
|
|
|
metar_compare
|
|
|
|
bufr_set
|
|
|
|
ieee
|
|
|
|
grib_sh_ieee64
|
|
|
|
grib_optimize_scaling
|
|
|
|
grib_optimize_scaling_sh
|
|
|
|
grib_lam_bf
|
|
|
|
grib_lam_gp
|
|
|
|
grib1to2
|
|
|
|
grib2to1
|
|
|
|
grib1to3
|
|
|
|
grib2to3
|
|
|
|
grib3_templates
|
|
|
|
badgrib
|
|
|
|
grib_ls
|
|
|
|
grib_ls_json
|
|
|
|
grib_filter
|
|
|
|
grib_multi
|
|
|
|
grib_nearest_test
|
|
|
|
pseudo_budg
|
|
|
|
grib_gridType
|
|
|
|
grib_octahedral
|
|
|
|
grib_grid_mercator
|
|
|
|
grib_global
|
|
|
|
grib_concept
|
|
|
|
grib_decimalPrecision
|
|
|
|
grib_bitsPerValue
|
|
|
|
grib_get_fail
|
|
|
|
grib_missing
|
|
|
|
grib_local
|
|
|
|
grib_step
|
|
|
|
grib_set
|
|
|
|
grib_iterator
|
|
|
|
grib_proj_string
|
|
|
|
grib_compare
|
|
|
|
grib_copy
|
|
|
|
grib_level
|
|
|
|
grib_indexing
|
|
|
|
grib_bitmap
|
|
|
|
grib_list
|
|
|
|
grib_second_order
|
|
|
|
grib_multi_from_message
|
|
|
|
grib_change_scanning
|
|
|
|
grib_statistics
|
|
|
|
grib_tigge
|
|
|
|
read_any
|
|
|
|
grib_dump
|
|
|
|
grib_dump_debug
|
|
|
|
grib_dump_json
|
|
|
|
grib_local_MeteoFrance
|
|
|
|
grib_neg_fctime
|
|
|
|
codes_split_file
|
|
|
|
grib_mars_types)
|
2015-03-12 18:21:52 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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 grib_tigge_conversions)
|
|
|
|
list(APPEND tests_data_reqd bufr_dump_encode_C)
|
|
|
|
list(APPEND tests_data_reqd bufr_dump_decode_C)
|
|
|
|
endif()
|
2014-03-31 12:57:06 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# These tests do not require any data downloads
|
|
|
|
foreach( test ${tests_no_data_reqd} )
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
|
|
|
TYPE SCRIPT
|
|
|
|
LABELS "sanity"
|
|
|
|
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 )
|
2016-07-29 16:30:07 +00:00
|
|
|
|
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# 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} )
|
2016-09-14 10:54:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
2020-08-07 21:36:59 +00:00
|
|
|
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 )
|
2016-09-14 10:54:57 +00:00
|
|
|
endforeach()
|
2016-08-02 10:43:42 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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()
|
2014-03-31 12:57:06 +00:00
|
|
|
|
2019-12-11 12:55:32 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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}/python
|
|
|
|
TEST_DEPENDS eccodes_download_bufrs )
|
|
|
|
endforeach()
|
|
|
|
endif()
|
2019-12-11 15:11:19 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
###########################################
|
|
|
|
# Note: the reference file is in the tests dir not data dir!
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_grid_lamb_az_eq_area
|
2017-09-01 14:47:21 +00:00
|
|
|
TYPE SCRIPT
|
2020-08-07 21:36:59 +00:00
|
|
|
CONDITION ENABLE_EXTRA_TESTS
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_grid_lamb_az_eq_area.sh
|
|
|
|
RESOURCES grib_lamb_az_eq_area.ref
|
|
|
|
TEST_DEPENDS eccodes_download_gribs )
|
2018-05-08 13:11:01 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# These ones are conditional
|
|
|
|
###########################################
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_tools_data_from_stdin
|
|
|
|
TYPE SCRIPT
|
|
|
|
CONDITION NOT ECCODES_ON_WINDOWS AND ENABLE_EXTRA_TESTS
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/tools_data_from_stdin.sh
|
|
|
|
TEST_DEPENDS eccodes_download_bufrs )
|
|
|
|
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_bufr_ecc-197
|
|
|
|
TYPE SCRIPT
|
|
|
|
CONDITION NOT ECCODES_ON_WINDOWS AND ENABLE_EXTRA_TESTS
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_ecc-197.sh
|
|
|
|
TEST_DEPENDS eccodes_download_bufrs )
|
|
|
|
|
|
|
|
if( ENABLE_EXTRA_TESTS AND HAVE_ECCODES_THREADS )
|
|
|
|
ecbuild_add_executable( TARGET grib_encode_pthreads
|
2018-05-08 16:11:45 +00:00
|
|
|
NOINSTALL
|
2020-08-07 21:36:59 +00:00
|
|
|
SOURCES grib_encode_pthreads.c
|
2020-08-19 16:06:56 +00:00
|
|
|
LIBS eccodes ${CMAKE_THREAD_LIBS_INIT} )
|
2020-08-07 21:36:59 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_encode_pthreads
|
|
|
|
TYPE SCRIPT
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_encode_pthreads.sh )
|
|
|
|
|
|
|
|
foreach( test grib_threads_ecc-604 grib_threads_ecc-604-encode bufr_threads_ecc-604 )
|
|
|
|
ecbuild_add_executable( TARGET ${test}
|
|
|
|
NOINSTALL
|
|
|
|
SOURCES ${test}.c
|
2020-08-19 16:06:56 +00:00
|
|
|
LIBS eccodes ${CMAKE_THREAD_LIBS_INIT} )
|
2020-08-07 21:36:59 +00:00
|
|
|
endforeach()
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_threads_ecc-604
|
|
|
|
TYPE SCRIPT
|
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_threads_ecc-604.sh )
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_bufr_threads_ecc-604
|
|
|
|
TYPE SCRIPT
|
|
|
|
TEST_DEPENDS eccodes_download_bufrs
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/bufr_threads_ecc-604.sh )
|
|
|
|
endif()
|
|
|
|
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf
|
2018-04-25 12:58:19 +00:00
|
|
|
TYPE SCRIPT
|
2020-08-07 21:36:59 +00:00
|
|
|
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
|
2018-07-27 16:40:13 +00:00
|
|
|
TYPE SCRIPT
|
2020-08-07 21:36:59 +00:00
|
|
|
CONDITION HAVE_JPEG AND ENABLE_EXTRA_TESTS
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_jpeg.sh
|
|
|
|
TEST_DEPENDS eccodes_download_gribs )
|
2017-09-01 14:47:21 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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 )
|
2014-03-31 12:57:06 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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 )
|
2014-08-28 09:11:51 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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 )
|
2016-04-29 14:12:24 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
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 )
|
2016-05-04 15:04:21 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
# 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 )
|
|
|
|
else()
|
2020-08-08 12:07:16 +00:00
|
|
|
# No command line tools
|
2020-08-07 21:36:59 +00:00
|
|
|
list(APPEND tests_no_tools
|
|
|
|
unit_tests
|
|
|
|
julian
|
|
|
|
bufr_check_descriptors
|
|
|
|
grib_sh_imag
|
|
|
|
grib_2nd_order_numValues
|
2020-08-08 12:07:16 +00:00
|
|
|
grib_sh_ieee64)
|
2018-08-23 16:18:34 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
foreach( test ${tests_no_tools} )
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
|
|
|
TYPE SCRIPT
|
|
|
|
LABELS "sanity"
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh )
|
|
|
|
endforeach()
|
2018-08-23 16:18:34 +00:00
|
|
|
|
2020-08-07 21:36:59 +00:00
|
|
|
endif()
|