Tools: Increase coverage

This commit is contained in:
Shahram Najm 2024-01-20 14:09:25 +00:00
parent 2be9319973
commit ecf1f5ec86
2 changed files with 38 additions and 13 deletions

View File

@ -15,7 +15,17 @@ tempText=temp.$label.txt
tempGoodGribs=temp.$label.good.grib
tempBadGribs=temp.$label.bad.grib
if [ -e "${tools_dir}/grib_repair" ]; then
if [ ! -e "${tools_dir}/grib_repair" ]; then
exit 0
fi
set +e
${tools_dir}/grib_repair
status=$?
set -e
[ $status -ne 0 ]
export ECCODES_GRIB_REPAIR_MAX_NUM_MESSAGES=3
${tools_dir}/grib_repair $data_dir/bad.grib $tempGoodGribs $tempBadGribs > $tempText 2>&1
grep -q "Wrong message length" $tempText
@ -28,7 +38,7 @@ if [ -e "${tools_dir}/grib_repair" ]; then
${tools_dir}/grib_ls $tempGoodGribs
${tools_dir}/grib_ls $tempBadGribs
fi
# Clean up
rm -f $tempText $tempGoodGribs $tempBadGribs

View File

@ -31,6 +31,12 @@ echo "Test: comparing the same files" >> $fLog
echo "file: $gts_file" >> $fLog
${tools_dir}/gts_compare $gts_file $gts_file
#----------------------------------------------------
# Test: comparing with skip
#----------------------------------------------------
gts_file="EGRR20150317121020_00493212.DAT"
${tools_dir}/gts_compare -w TT=SA $gts_file $gts_file
#----------------------------------------------------
# Test: comparing two different files
#----------------------------------------------------
@ -99,6 +105,15 @@ cp $gts_file $tempDir
${tools_dir}/gts_compare $gts_file $tempDir
rm -r $tempDir
# Options
set +e
${tools_dir}/gts_compare -a $gts_file $gts_file > $fLog 2>&1
status=$?
set -e
[ $status -ne 0 ]
grep -q "option requires" $fLog
# Non-existence
set +e
${tools_dir}/gts_compare non-exist1 non-exist2 > $fLog 2>&1