mirror of https://github.com/ecmwf/eccodes.git
Tests: clean up and remove unnecessary redirection to /dev/null
This commit is contained in:
parent
853d7b6f94
commit
e072d9ca9f
|
@ -2,12 +2,10 @@
|
|||
|
||||
. ./include.sh
|
||||
|
||||
REDIRECT=/dev/null
|
||||
|
||||
INPUT=${data_dir}/tigge_pf_ecmwf.grib2
|
||||
OUTPUT=out.grib
|
||||
|
||||
$PYTHON binary_message.py $INPUT $OUTPUT 2> $REDIRECT > $REDIRECT
|
||||
$PYTHON binary_message.py $INPUT $OUTPUT
|
||||
${tools_dir}/grib_compare $INPUT $OUTPUT
|
||||
rm $OUTPUT || true
|
||||
|
||||
|
@ -15,7 +13,7 @@ rm $OUTPUT || true
|
|||
# We are expecting the command to fail so must turn off "set -e"
|
||||
INPUT=${data_dir}/bad.grib
|
||||
set +e
|
||||
$PYTHON binary_message.py $INPUT $OUTPUT 2> $REDIRECT > $REDIRECT
|
||||
$PYTHON binary_message.py $INPUT $OUTPUT
|
||||
status=$?
|
||||
set -e
|
||||
# Check command did indeed fail
|
||||
|
|
|
@ -31,4 +31,5 @@ $PYTHON bufr_attributes.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -39,6 +39,5 @@ fi
|
|||
set -e
|
||||
|
||||
#Clean up
|
||||
rm -f ${fBufrTmp} | true
|
||||
|
||||
rm -f ${fBufrTmp}
|
||||
|
||||
|
|
|
@ -39,3 +39,4 @@ $PYTHON bufr_expanded.py >$fTmp 2> $REDIRECT
|
|||
|
||||
#Clean up
|
||||
rm -f ${fTmp}
|
||||
|
||||
|
|
|
@ -31,4 +31,5 @@ $PYTHON bufr_get_keys.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -30,4 +30,5 @@ $PYTHON bufr_keys_iterator.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ REDIRECT=/dev/null
|
|||
$PYTHON bufr_read_header.py 2> $REDIRECT > $fRes
|
||||
|
||||
#We compare output to the reference by ignoring the whitespaces
|
||||
diff -w $fRef $fRes >$REDIRECT 2> $REDIRECT
|
||||
diff -w $fRef $fRes
|
||||
|
||||
#cat $fRes
|
||||
|
||||
|
|
|
@ -31,4 +31,5 @@ $PYTHON bufr_read_scatterometer.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -31,4 +31,5 @@ $PYTHON bufr_read_synop.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -31,4 +31,5 @@ $PYTHON bufr_read_temp.py 2> $REDIRECT > $fTmp
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -32,4 +32,5 @@ $PYTHON bufr_read_tropical_cyclone.py
|
|||
#cat $fTmp
|
||||
|
||||
#Clean up
|
||||
rm -f $fTmp | true
|
||||
rm -f $fTmp
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ $PYTHON bufr_set_keys.py 2> $REDIRECT > $REDIRECT
|
|||
|
||||
#Compare modified to the original
|
||||
set +e
|
||||
${tools_dir}/bufr_compare $f $fBufrTmp >$REDIRECT 2> $REDIRECT
|
||||
${tools_dir}/bufr_compare $f $fBufrTmp
|
||||
|
||||
#Check if modified is different
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -42,5 +42,5 @@ set -e
|
|||
[ `${tools_dir}bufr_count $f` -eq `${tools_dir}/bufr_count ${fBufrTmp}` ]
|
||||
|
||||
#Clean up
|
||||
rm -f $fBufrTmp | true
|
||||
rm -f $fBufrTmp
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ ${tools_dir}/bufr_compare -r ${fBufrInput1} ${fBufrInput2}>> $fLog
|
|||
#----------------------------------------------------
|
||||
${tools_dir}bufr_set -s subCentre=12 aaen_55.bufr $fBufrTmp
|
||||
set +e
|
||||
${tools_dir}bufr_compare aaen_55.bufr $fBufrTmp >/dev/null
|
||||
${tools_dir}bufr_compare aaen_55.bufr $fBufrTmp
|
||||
status=$?
|
||||
set -e
|
||||
[ $status -eq 1 ]
|
||||
|
|
|
@ -30,7 +30,7 @@ REDIRECT=/dev/null
|
|||
|
||||
for file in ${bufr_files}
|
||||
do
|
||||
${tools_dir}bufr_dump -O ${data_dir}/bufr/$file 2> $REDIRECT > $REDIRECT
|
||||
${tools_dir}bufr_dump -O ${data_dir}/bufr/$file
|
||||
done
|
||||
|
||||
#==============================================
|
||||
|
@ -46,7 +46,7 @@ fJsonRef=${data_dir}/bufr/"bad.bufr.json.ref"
|
|||
|
||||
${tools_dir}bufr_dump -js $fBufr > $fJsonTmp
|
||||
|
||||
diff $fJsonTmp $fJsonRef >$REDIRECT 2> $REDIRECT
|
||||
diff $fJsonTmp $fJsonRef
|
||||
|
||||
#==============================================
|
||||
# Testing change of scale (see ECC-111)
|
||||
|
@ -61,7 +61,7 @@ fJsonRef=${data_dir}/bufr/"207003.bufr.json.ref"
|
|||
|
||||
${tools_dir}bufr_dump -ja $fBufr > $fJsonTmp
|
||||
|
||||
diff $fJsonTmp $fJsonRef >$REDIRECT 2> $REDIRECT
|
||||
diff $fJsonTmp $fJsonRef
|
||||
|
||||
#Clean up
|
||||
rm -f $fLog
|
||||
|
|
|
@ -38,7 +38,6 @@ f="aaen_55.bufr"
|
|||
|
||||
#The reference is the same as for ls
|
||||
ref_get=$f".ls.ref"
|
||||
REDIRECT=/dev/null
|
||||
|
||||
echo "Test: -p switch" >> $fLog
|
||||
echo "file: $f" >> $fLog
|
||||
|
@ -46,7 +45,7 @@ ${tools_dir}/bufr_get -p totalLength,bufrHeaderCentre,bufrHeaderSubCentre,master
|
|||
|
||||
#Write the values into a file and compare with ref
|
||||
cat $fTmp | awk '{split($0,a," "); for (i=1; i<=8; i++) print a[i]}' > $res_get
|
||||
diff $ref_get $res_get >$REDIRECT 2> $REDIRECT
|
||||
diff $ref_get $res_get
|
||||
|
||||
#Clean up
|
||||
rm -f $fLog
|
||||
|
|
|
@ -46,7 +46,7 @@ ${tools_dir}/bufr_ls -p totalLength,bufrHeaderCentre,bufrHeaderSubCentre,masterT
|
|||
|
||||
#Write the values into a file and compare with ref
|
||||
awk NR==3 $fTmp | awk '{split($0,a," "); for (i=1; i<=8; i++) print a[i]}' > $res_ls
|
||||
diff $ref_ls $res_ls >$REDIRECT 2> $REDIRECT
|
||||
diff $ref_ls $res_ls
|
||||
|
||||
rm -f $fLog $res_ls
|
||||
rm -f $fTmp
|
||||
|
|
|
@ -20,7 +20,6 @@ bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
|
|||
for bf in ${bufr_files}
|
||||
do
|
||||
file=${data_dir}/bufr/$bf
|
||||
REDIRECT=/dev/null
|
||||
|
||||
# Test descriptors: compare output of filter (res) with reference file (ref)
|
||||
res_desc=$file.desc.test
|
||||
|
|
Loading…
Reference in New Issue