eccodes/tests/CMakeLists.txt

103 lines
2.4 KiB
CMake
Raw Normal View History

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 )
# Build the executables used by test scripts
################################################
list( APPEND test_bins
read_any
julian
index
multi_from_message
read_index
unit_tests
gauss_sub
)
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
LIBS grib_api
)
endforeach()
# Now add each test
#################################################
2014-04-15 10:37:21 +00:00
list( APPEND tests
definitions
ieee
grib1to2
grib2to1
badgrib
ls
filter
multi
budg
gridType
concept
decimalPrecision
bitsPerValue
get_fail
missing
local
step
set
iterator
compare
level
index
bitmap
list
second_order
multi_from_message
change_scanning
julian
statistics
tigge
tigge_conversions
read_any
padding
debug
unit_tests
bufr_dump
2014-08-07 15:09:40 +00:00
bufrdc_ref
2014-04-15 10:37:21 +00:00
)
2014-06-18 16:14:01 +00:00
foreach( test ${tests} )
# Note: making the test dependent on the grib data files
# means they will be downloaded at "make" time
# rather than when you do "make test"
2014-04-15 10:37:21 +00:00
ecbuild_add_test( TARGET t_${test}
TYPE SCRIPT
2014-08-07 15:09:40 +00:00
DEPENDS get_gribs get_tigge_gribs get_bufrs
2014-04-15 10:37:21 +00:00
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/${test}.sh
2014-03-31 12:57:06 +00:00
RESOURCES include.sh
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
###########################################
# Note: the reference file is in the tests dir not data dir!
ecbuild_add_test( TARGET t_lamb_az_eq_area
TYPE SCRIPT
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/lamb_az_eq_area.sh
RESOURCES include.sh lamb_az_eq_area.ref
)
2014-04-15 10:37:21 +00:00
# These ones are conditional
2014-06-18 16:14:01 +00:00
ecbuild_add_test( TARGET t_grib_to_netcdf
2014-03-31 12:57:06 +00:00
TYPE SCRIPT
2014-06-18 16:14:01 +00:00
CONDITION ENABLE_NETCDF
2014-03-31 12:57:06 +00:00
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_to_netcdf.sh
RESOURCES include.sh
2014-06-18 16:14:01 +00:00
)
2014-03-31 12:57:06 +00:00
2014-06-18 16:14:01 +00:00
ecbuild_add_test( TARGET t_jpeg
TYPE SCRIPT
CONDITION ENABLE_JPG
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/jpeg.sh
RESOURCES include.sh
)