Testing: MARS keys

This commit is contained in:
Shahram Najm 2023-07-22 21:58:35 +01:00
parent 3cd9b6a378
commit 958efbe33d
3 changed files with 35 additions and 2 deletions

View File

@ -288,7 +288,8 @@ if( HAVE_BUILD_TOOLS )
grib_local_NCEP
grib_neg_fctime
codes_split_file
grib_mars_keys)
grib_mars_keys1
grib_mars_keys2)
if( HAVE_AEC AND ENABLE_EXTRA_TESTS )
list(APPEND tests_extra grib_ecc-1431)

View File

@ -10,7 +10,7 @@
. ./include.ctest.sh
label="grib_mars_keys_test"
label="grib_mars_keys1_test"
tempOut=temp.${label}.out
tempGrib=temp.${label}.grib
tempRef=temp.${label}.ref

32
tests/grib_mars_keys2.sh Executable file
View File

@ -0,0 +1,32 @@
#!/bin/sh
# (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.ctest.sh
label="grib_mars_keys2_test"
tempGrib=temp.${label}.grib
grib2_sample=$ECCODES_SAMPLES_PATH/reduced_gg_pl_32_grib2.tmpl
# Check all combinations
# ------------------------
for cfg in $ECCODES_DEFINITION_PATH/mars/grib.*.def; do
b=$(basename $cfg)
num=$(echo $b | awk -F. '{print NF}')
if [ $num -eq 4 ]; then
# Each file should be of the form grib.$stream.$type.def
stream=$(echo $b | awk -F. '{print $2}')
type=$(echo $b | awk -F. '{print $3}')
${tools_dir}/grib_set -s stream=$stream,type=$type $grib2_sample $tempGrib
${tools_dir}/grib_ls -m $tempGrib
fi
done
rm -f $tempGrib