From 19b7209e29e67936b76783b6e6cf1dfe397bc34a Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 27 Dec 2022 16:56:02 +0000 Subject: [PATCH] ECC-1498: Test --- tests/bufr_filter_extract_area.sh | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) 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 <