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
|
|
|
|
################################################
|
|
|
|
list( APPEND test_bins
|
2016-04-08 13:01:09 +00:00
|
|
|
grib_double_cmp
|
2014-03-31 12:57:06 +00:00
|
|
|
read_any
|
|
|
|
julian
|
|
|
|
index
|
|
|
|
multi_from_message
|
|
|
|
read_index
|
|
|
|
unit_tests
|
|
|
|
gauss_sub
|
2015-07-21 13:24:02 +00:00
|
|
|
grib_util_set_spec
|
2016-05-20 18:15:36 +00:00
|
|
|
local_MeteoFrance
|
2016-05-25 10:19:31 +00:00
|
|
|
grib_2nd_order_numValues
|
2014-03-31 12:57:06 +00:00
|
|
|
)
|
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
|
2015-02-13 18:04:42 +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
|
|
|
#################################################
|
2015-03-12 18:21:52 +00:00
|
|
|
list( APPEND tests1
|
2014-04-15 10:37:21 +00:00
|
|
|
definitions
|
2014-11-13 16:47:32 +00:00
|
|
|
calendar
|
2015-03-12 18:21:52 +00:00
|
|
|
unit_tests
|
2016-01-12 17:05:05 +00:00
|
|
|
md5
|
2016-01-21 16:52:24 +00:00
|
|
|
uerra
|
2016-05-25 10:19:31 +00:00
|
|
|
grib_2nd_order_numValues
|
2015-03-12 18:21:52 +00:00
|
|
|
)
|
|
|
|
list( APPEND tests2
|
2016-04-08 13:01:09 +00:00
|
|
|
grib_double_cmp
|
2014-08-11 09:26:05 +00:00
|
|
|
bufr_dump
|
2016-09-13 10:14:54 +00:00
|
|
|
bufr_dump_decode_filter
|
2016-09-12 17:16:39 +00:00
|
|
|
bufr_dump_encode_filter
|
2014-11-04 13:59:20 +00:00
|
|
|
bufrdc_desc_ref
|
2014-08-11 09:26:05 +00:00
|
|
|
bufrdc_ref
|
2015-02-03 13:27:57 +00:00
|
|
|
bufr_compare
|
2015-02-03 10:06:03 +00:00
|
|
|
bufr_copy
|
2015-02-03 09:14:05 +00:00
|
|
|
bufr_count
|
2015-02-02 17:17:29 +00:00
|
|
|
bufr_get
|
2015-01-30 16:31:18 +00:00
|
|
|
bufr_filter
|
2016-08-04 17:33:22 +00:00
|
|
|
bufr_filter_extract_datetime
|
2016-08-04 16:49:19 +00:00
|
|
|
bufr_filter_extract_area
|
2015-01-07 16:08:48 +00:00
|
|
|
bufr_json
|
2015-01-22 09:25:57 +00:00
|
|
|
bufr_ls
|
2016-02-08 18:00:41 +00:00
|
|
|
bufr_change_edition
|
2015-12-22 16:53:02 +00:00
|
|
|
ecc-197
|
2016-07-04 16:18:59 +00:00
|
|
|
ecc-286
|
2016-07-05 14:44:55 +00:00
|
|
|
ecc-288
|
2016-04-04 13:27:04 +00:00
|
|
|
gts_get
|
2015-03-17 16:00:13 +00:00
|
|
|
gts_ls
|
2016-04-04 10:42:48 +00:00
|
|
|
gts_compare
|
2015-04-10 11:14:23 +00:00
|
|
|
metar_ls
|
2016-05-20 18:15:36 +00:00
|
|
|
metar_get
|
2015-04-10 11:14:23 +00:00
|
|
|
metar_dump
|
2016-04-04 12:35:11 +00:00
|
|
|
metar_compare
|
2015-02-02 15:16:32 +00:00
|
|
|
bufr_set
|
2014-04-15 10:37:21 +00:00
|
|
|
ieee
|
|
|
|
grib1to2
|
|
|
|
grib2to1
|
|
|
|
badgrib
|
|
|
|
ls
|
|
|
|
filter
|
|
|
|
multi
|
|
|
|
budg
|
|
|
|
gridType
|
2016-01-21 18:06:07 +00:00
|
|
|
octahedral
|
2016-01-13 11:49:15 +00:00
|
|
|
global
|
2014-04-15 10:37:21 +00:00
|
|
|
concept
|
|
|
|
decimalPrecision
|
|
|
|
bitsPerValue
|
|
|
|
get_fail
|
|
|
|
missing
|
|
|
|
local
|
|
|
|
step
|
|
|
|
set
|
|
|
|
iterator
|
2016-04-08 11:52:00 +00:00
|
|
|
grib_compare
|
2014-04-15 10:37:21 +00:00
|
|
|
level
|
|
|
|
index
|
|
|
|
bitmap
|
|
|
|
list
|
|
|
|
second_order
|
|
|
|
multi_from_message
|
|
|
|
change_scanning
|
|
|
|
julian
|
|
|
|
statistics
|
|
|
|
tigge
|
|
|
|
tigge_conversions
|
|
|
|
read_any
|
|
|
|
padding
|
2016-08-05 15:01:56 +00:00
|
|
|
grib_dump
|
|
|
|
grib_dump_debug
|
2015-07-21 13:24:02 +00:00
|
|
|
grib_util_set_spec
|
2016-05-20 18:15:36 +00:00
|
|
|
local_MeteoFrance
|
|
|
|
neg_fctime
|
2014-04-15 10:37:21 +00:00
|
|
|
)
|
2016-07-19 16:05:25 +00:00
|
|
|
if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
|
2016-09-12 17:16:39 +00:00
|
|
|
list(APPEND tests2 bufr_dump_encode_fortran)
|
2016-09-13 16:59:24 +00:00
|
|
|
list(APPEND tests2 bufr_dump_decode_fortran)
|
2016-07-19 16:05:25 +00:00
|
|
|
endif()
|
2016-09-01 17:52:33 +00:00
|
|
|
if( ENABLE_EXTRA_TESTS )
|
2016-09-12 17:16:39 +00:00
|
|
|
list(APPEND tests2 bufr_dump_encode_C)
|
2016-09-01 17:52:33 +00:00
|
|
|
endif()
|
2016-07-19 16:05:25 +00:00
|
|
|
|
2015-03-12 18:21:52 +00:00
|
|
|
# These tests do not require any data downloads
|
|
|
|
foreach( test ${tests1} )
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
2016-01-12 17:05:05 +00:00
|
|
|
TYPE SCRIPT
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
|
2015-03-12 18:21:52 +00:00
|
|
|
)
|
|
|
|
endforeach()
|
2015-09-25 16:09:27 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_check_gaussian_grids
|
|
|
|
TYPE SCRIPT
|
2015-10-21 16:31:19 +00:00
|
|
|
CONDITION ECCODES_INSTALL_EXTRA_TOOLS
|
2015-09-25 16:09:27 +00:00
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/check_gaussian_grids.sh
|
|
|
|
)
|
|
|
|
|
2015-03-12 18:21:52 +00:00
|
|
|
|
2015-03-10 15:52:33 +00:00
|
|
|
# Note: making the test dependent on the grib files (with DEPENDS)
|
|
|
|
# means they will be downloaded at "make" time
|
2016-05-25 09:40:07 +00:00
|
|
|
# rather than when you do "ctest". Use TEST_DEPENDS instead
|
2015-03-12 18:21:52 +00:00
|
|
|
foreach( test ${tests2} )
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_${test}
|
2014-04-15 10:37:21 +00:00
|
|
|
TYPE SCRIPT
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
|
2015-11-24 16:10:09 +00:00
|
|
|
RESOURCES asca_139.t1.ref
|
2016-03-29 10:16:29 +00:00
|
|
|
TEST_DEPENDS eccodes_download_gribs eccodes_download_tigge_gribs
|
|
|
|
eccodes_download_bufrs eccodes_download_metars eccodes_download_gts
|
2014-06-18 16:14:01 +00:00
|
|
|
)
|
2014-04-15 10:37:21 +00:00
|
|
|
endforeach()
|
2014-03-31 12:57:06 +00:00
|
|
|
|
2016-07-29 16:30:07 +00:00
|
|
|
if( HAVE_FORTRAN AND ENABLE_EXTRA_TESTS )
|
2016-09-12 17:16:39 +00:00
|
|
|
set_tests_properties ( eccodes_t_bufr_dump_encode_fortran PROPERTIES TIMEOUT 2500)
|
2016-07-29 16:30:07 +00:00
|
|
|
endif()
|
2016-09-01 17:52:33 +00:00
|
|
|
if( ENABLE_EXTRA_TESTS )
|
2016-09-12 17:16:39 +00:00
|
|
|
set_tests_properties ( eccodes_t_bufr_dump_encode_C PROPERTIES TIMEOUT 2500)
|
2016-09-01 17:52:33 +00:00
|
|
|
endif()
|
2016-07-29 16:30:07 +00:00
|
|
|
|
|
|
|
|
2016-08-02 10:43:42 +00:00
|
|
|
if( HAVE_PYTHON AND ENABLE_EXTRA_TESTS )
|
2016-09-12 17:16:39 +00:00
|
|
|
set(test bufr_dump_encode_python)
|
2016-08-02 10:43:42 +00:00
|
|
|
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
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2014-03-31 12:57:06 +00:00
|
|
|
###########################################
|
|
|
|
# Note: the reference file is in the tests dir not data dir!
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_lamb_az_eq_area
|
2014-03-31 12:57:06 +00:00
|
|
|
TYPE SCRIPT
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lamb_az_eq_area.sh
|
2015-07-02 12:02:54 +00:00
|
|
|
RESOURCES lamb_az_eq_area.ref
|
2016-03-29 10:16:29 +00:00
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
2014-03-31 12:57:06 +00:00
|
|
|
)
|
|
|
|
|
2014-04-15 10:37:21 +00:00
|
|
|
# These ones are conditional
|
2016-04-29 14:12:24 +00:00
|
|
|
###########################################
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_to_netcdf
|
2014-03-31 12:57:06 +00:00
|
|
|
TYPE SCRIPT
|
2014-10-24 12:36:19 +00:00
|
|
|
CONDITION HAVE_NETCDF
|
2014-03-31 12:57:06 +00:00
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh
|
2016-03-29 10:16:29 +00:00
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
2014-06-18 16:14:01 +00:00
|
|
|
)
|
2014-03-31 12:57:06 +00:00
|
|
|
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_jpeg
|
2014-06-18 16:14:01 +00:00
|
|
|
TYPE SCRIPT
|
2014-10-24 12:36:19 +00:00
|
|
|
CONDITION HAVE_JPEG
|
2014-06-18 16:14:01 +00:00
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jpeg.sh
|
2016-03-29 10:16:29 +00:00
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
2014-06-18 16:14:01 +00:00
|
|
|
)
|
2014-08-28 09:11:51 +00:00
|
|
|
|
2016-04-29 14:12:24 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_png
|
|
|
|
TYPE SCRIPT
|
|
|
|
CONDITION HAVE_PNG
|
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_png.sh
|
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
|
|
|
)
|
|
|
|
|
2015-07-14 16:11:57 +00:00
|
|
|
ecbuild_add_test( TARGET eccodes_t_ccsds
|
2014-08-28 09:11:51 +00:00
|
|
|
TYPE SCRIPT
|
2014-10-24 12:36:19 +00:00
|
|
|
CONDITION HAVE_AEC
|
2014-08-28 09:11:51 +00:00
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/ccsds.sh
|
2016-03-29 10:16:29 +00:00
|
|
|
TEST_DEPENDS eccodes_download_gribs
|
2014-08-28 09:11:51 +00:00
|
|
|
)
|
2016-05-04 15:04:21 +00:00
|
|
|
|
|
|
|
ecbuild_add_test( TARGET eccodes_t_grib_check_param_concepts
|
|
|
|
TYPE SCRIPT
|
2016-05-05 15:23:46 +00:00
|
|
|
CONDITION ENABLE_EXTRA_TESTS
|
2016-05-04 15:04:21 +00:00
|
|
|
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_param_concepts.sh
|
|
|
|
)
|
2016-03-14 09:02:31 +00:00
|
|
|
|