Testing: GRIB2 product def templates

This commit is contained in:
shahramn 2024-10-14 17:05:47 +01:00
parent 87b73caa49
commit 45e9c8a38a
1 changed files with 19 additions and 1 deletions

View File

@ -8,7 +8,6 @@
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.ctest.sh
set -u
label="grib2_templates_test"
@ -32,6 +31,25 @@ awk '$1 !~ /#/ && $1 < 65000 {print $1}' $latest_codetable_file | while read pdt
fi
done
rm -f $tempText
pdtns=$( awk '!/^#/ && $1 < 65000 {print $1}' $latest_codetable_file )
for p in $pdtns; do
$tools_dir/grib_set -s tablesVersion=$latestOfficial,productDefinitionTemplateNumber=$p $sample2 $temp
$tools_dir/grib_dump -O -p section_4 $temp >> $tempText
# Expect the grep to fail and not find 'unknown' in the dump output
set +e
grep -q -i unknown $tempText
status=$?
set -e
if [ $status -ne 1 ]; then
echo "GRIB2 PDTN $p produced a dump with unknown!"
grep -i unknown $tempText
exit 1
fi
done
rm -f $tempText
# ECC-1746
# -------------
$tools_dir/grib_set -s tablesVersion=31,productDefinitionTemplateNumber=34 $sample2 $temp