Testing: use codes_bufr_filter rather than wrapper script so can run with valgrind

This commit is contained in:
Shahram Najm 2017-08-29 17:49:30 +01:00
parent ef14b47cfe
commit f649013ee2
13 changed files with 49 additions and 43 deletions

View File

@ -77,8 +77,11 @@ do
$COMPILER -o $tempExe $tempSrc -I${INCL_DIR1} -I${INCL_DIR2} $FLAGS_COMPILER $FLAGS_LINKER
# valgrind --error-exitcode=1 ./$tempExe
./$tempExe $filePath
if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then
valgrind --error-exitcode=1 -q ./$tempExe $filePath
else
./$tempExe $filePath
fi
fi
rm -f $tempExe $tempSrc

View File

@ -48,7 +48,7 @@ do
${tools_dir}/bufr_dump -Dfilter $f > $fRules
${tools_dir}/bufr_filter $fRules $f >/dev/null
${tools_dir}/codes_bufr_filter $fRules $f >/dev/null
rm -f $fRules
fi

View File

@ -77,8 +77,11 @@ do
$COMPILER -o $tempExe $tempSrc -I${INCL_DIR1} -I${INCL_DIR2} $FLAGS_COMPILER $FLAGS_LINKER
# The executable always creates a file called outfile.bufr
# valgrind --error-exitcode=1 ./$tempExe
./$tempExe
if test "x$ECCODES_TEST_WITH_VALGRIND" != "x"; then
valgrind --error-exitcode=1 -q ./$tempExe
else
./$tempExe
fi
${tools_dir}/bufr_compare ${data_dir}/bufr/$file $tempBufr
TEMP_JSON1=${label}.$file.json

View File

@ -51,7 +51,7 @@ do
${tools_dir}/bufr_dump -Efilter $f > $fRules
${tools_dir}/bufr_filter -o $fBufrTmp $fRules $f
${tools_dir}/codes_bufr_filter -o $fBufrTmp $fRules $f
${tools_dir}/bufr_compare $fBufrTmp $f
TEMP_JSON1=${label}.$f.json

View File

@ -45,7 +45,7 @@ bufr_files=`cat bufr_data_files.txt`
for f in ${bufr_files} ; do
echo "file: $f" >> $fLog
${tools_dir}/codes_bufr_filter $fRules $f >> $fLog
${tools_dir}/bufr_filter $fRules $f >> $fLog # See ECC-205
${tools_dir}/codes_bufr_filter $fRules $f >> $fLog # See ECC-205
done
#-----------------------------------------------------------
@ -1013,7 +1013,7 @@ fOut="g2nd_208.bufr.out"
echo "Test: extract subsets compressed data" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
${tools_dir}/codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
cat > ${fRules} <<EOF
set unpack=1;
@ -1025,7 +1025,7 @@ print "orbitNumber=[orbitNumber!10]";
print "casRegistryNumber=[casRegistryNumber!10]";
EOF
${tools_dir}/bufr_filter $fRules $fOut > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $fOut > ${f}.log
cat > ${f}.log.ref <<EOF
=== message number 1
@ -1062,7 +1062,7 @@ f="gosat.bufr"
echo "Test: firstOrderStatistics" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
decimalScaleOfFollowingSignificands->firstOrderStatisticalValue=-15 -15 -15 -15 -15 -15 -15 -15 -15 -15
@ -1109,7 +1109,7 @@ fOut="asel_139.bufr.out"
echo "Test: delayed replication compressed data" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
${tools_dir}/codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
cat > ${fRules} <<EOF
set unpack=1;
@ -1120,7 +1120,7 @@ print "#3#windSpeedAt10M=[#3#windSpeedAt10M]";
print "#5#windSpeedAt10M=[#5#windSpeedAt10M]";
EOF
${tools_dir}/bufr_filter $fRules $fOut > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $fOut > ${f}.log
cat > ${f}.log.ref <<EOF
delayedDescriptorReplicationFactor=5
@ -1161,7 +1161,7 @@ fOut="out.bufr"
echo "Test: create new BUFR with bitmap" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
${tools_dir}/codes_bufr_filter -o $fOut $fRules $f 2>> $fLog 1>> $fLog
cat > ${fRules} <<EOF
set unpack=1;
@ -1170,7 +1170,7 @@ print "delayedDescriptorReplicationFactor=[delayedDescriptorReplicationFactor!20
print "dataPresentIndicator=[dataPresentIndicator!20]";
EOF
${tools_dir}/bufr_filter $fRules $fOut > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $fOut > ${f}.log
cat > ${f}.log.ref <<EOF
delayedDescriptorReplicationFactor=4 1 4 15 2 2
@ -1213,7 +1213,7 @@ f="go15_87.bufr"
echo "Test: create new BUFR with bitmap" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
numberOfSubsets=128
@ -1328,7 +1328,7 @@ f="metar_with_2_bias.bufr"
echo "Test: Data with two bias correction wrong bitmap" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
70
@ -1355,7 +1355,7 @@ f="temp-land-with-substituted-values.bufr"
echo "Test: Data with substituted value" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
110
@ -1382,7 +1382,7 @@ f="syno_1.bufr"
echo "Test: Nested delayed replication" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
-1e+100 -1e+100 2 -1e+100 -1e+100 3 -1e+100 -1e+100
@ -1409,7 +1409,7 @@ f="imssnow.bufr"
echo "Test: Simple thinning" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o ${f}.out $fRules $f
${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f
cat > $fRules <<EOF
set unpack=1;
@ -1418,7 +1418,7 @@ print "longitude=[longitude]";
print "height=[height]";
EOF
${tools_dir}/bufr_filter $fRules ${f}.out > ${f}.log
${tools_dir}/codes_bufr_filter $fRules ${f}.out > ${f}.log
cat > ${f}.log.ref <<EOF
latitude=4.93301 5.17216 5.40243 5.62361 7.86075
@ -1446,7 +1446,7 @@ f="go15_87.bufr"
echo "Test: subset extraction constant values" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o ${f}.out $fRules $f
${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f
cat > $fRules <<EOF
set unpack=1;
@ -1456,14 +1456,14 @@ set doExtractSubsets=1;
write;
EOF
${tools_dir}/bufr_filter -o ${f}.out.out $fRules ${f}.out
${tools_dir}/codes_bufr_filter -o ${f}.out.out $fRules ${f}.out
cat > $fRules <<EOF
set unpack=1;
print "latitude=[latitude]";
EOF
${tools_dir}/bufr_filter $fRules ${f}.out.out > ${f}.log
${tools_dir}/codes_bufr_filter $fRules ${f}.out.out > ${f}.log
cat > ${f}.log.ref <<EOF
latitude=0
@ -1488,14 +1488,14 @@ f="amsu_55.bufr"
echo "Test: fix for ECC-389" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter -o ${f}.out $fRules $f
${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f
cat > $fRules <<EOF
set unpack=1;
print "[#14#brightnessTemperature]";
EOF
${tools_dir}/bufr_filter $fRules ${f}.out > ${f}.log
${tools_dir}/codes_bufr_filter $fRules ${f}.out > ${f}.log
cat > ${f}.log.ref <<EOF
266.53
@ -1519,7 +1519,7 @@ f="bssh_176.bufr"
# This should fail. Out of Range
set +e
${tools_dir}/bufr_filter -o ${f}.out $fRules $f
${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f
status=$?
set -e
[ $status -ne 0 ]
@ -1534,7 +1534,7 @@ cat > $fRules <<EOF
print "airTemperature=[airTemperature], width=[airTemperature->width]";
write;
EOF
${tools_dir}/bufr_filter -o ${f}.out $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter -o ${f}.out $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
airTemperature=$HIGH_TEMPERATURE, width=26
@ -1587,7 +1587,7 @@ f="syno_1.bufr"
echo "Test: Julian Date" >> $fLog
echo "file: $f" >> $fLog
${tools_dir}/bufr_filter $fRules $f > ${f}.log
${tools_dir}/codes_bufr_filter $fRules $f > ${f}.log
cat > ${f}.log.ref <<EOF
match

View File

@ -52,7 +52,7 @@ rm -f $outputFilt
echo "Test: Area extraction" >> $fLog
echo "file: $outputBufr" >> $fLog
${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt
${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt
[ -f $outputBufr ]
cat > $fRules <<EOF
@ -68,7 +68,7 @@ print "===========";
print "fieldOfViewNumber=[fieldOfViewNumber!15]";
print "===========";
EOF
${tools_dir}/bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt
${tools_dir}/codes_bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt
cat > $outputRef <<EOF
extracted 14 of 128 subsets

View File

@ -64,7 +64,7 @@ rm -f $outputFilt
echo "Test: Datetime extraction" >> $fLog
echo "file: $inputBufr" >> $fLog
${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt
${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr > $outputFilt
[ -f $outputBufr ]
cat > $fRules <<EOF
@ -82,7 +82,7 @@ print "===========";
print "second=[second!15]";
print "===========";
EOF
${tools_dir}/bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt
${tools_dir}/codes_bufr_filter $fRules $inputBufr $outputBufr >> $outputFilt
cat > $outputRef <<EOF
extracted 30 of 128 subsets
@ -148,7 +148,7 @@ inputBufr="amsa_55.bufr"
outputBufr=${label}.${inputBufr}.out
set +e
${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr
${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr
status=$?
set -e
if [ $status -eq 0 ]; then
@ -182,7 +182,7 @@ inputBufr="amsa_55.bufr"
outputBufr=${label}.${inputBufr}.out
set +e
${tools_dir}/bufr_filter -o $outputBufr $fRules $inputBufr
${tools_dir}/codes_bufr_filter -o $outputBufr $fRules $inputBufr
status=$?
set -e
if [ $status -eq 0 ]; then

View File

@ -29,7 +29,7 @@ cat > $tempRules <<EOF
print "[3HourPressureChange]";
EOF
${tools_dir}/bufr_filter $tempRules $BufrFile > $tempOut
${tools_dir}/codes_bufr_filter $tempRules $BufrFile > $tempOut
cat > $tempRef <<EOF
20

View File

@ -26,7 +26,7 @@ cat > $tempRules <<EOF
write;
EOF
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile
# There is a difference in localLongitude, rel error=6.58627e-06
# So this should fail

View File

@ -37,7 +37,7 @@ cat > $tempRules <<EOF
print "h2=[heightOfBarometerAboveMeanSeaLevel]";
EOF
${tools_dir}/bufr_filter $tempRules $input > $tempOut
${tools_dir}/codes_bufr_filter $tempRules $input > $tempOut
cat > $tempRef << EOF
h1=10 60 215 564 685 5 5 555

View File

@ -34,13 +34,13 @@ EOF
# Expect this to fail as two values are out-of-range
set +e
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null
status=$?
set -e
[ $status -ne 0 ]
# Now set environment variable to turn out-of-range values into 'missing'
export ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE=1
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile
unset ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE
#echo 'set unpack=1;print "[longitude]";' | ${tools_dir}/bufr_filter - $BufrFile
@ -62,13 +62,13 @@ EOF
# The latitude is out of range. So we expect this to fail
set +e
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile 2>/dev/null
status=$?
set -e
[ $status -ne 0 ]
export ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE=1
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile
unset ECCODES_BUFR_SET_TO_MISSING_IF_OUT_OF_RANGE
# ------------------------

View File

@ -31,7 +31,7 @@ cat > $tempRules <<EOF
write;
EOF
${tools_dir}/bufr_filter -o $tempOut $tempRules $BufrFile
${tools_dir}/codes_bufr_filter -o $tempOut $tempRules $BufrFile
# There are two differences. So this should fail
set +e

View File

@ -33,7 +33,7 @@ cat > $tempRules <<EOF
print "[radarBackScatter]";
EOF
${tools_dir}/bufr_filter $tempRules $input > $tempOut
${tools_dir}/codes_bufr_filter $tempRules $input > $tempOut
cat > $tempRef << EOF
59 59 57 51 47 48 45 45