Rationalize tests: download grib data, clean up etc

This commit is contained in:
Shahram Najm 2014-04-24 15:00:03 +01:00
parent 08c6fa4b0f
commit bf875501ad
9 changed files with 374 additions and 4 deletions

View File

@ -367,6 +367,7 @@ EXTRA_DIST = README AUTHORS NOTICE LICENSE ChangeLog version.sh html \
data/read_any.ok \
data/simple_bitmap.grib \
data/second_ord_rbr.grib1 \
data/download.sh \
perf/jmeter.awk \
perf/time.sh \
windows/msvc/grib_api.sln \

View File

@ -79,7 +79,6 @@ set(files_to_download
sst_globus0083.grib
test.grib1
test_uuid.grib2
tigge
tigge_af_ecmwf.grib2
tigge_cf_ecmwf.grib2
tigge_ecmwf.grib2

350
data/download.sh Executable file
View File

@ -0,0 +1,350 @@
#!/bin/sh
DATA_DIR=$1
# Check if all downloads are already done
DOWNLOADED=${DATA_DIR}/.downloaded
if [ -f $DOWNLOADED ]; then
exit 0
fi
files="
bad.grib
budg
constant_field.grib1
constant_width_bitmap.grib
constant_width_boust_bitmap.grib
gen.grib
gen_bitmap.grib
gen_ext_bitmap.grib
gen_ext_boust_bitmap.grib
gen_ext_boust.grib
gen_ext.grib
gen_ext_spd_2_bitmap.grib
gen_ext_spd_2_boust_bitmap.grib
gen_ext_spd_2.grib
gen_ext_spd_3_boust_bitmap.grib
gen_ext_spd_3.grib
gep10.t12z.pgrb2af78.grib2
gfs.c255.grib2
gts.grib
index.grib
jpeg.grib2
lfpw.grib1
lfpw.grib2
missing_field.grib1
missing.grib2
mixed.grib
multi_created.grib2
multi.grib2
pad.grib
reduced_gaussian_lsm.grib1
reduced_gaussian_model_level.grib1
reduced_gaussian_model_level.grib2
reduced_gaussian_pressure_level_constant.grib1
reduced_gaussian_pressure_level_constant.grib2
reduced_gaussian_pressure_level.grib1
reduced_gaussian_pressure_level.grib2
reduced_gaussian_sub_area.grib1
reduced_gaussian_sub_area.grib2
reduced_gaussian_surface.grib1
reduced_gaussian_surface.grib2
reduced_gaussian_surface_jpeg.grib2
reduced_latlon_surface_constant.grib1
reduced_latlon_surface_constant.grib2
reduced_latlon_surface.grib1
reduced_latlon_surface.grib2
reference_ensemble_mean.grib1
reference_stdev.grib1
regular_gaussian_model_level.grib1
regular_gaussian_model_level.grib2
regular_gaussian_pressure_level_constant.grib1
regular_gaussian_pressure_level_constant.grib2
regular_gaussian_pressure_level.grib1
regular_gaussian_pressure_level.grib2
regular_gaussian_surface.grib1
regular_gaussian_surface.grib2
regular_latlon_surface_constant.grib1
regular_latlon_surface_constant.grib2
regular_latlon_surface.grib1
regular_latlon_surface.grib2
row.grib
sample.grib2
satellite.grib
second_ord_rbr.grib1
simple_bitmap.grib
simple.grib
small_ensemble.grib1
spectral_compex.grib1
spectral_complex.grib1
spherical_model_level.grib1
spherical_pressure_level.grib1
sst_globus0083.grib
test.grib1
test_uuid.grib2
tigge_af_ecmwf.grib2
tigge_cf_ecmwf.grib2
tigge_ecmwf.grib2
tigge_pf_ecmwf.grib2
timeRangeIndicator_0.grib
timeRangeIndicator_10.grib
timeRangeIndicator_5.grib
tp_ecmwf.grib
v.grib2
tigge/tigge_ammc_pl_gh.grib
tigge/tigge_ammc_pl_q.grib
tigge/tigge_ammc_pl_t.grib
tigge/tigge_ammc_pl_u.grib
tigge/tigge_ammc_pl_v.grib
tigge/tigge_ammc_sfc_10u.grib
tigge/tigge_ammc_sfc_10v.grib
tigge/tigge_ammc_sfc_2t.grib
tigge/tigge_ammc_sfc_lsm.grib
tigge/tigge_ammc_sfc_mn2t6.grib
tigge/tigge_ammc_sfc_msl.grib
tigge/tigge_ammc_sfc_mx2t6.grib
tigge/tigge_ammc_sfc_orog.grib
tigge/tigge_ammc_sfc_sf.grib
tigge/tigge_ammc_sfc_sp.grib
tigge/tigge_ammc_sfc_st.grib
tigge/tigge_ammc_sfc_tcc.grib
tigge/tigge_ammc_sfc_tcw.grib
tigge/tigge_ammc_sfc_tp.grib
tigge/tigge_babj_pl_gh.grib
tigge/tigge_babj_pl_q.grib
tigge/tigge_babj_pl_t.grib
tigge/tigge_babj_pl_u.grib
tigge/tigge_babj_pl_v.grib
tigge/tigge_babj_sfc_10u.grib
tigge/tigge_babj_sfc_10v.grib
tigge/tigge_babj_sfc_2d.grib
tigge/tigge_babj_sfc_2t.grib
tigge/tigge_babj_sfc_lsm.grib
tigge/tigge_babj_sfc_mn2t6.grib
tigge/tigge_babj_sfc_msl.grib
tigge/tigge_babj_sfc_mx2t6.grib
tigge/tigge_babj_sfc_orog.grib
tigge/tigge_babj_sfc_sd.grib
tigge/tigge_babj_sfc_sf.grib
tigge/tigge_babj_sfc_slhf.grib
tigge/tigge_babj_sfc_sp.grib
tigge/tigge_babj_sfc_sshf.grib
tigge/tigge_babj_sfc_ssr.grib
tigge/tigge_babj_sfc_str.grib
tigge/tigge_babj_sfc_tcc.grib
tigge/tigge_babj_sfc_tcw.grib
tigge/tigge_babj_sfc_tp.grib
tigge/tigge_cwao_pl_gh.grib
tigge/tigge_cwao_pl_q.grib
tigge/tigge_cwao_pl_t.grib
tigge/tigge_cwao_pl_u.grib
tigge/tigge_cwao_pl_v.grib
tigge/tigge_cwao_sfc_10u.grib
tigge/tigge_cwao_sfc_10v.grib
tigge/tigge_cwao_sfc_2d.grib
tigge/tigge_cwao_sfc_2t.grib
tigge/tigge_cwao_sfc_mn2t6.grib
tigge/tigge_cwao_sfc_msl.grib
tigge/tigge_cwao_sfc_mx2t6.grib
tigge/tigge_cwao_sfc_orog.grib
tigge/tigge_cwao_sfc_sd.grib
tigge/tigge_cwao_sfc_skt.grib
tigge/tigge_cwao_sfc_sp.grib
tigge/tigge_cwao_sfc_st.grib
tigge/tigge_cwao_sfc_tcc.grib
tigge/tigge_cwao_sfc_tcw.grib
tigge/tigge_cwao_sfc_tp.grib
tigge/tigge_ecmf_pl_gh.grib
tigge/tigge_ecmf_pl_q.grib
tigge/tigge_ecmf_pl_t.grib
tigge/tigge_ecmf_pl_u.grib
tigge/tigge_ecmf_pl_v.grib
tigge/tigge_ecmf_pt_pv.grib
tigge/tigge_ecmf_pv_pt.grib
tigge/tigge_ecmf_pv_u.grib
tigge/tigge_ecmf_pv_v.grib
tigge/tigge_ecmf_sfc_10u.grib
tigge/tigge_ecmf_sfc_10v.grib
tigge/tigge_ecmf_sfc_2d.grib
tigge/tigge_ecmf_sfc_2t.grib
tigge/tigge_ecmf_sfc_cap.grib
tigge/tigge_ecmf_sfc_cape.grib
tigge/tigge_ecmf_sfc_mn2t6.grib
tigge/tigge_ecmf_sfc_msl.grib
tigge/tigge_ecmf_sfc_mx2t6.grib
tigge/tigge_ecmf_sfc_sd.grib
tigge/tigge_ecmf_sfc_sf.grib
tigge/tigge_ecmf_sfc_skt.grib
tigge/tigge_ecmf_sfc_slhf.grib
tigge/tigge_ecmf_sfc_sm.grib
tigge/tigge_ecmf_sfc_sp.grib
tigge/tigge_ecmf_sfc_sshf.grib
tigge/tigge_ecmf_sfc_ssr.grib
tigge/tigge_ecmf_sfc_st.grib
tigge/tigge_ecmf_sfc_str.grib
tigge/tigge_ecmf_sfc_sund.grib
tigge/tigge_ecmf_sfc_tcc.grib
tigge/tigge_ecmf_sfc_tcw.grib
tigge/tigge_ecmf_sfc_tp.grib
tigge/tigge_ecmf_sfc_ttr.grib
tigge/tigge_egrr_pl_gh.grib
tigge/tigge_egrr_pl_q.grib
tigge/tigge_egrr_pl_t.grib
tigge/tigge_egrr_pl_u.grib
tigge/tigge_egrr_pl_v.grib
tigge/tigge_egrr_pt_pv.grib
tigge/tigge_egrr_pv_pt.grib
tigge/tigge_egrr_pv_u.grib
tigge/tigge_egrr_pv_v.grib
tigge/tigge_egrr_sfc_10u.grib
tigge/tigge_egrr_sfc_10v.grib
tigge/tigge_egrr_sfc_2d.grib
tigge/tigge_egrr_sfc_2t.grib
tigge/tigge_egrr_sfc_mn2t6.grib
tigge/tigge_egrr_sfc_msl.grib
tigge/tigge_egrr_sfc_mx2t6.grib
tigge/tigge_egrr_sfc_sd.grib
tigge/tigge_egrr_sfc_sf.grib
tigge/tigge_egrr_sfc_skt.grib
tigge/tigge_egrr_sfc_slhf.grib
tigge/tigge_egrr_sfc_sm.grib
tigge/tigge_egrr_sfc_sp.grib
tigge/tigge_egrr_sfc_sshf.grib
tigge/tigge_egrr_sfc_ssr.grib
tigge/tigge_egrr_sfc_st.grib
tigge/tigge_egrr_sfc_str.grib
tigge/tigge_egrr_sfc_tcc.grib
tigge/tigge_egrr_sfc_tcw.grib
tigge/tigge_egrr_sfc_tp.grib
tigge/tigge_egrr_sfc_ttr.grib
tigge/tigge_kwbc_pl_gh.grib
tigge/tigge_kwbc_pl_q.grib
tigge/tigge_kwbc_pl_t.grib
tigge/tigge_kwbc_pl_u.grib
tigge/tigge_kwbc_pl_v.grib
tigge/tigge_kwbc_pt_pv.grib
tigge/tigge_kwbc_pv_pt.grib
tigge/tigge_kwbc_pv_u.grib
tigge/tigge_kwbc_pv_v.grib
tigge/tigge_kwbc_sfc_10u.grib
tigge/tigge_kwbc_sfc_10v.grib
tigge/tigge_kwbc_sfc_2d.grib
tigge/tigge_kwbc_sfc_2t.grib
tigge/tigge_kwbc_sfc_cap.grib
tigge/tigge_kwbc_sfc_cape.grib
tigge/tigge_kwbc_sfc_ci.grib
tigge/tigge_kwbc_sfc_lsm.grib
tigge/tigge_kwbc_sfc_mn2t6.grib
tigge/tigge_kwbc_sfc_msl.grib
tigge/tigge_kwbc_sfc_mx2t6.grib
tigge/tigge_kwbc_sfc_sd.grib
tigge/tigge_kwbc_sfc_sf.grib
tigge/tigge_kwbc_sfc_skt.grib
tigge/tigge_kwbc_sfc_slhf.grib
tigge/tigge_kwbc_sfc_sm.grib
tigge/tigge_kwbc_sfc_sp.grib
tigge/tigge_kwbc_sfc_sshf.grib
tigge/tigge_kwbc_sfc_ssr.grib
tigge/tigge_kwbc_sfc_st.grib
tigge/tigge_kwbc_sfc_str.grib
tigge/tigge_kwbc_sfc_tcw.grib
tigge/tigge_kwbc_sfc_tp.grib
tigge/tigge_kwbc_sfc_ttr.grib
tigge/tigge_lfpw_pl_gh.grib
tigge/tigge_lfpw_pl_q.grib
tigge/tigge_lfpw_pl_t.grib
tigge/tigge_lfpw_pl_u.grib
tigge/tigge_lfpw_pl_v.grib
tigge/tigge_lfpw_pv_pt.grib
tigge/tigge_lfpw_pv_u.grib
tigge/tigge_lfpw_pv_v.grib
tigge/tigge_lfpw_sfc_10u.grib
tigge/tigge_lfpw_sfc_10v.grib
tigge/tigge_lfpw_sfc_2d.grib
tigge/tigge_lfpw_sfc_2t.grib
tigge/tigge_lfpw_sfc_cap.grib
tigge/tigge_lfpw_sfc_cape.grib
tigge/tigge_lfpw_sfc_mn2t6.grib
tigge/tigge_lfpw_sfc_msl.grib
tigge/tigge_lfpw_sfc_mx2t6.grib
tigge/tigge_lfpw_sfc_sd.grib
tigge/tigge_lfpw_sfc_sf.grib
tigge/tigge_lfpw_sfc_skt.grib
tigge/tigge_lfpw_sfc_slhf.grib
tigge/tigge_lfpw_sfc_sp.grib
tigge/tigge_lfpw_sfc_sshf.grib
tigge/tigge_lfpw_sfc_ssr.grib
tigge/tigge_lfpw_sfc_st.grib
tigge/tigge_lfpw_sfc_str.grib
tigge/tigge_lfpw_sfc_tcc.grib
tigge/tigge_lfpw_sfc_tcw.grib
tigge/tigge_lfpw_sfc_tp.grib
tigge/tigge_lfpw_sfc_ttr.grib
tigge/tigge_rjtd_pl_gh.grib
tigge/tigge_rjtd_pl_q.grib
tigge/tigge_rjtd_pl_t.grib
tigge/tigge_rjtd_pl_u.grib
tigge/tigge_rjtd_pl_v.grib
tigge/tigge_rjtd_sfc_10u.grib
tigge/tigge_rjtd_sfc_10v.grib
tigge/tigge_rjtd_sfc_2d.grib
tigge/tigge_rjtd_sfc_2t.grib
tigge/tigge_rjtd_sfc_mn2t6.grib
tigge/tigge_rjtd_sfc_msl.grib
tigge/tigge_rjtd_sfc_mx2t6.grib
tigge/tigge_rjtd_sfc_sd.grib
tigge/tigge_rjtd_sfc_skt.grib
tigge/tigge_rjtd_sfc_slhf.grib
tigge/tigge_rjtd_sfc_sm.grib
tigge/tigge_rjtd_sfc_sp.grib
tigge/tigge_rjtd_sfc_sshf.grib
tigge/tigge_rjtd_sfc_ssr.grib
tigge/tigge_rjtd_sfc_str.grib
tigge/tigge_rjtd_sfc_tcc.grib
tigge/tigge_rjtd_sfc_tcw.grib
tigge/tigge_rjtd_sfc_tp.grib
tigge/tigge_rjtd_sfc_ttr.grib
tigge/tigge_rksl_pl_gh.grib
tigge/tigge_rksl_pl_q.grib
tigge/tigge_rksl_pl_t.grib
tigge/tigge_rksl_pl_u.grib
tigge/tigge_rksl_pl_v.grib
tigge/tigge_rksl_sfc_10u.grib
tigge/tigge_rksl_sfc_10v.grib
tigge/tigge_rksl_sfc_2t.grib
tigge/tigge_rksl_sfc_msl.grib
tigge/tigge_rksl_sfc_sp.grib
tigge/tigge_sbsj_pl_gh.grib
tigge/tigge_sbsj_pl_q.grib
tigge/tigge_sbsj_pl_t.grib
tigge/tigge_sbsj_pl_u.grib
tigge/tigge_sbsj_pl_v.grib
tigge/tigge_sbsj_sfc_10u.grib
tigge/tigge_sbsj_sfc_10v.grib
tigge/tigge_sbsj_sfc_2t.grib
tigge/tigge_sbsj_sfc_msl.grib
tigge/tigge_sbsj_sfc_sf.grib
tigge/tigge_sbsj_sfc_skt.grib
tigge/tigge_sbsj_sfc_sp.grib
tigge/tigge_sbsj_sfc_ssr.grib
tigge/tigge_sbsj_sfc_st.grib
tigge/tigge_sbsj_sfc_tcc.grib
tigge/tigge_sbsj_sfc_tcw.grib
tigge/tigge_sbsj_sfc_tp.grib
tigge/tiggelam_cnmc_sfc.grib
"
download_URL="http://download.ecmwf.org"
cd ${DATA_DIR}
#echo "Downloading data files for testing..."
for f in $files; do
# If we haven't already got the file, download it
if [ ! -f "$f" ]; then
wget --no-verbose -q -O $f ${download_URL}/test-data/grib_api/data/$f
#chmod 444 $f
#echo "Downloaded $f ..."
fi
done
# Add a file to indicate we've done the download
touch ${DOWNLOADED}

View File

@ -44,6 +44,10 @@ else
then
GRIB_API_LIB=`pwd`/src
fi
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
#${tools_dir}grib_info
set -u
fi

View File

@ -31,6 +31,9 @@ then
GRIB_API_LIB=`pwd`/src
fi
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
#${tools_dir}grib_info
set -u

View File

@ -45,5 +45,9 @@ else
then
GRIB_API_LIB=`pwd`/src
fi
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
set -u
fi

View File

@ -20,6 +20,9 @@ else
PYTHONPATH=$cpath/python:$cpath/python/.libs:$PYTHONPATH
export PYTHONPATH
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
set -u
fi

View File

@ -36,4 +36,6 @@ LDADD = $(top_builddir)/src/libgrib_api.la $(EMOS_LIB)
INCLUDES = -I$(top_builddir)/src
EXTRA_DIST = $(TESTS) mf.rules filter_rules include.sh lamb_az_eq_area.ref
EXTRA_DIST = $(TESTS) mf.rules filter_rules include.sh include.ctest.sh.in \
lamb_az_eq_area.ref

View File

@ -50,7 +50,11 @@ else
GRIB_API_LIB=`pwd`/src
fi
# Download the data needed for tests
${data_dir}/download.sh "${data_dir}"
# go back to current working dir
cd $save
set -u
fi