Testing: test must not pass if no data got downloaded

This commit is contained in:
Shahram Najm 2017-12-18 17:11:42 +00:00
parent b8325464a3
commit d0d2832193
7 changed files with 33 additions and 32 deletions

View File

@ -9,11 +9,12 @@
. ./include.sh
if [ ! -f "${data_dir}/sample.grib2" ]
then
echo SKIP: $0
exit
fi
#if [ ! -f "${data_dir}/sample.grib2" ]
#then
# echo SKIP: $0
# exit
#fi
${examples_dir}/c_grib_multi_write ${data_dir}/sample.grib2 ${data_dir}/multi_sample.grib2 > /dev/null
${tools_dir}/grib_get -p step ${data_dir}/multi_sample.grib2 > ${data_dir}/multi_step.test
@ -24,6 +25,4 @@ step=`${tools_dir}/grib_get -M -p step ${data_dir}/multi_sample.grib2`
[ $step -eq 12 ]
rm -f ${data_dir}/multi_sample.grib2 ${data_dir}/multi_step.test | true
rm -f ${data_dir}/multi_sample.grib2 ${data_dir}/multi_step.test

View File

@ -9,6 +9,8 @@
. ./include.sh
${examples_dir}/c_grib_print_data ../../data/constant_field.grib1 >/dev/null
numberOfValues=`${examples_dir}/c_grib_print_data ../../data/constant_field.grib1 | grep values | awk '{print $1}'`
if [ $numberOfValues -ne 99200 ]
@ -16,5 +18,3 @@ then
echo ERROR: wrong number of values
exit 1;
fi

View File

@ -12,11 +12,14 @@
REDIRECT=/dev/null
set +e
# Check input file has been downloaded
[ -f ${data_dir}/regular_latlon_surface.grib1 ]
# Expect failure as the key does not exist
set +e
${tools_dir}/grib_get -p gribname ${data_dir}/regular_latlon_surface.grib1 2> $REDIRECT > $REDIRECT
if [ $? -eq 0 ]
then
if [ $? -eq 0 ] ; then
# Should not have succeeded
exit 1;
fi

View File

@ -52,10 +52,9 @@ do
for f in $grib_files
do
rm -f $tmp_netcdf
if [ -f "${data_dir}/$f" ]; then
${tools_dir}/grib_to_netcdf -D $dt -o $tmp_netcdf ${data_dir}/$f >/dev/null
${tools_dir}/grib_to_netcdf -T -o $tmp_netcdf ${data_dir}/$f >/dev/null
fi
[ -f ${data_dir}/$f ]
${tools_dir}/grib_to_netcdf -D $dt -o $tmp_netcdf ${data_dir}/$f >/dev/null
${tools_dir}/grib_to_netcdf -T -o $tmp_netcdf ${data_dir}/$f >/dev/null
done
done

View File

@ -13,11 +13,11 @@
. ./include.sh
infile=${data_dir}/index.grib
if [ ! -f ${infile} ]
then
echo no data to test
exit 0
fi
#if [ ! -f ${infile} ]
#then
# echo no data to test
# exit 0
#fi
${test_dir}/index ${infile} > index.out

View File

@ -16,11 +16,11 @@ out2=${data_dir}/multi2.out
for infile in ${data_dir}/multi.grib2 ${data_dir}/reduced_gaussian_model_level.grib1
do
if [ ! -f ${infile} ]
then
echo no data to test
exit 0
fi
#if [ ! -f ${infile} ]
#then
# echo no data to test
# exit 0
#fi
${test_dir}/multi_from_message -m $infile > $out1
${tools_dir}/grib_get -p count,shortName,level $infile > $out2

View File

@ -13,11 +13,11 @@
infile=${data_dir}/mixed.grib
outfile=${data_dir}/read_any.out
if [ ! -f ${infile} ]
then
echo no data to test
exit 0
fi
#if [ ! -f ${infile} ]
#then
# echo no data to test
# exit 0
#fi
$test_dir/read_any $infile > ${outfile}