Testing: Test for bufrTemplates concept

This commit is contained in:
Shahram Najm 2021-03-15 23:57:52 +00:00
parent a276066329
commit 9292bc7e9f
3 changed files with 28 additions and 0 deletions

View File

@ -87,6 +87,7 @@ if( HAVE_BUILD_TOOLS )
bufr_ecc-359
bufr_ecc-517
bufr_rdbSubTypes
bufr_templates
grib_efas
grib_sh_imag
grib_sh_spectral_complex

View File

@ -21,6 +21,7 @@ TESTS = definitions.sh \
bufr_get.sh \
bufr_ls.sh \
bufr_set.sh \
bufr_templates.sh \
bufr_change_edition.sh \
gts_ls.sh \
gts_compare.sh \

26
tests/bufr_templates.sh Executable file
View File

@ -0,0 +1,26 @@
#!/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.sh
set -u
label="bufr_templates_test"
temp=${label}.bufr
sample=$ECCODES_SAMPLES_PATH/BUFR4.tmpl
templates_file="${ECCODES_DEFINITION_PATH}/bufr/templates/BufrTemplate.def"
templates=`cat $templates_file | awk -F= '{print $1}' | tr -d '"'`
for t in $templates; do
${tools_dir}/bufr_set -s bufrTemplate=$t $sample $temp
${tools_dir}/bufr_dump -p $temp > /dev/null
done
rm -f $temp