diff --git a/tests/bufr_filter_extract_area.sh b/tests/bufr_filter_extract_area.sh index 93663c542..fadc4050f 100755 --- a/tests/bufr_filter_extract_area.sh +++ b/tests/bufr_filter_extract_area.sh @@ -27,6 +27,22 @@ fBufrTmp=${label}".bufr.tmp" # Define filter rules file fRules=${label}.filter +set +u +use_valgrind=0 +if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then + use_valgrind=1 + # The presence of ECCODES_TEST_WITH_VALGRIND environment variable redefines + # tools_dir so we reset it to its original + tools_dir=$build_dir/bin +fi +set -u + +if [ $use_valgrind -eq 1 ]; then + PREFIX="valgrind --error-exitcode=1 --leak-check=full " +else + PREFIX="" +fi + #----------------------------------------------------------- # Test: Area extraction #----------------------------------------------------------- @@ -53,7 +69,7 @@ rm -f $outputFilt echo "Test: Area extraction" >> $fLog echo "file: $outputBufr" >> $fLog -${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt +$PREFIX ${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt [ -f $outputBufr ] cat > $fRules <> $outputFilt +$PREFIX ${tools_dir}/codes_bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt cat > $outputRef < $fRules <