Testing: More codes_count tests

This commit is contained in:
shahramn 2024-08-15 10:30:24 +01:00
parent 329bec63cd
commit 9235522326
1 changed files with 13 additions and 0 deletions

View File

@ -11,6 +11,7 @@
. ./include.ctest.sh
label="grib_count_test"
tempText=temp.$label.txt
grib_files=`cat ${data_dir}/grib_data_files.txt`
for file in ${grib_files}; do
@ -19,7 +20,16 @@ for file in ${grib_files}; do
${tools_dir}/grib_count $input
done
# Bad input
${tools_dir}/grib_count -f $data_dir/bad.grib
cat $data_dir/bad.grib | ${tools_dir}/grib_count -f -
set +e
${tools_dir}/grib_count $data_dir > $tempText 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "Is a directory" $tempText
# Specific files
count=`${tools_dir}/grib_count ${data_dir}/test.grib1`
@ -30,3 +40,6 @@ count=`${tools_dir}/grib_count ${data_dir}/mixed.grib`
count=`${tools_dir}/grib_count ${data_dir}/tigge_ecmwf.grib2`
[ $count -eq 248 ]
# Clean up
rm -f $tempText