Tests: make ref files optional

This commit is contained in:
Shahram Najm 2015-03-20 19:10:26 +00:00
parent e1a39939da
commit e8e7365a5c
3 changed files with 9 additions and 8 deletions

View File

@ -16,7 +16,7 @@ REDIRECT=/dev/null
#Write the values into a file and compare with reference
$PYTHON bufr_read_header.py 2> $REDIRECT > $fRes
#We compare output to the reference by ignoring the whitespaces
#We compare output to the reference by ignoring the whitespaces
diff -w $fRef $fRes >$REDIRECT 2> $REDIRECT
cat $fRes

View File

@ -25,15 +25,14 @@ do
# Test descriptors: compare output of filter (res) with reference file (ref)
res_desc=$file.desc.test
ref_desc=$file.desc.ref
[ -f "$ref_desc" ]
diff_desc=$file.desc.diff
rm -f $res_desc
${tools_dir}bufr_filter bufrdc_desc_ref.filter $file 2> $REDIRECT > $res_desc
diff $ref_desc $res_desc > $diff_desc 2> $diff_desc
if [ -f "$ref_desc" ]; then
diff $ref_desc $res_desc > $diff_desc 2> $diff_desc
fi
rm -f $res_desc $diff_desc
done

View File

@ -30,9 +30,11 @@ do
${tools_dir}bufr_filter bufrdc_num_ref.filter $file 2> $REDIRECT > $res_num
# Cannot use plain diff. We need to compare FLOAT NUMBERS with a tolerance
perl number_compare.pl $ref_num $res_num >$REDIRECT 2> $REDIRECT
#numdiff $ref_num $res_num >$REDIRECT 2> $REDIRECT
if [ -f "$ref_num" ]; then
# Cannot use plain diff. We need to compare FLOAT NUMBERS with a tolerance
perl number_compare.pl $ref_num $res_num >$REDIRECT 2> $REDIRECT
#numdiff $ref_num $res_num >$REDIRECT 2> $REDIRECT
fi
done