diff --git a/tests/bufr_dump_data.sh b/tests/bufr_dump_data.sh index e955032c8..4b2e1c1bd 100755 --- a/tests/bufr_dump_data.sh +++ b/tests/bufr_dump_data.sh @@ -43,11 +43,14 @@ 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 "parsing include file" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file > $fLog 2>&1 +grep -q "parsing include file" $fLog # Redirect it to stdout +rm $fLog export ECCODES_LOG_STREAM=stdout -${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file | grep -q "parsing include file" +${tools_dir}/bufr_dump -O ${data_dir}/bufr/$file > $fLog +grep -q "parsing include file" $fLog unset ECCODES_DEBUG unset ECCODES_LOG_STREAM diff --git a/tests/definitions.sh b/tests/definitions.sh index e3b5461e7..b29fd6290 100755 --- a/tests/definitions.sh +++ b/tests/definitions.sh @@ -13,10 +13,9 @@ REDIRECT=/dev/null -[ -z "$ECCODES_DEFINITION_PATH" ] | ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` +[ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print | grep -v grib3/` do ${tools_dir}/codes_parser $file > $REDIRECT done - diff --git a/tests/grib_set.sh b/tests/grib_set.sh index 23367fdc6..52e3415f3 100755 --- a/tests/grib_set.sh +++ b/tests/grib_set.sh @@ -90,7 +90,8 @@ done # GRIB-943: centre code table # ---------------------------- ${tools_dir}/grib_set -s centre=289 $ECCODES_SAMPLES_PATH/GRIB2.tmpl $outfile -${tools_dir}/grib_dump -O $outfile | grep -q 'centre = 289.*Zambia' +${tools_dir}/grib_dump -O $outfile > $temp +grep -q 'centre = 289.*Zambia' $temp # ECC-539: avoid output being the same as input # ----------------------------------------------- diff --git a/tests/include.ctest.sh.in b/tests/include.ctest.sh.in index 2330af454..acaa91249 100644 --- a/tests/include.ctest.sh.in +++ b/tests/include.ctest.sh.in @@ -1,4 +1,6 @@ set -ea +set -o pipefail + # For CMake # Unset any environment variable that could interfere with tests diff --git a/tests/list_codetable_flagtable_keys.sh b/tests/list_codetable_flagtable_keys.sh index a69e4a0d1..851906e1d 100755 --- a/tests/list_codetable_flagtable_keys.sh +++ b/tests/list_codetable_flagtable_keys.sh @@ -13,7 +13,7 @@ OUTPUT=all_codetable_flagtable_keys.txt TEMP=temp.list_codetable_flagtable_keys.txt -[ -z "$ECCODES_DEFINITION_PATH" ] | ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` +[ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d` touch $TEMP echo "Go through all files in $ECCODES_DEFINITION_PATH ..."