From 64f3b3c7dfe29b1e3024d47691893256defeefee Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sun, 18 Feb 2024 15:39:32 +0000 Subject: [PATCH] Testing: JPEG and lib version tests --- tests/grib2_version.sh | 19 +++++++++++++++++-- tests/grib_jpeg.sh | 8 ++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/tests/grib2_version.sh b/tests/grib2_version.sh index 1f7cbe8b5..6e6daef42 100755 --- a/tests/grib2_version.sh +++ b/tests/grib2_version.sh @@ -17,6 +17,8 @@ if [ ! -d "$ECCODES_DEFINITION_PATH" ]; then fi temp=temp.$label.grib2 +tempFilt=temp.$label.filt +tempText=temp.$label.txt sample1=$ECCODES_SAMPLES_PATH/GRIB1.tmpl sample2=$ECCODES_SAMPLES_PATH/GRIB2.tmpl tables_dir="$ECCODES_DEFINITION_PATH/grib2/tables" @@ -34,7 +36,6 @@ fi cd $test_dir # Check table 1.0 # Check it has the latest with description matching "Version implemented on DD MM YYYY" -tempText=temp.$label.txt ${tools_dir}/grib_set -s tablesVersion=$latest $sample2 $temp ${tools_dir}/grib_dump -O -p tablesVersion $temp > $tempText grep -q "Version implemented on" $tempText @@ -50,4 +51,18 @@ if [ "$tablesVersion" != "$latestOfficial" ]; then exit 1 fi -rm -f $temp +# Library and definitions versions +cat >$tempFilt< $tempText 2>&1 +status=$? +set -e +[ $status -ne 0 ] +cat $tempText +grep -q "Definition files version .* is greater than engine version" $tempText + +rm -f $tempFilt $temp $tempText diff --git a/tests/grib_jpeg.sh b/tests/grib_jpeg.sh index 69210430e..43575651c 100755 --- a/tests/grib_jpeg.sh +++ b/tests/grib_jpeg.sh @@ -164,6 +164,14 @@ if [ $HAVE_LIBJASPER -eq 0 ]; then set -e [ $status -ne 0 ] grep -q "JasPer JPEG support not enabled" $tempDump + + infile=$data_dir/sample.grib2 + set +e + ECCODES_GRIB_JPEG=jasper ${tools_dir}/grib_set -rs packingType=grid_jpeg $infile $outfile1 > $tempDump 2>&1 + status=$? + set -e + [ $status -ne 0 ] + grep -q "JasPer JPEG support not enabled" $tempDump fi # Clean up