diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8a4c7d590..7cb46e09b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -102,7 +102,8 @@ list( APPEND tests2 tigge_conversions read_any padding - debug + grib_dump + grib_dump_debug grib_util_set_spec local_MeteoFrance neg_fctime diff --git a/tests/bufr_dump.sh b/tests/bufr_dump.sh index 8c8c89b7c..18d9e3a0d 100755 --- a/tests/bufr_dump.sh +++ b/tests/bufr_dump.sh @@ -24,7 +24,6 @@ fJsonTmp=${label}".json.tmp" #============================================== # Testing bufr_dump -O #============================================== - bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt` REDIRECT=/dev/null @@ -33,6 +32,22 @@ do ${tools_dir}bufr_dump -O ${data_dir}/bufr/$file >/dev/null done +#============================================== +# Testing output when ECCODES_DEBUG is enabled +#============================================== +file="aaen_55.bufr" +export ECCODES_DEBUG=1 + +# By default debug output goes to stderr +${tools_dir}bufr_dump -O ${data_dir}/bufr/$file 2>&1 | grep -q "BUFR data .*ing" + +# Redirect it to stdout +export ECCODES_LOG_STREAM=stdout +${tools_dir}bufr_dump -O ${data_dir}/bufr/$file | grep -q "BUFR data .*ing" + +unset ECCODES_DEBUG +unset ECCODES_LOG_STREAM + #============================================== # Testing a malformed bufr file (see ECC-110) #============================================== diff --git a/tests/grib_dump.sh b/tests/grib_dump.sh new file mode 100755 index 000000000..7fc8ab822 --- /dev/null +++ b/tests/grib_dump.sh @@ -0,0 +1,73 @@ +#!/bin/sh +# Copyright 2005-2016 ECMWF. +# +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# +# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by +# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. +# + +. ./include.sh + +REDIRECT=/dev/null + +files=" +constant_field.grib1 +lfpw.grib1 +missing_field.grib1 +reduced_gaussian_lsm.grib1 +reduced_gaussian_model_level.grib1 +reduced_gaussian_pressure_level.grib1 +reduced_gaussian_pressure_level_constant.grib1 +reduced_gaussian_sub_area.grib1 +reduced_gaussian_surface.grib1 +reduced_latlon_surface.grib1 +reduced_latlon_surface_constant.grib1 +reference_ensemble_mean.grib1 +reference_stdev.grib1 +regular_gaussian_model_level.grib1 +regular_gaussian_pressure_level.grib1 +regular_gaussian_pressure_level_constant.grib1 +regular_gaussian_surface.grib1 +regular_latlon_surface.grib1 +regular_latlon_surface_constant.grib1 +second_ord_rbr.grib1 +small_ensemble.grib1 +spectral_complex.grib1 +spherical_model_level.grib1 +spherical_pressure_level.grib1 +constant_field.grib2 +gfs.c255.grib2 +jpeg.grib2 +missing.grib2 +multi.grib2 +multi_created.grib2 +reduced_gaussian_model_level.grib2 +reduced_gaussian_pressure_level.grib2 +reduced_gaussian_pressure_level_constant.grib2 +reduced_gaussian_sub_area.grib2 +reduced_gaussian_surface.grib2 +reduced_gaussian_surface_jpeg.grib2 +reduced_latlon_surface.grib2 +reduced_latlon_surface_constant.grib2 +regular_gaussian_model_level.grib2 +regular_gaussian_pressure_level.grib2 +regular_gaussian_pressure_level_constant.grib2 +regular_gaussian_surface.grib2 +regular_latlon_surface.grib2 +regular_latlon_surface_constant.grib2 +sample.grib2 +spherical_model_level.grib2 +spherical_pressure_level.grib2 +test_uuid.grib2 +tigge_af_ecmwf.grib2 +tigge_cf_ecmwf.grib2 +v.grib2 +" + +for file in $files; do + if [ -f ${data_dir}/$file ]; then + ${tools_dir}grib_dump -O ${data_dir}/$file 2> $REDIRECT > $REDIRECT + fi +done diff --git a/tests/grib_dump_debug.sh b/tests/grib_dump_debug.sh index 3c83fef9b..05a0316f7 100755 --- a/tests/grib_dump_debug.sh +++ b/tests/grib_dump_debug.sh @@ -68,6 +68,6 @@ v.grib2 for file in $files; do if [ -f ${data_dir}/$file ]; then - time ${tools_dir}grib_dump -Da ${data_dir}/$file 2> $REDIRECT > $REDIRECT + ${tools_dir}grib_dump -Da ${data_dir}/$file 2> $REDIRECT > $REDIRECT fi done