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

@ -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
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
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