diff --git a/tests/Makefile.am b/tests/Makefile.am index 476304d66..855cdbcbb 100755 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -12,7 +12,7 @@ TESTS = definitions.sh calendar.sh \ multi_from_message.sh change_scanning.sh \ julian.sh statistics.sh tigge.sh tigge_conversions.sh \ read_any.sh padding.sh lamb_az_eq_area.sh grib_to_netcdf.sh debug.sh \ - $(JPEG_TEST) $(CCSDS_TEST) + jpeg.sh ccsds.sh noinst_PROGRAMS = packing_check gauss_sub read_any double_cmp packing pack_unpack \ multi_from_message julian read_index index gribex_perf\ diff --git a/tests/ccsds.sh b/tests/ccsds.sh index 6078a3d4a..63d341c8c 100755 --- a/tests/ccsds.sh +++ b/tests/ccsds.sh @@ -8,10 +8,29 @@ # virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction. # - . ./include.sh REDIRECT=/dev/null + +# First check if Adaptive Entropy Coding (AEC) feature is enabled +skip_test=0 +src_config=${src_dir}/config.h +if [ -f ${src_config} ]; then + set +e + grep '#undef HAVE_LIBAEC' ${src_config} >/dev/null + status=$? + set -e + if [ $status -eq 0 ]; then + # Found the string so feature is disabled + skip_test=1 + fi +fi +if [ $skip_test -eq 1 ]; then + #echo "AEC feature was not enabled. Skipping this test." + exit 0 +fi +echo "AEC feature was enabled." + BLACKLIST="totalLength,section5Length,section7Length,dataRepresentationTemplateNumber,typeOfPacking" infile=${data_dir}/ccsds.grib2 diff --git a/tests/include.sh b/tests/include.sh index c8b8d8a9a..50457f993 100644 --- a/tests/include.sh +++ b/tests/include.sh @@ -41,6 +41,7 @@ else data_dir=$cpath/data test_dir=$cpath/tests def_dir=$cpath/definitions + src_dir=$cpath/src else tools_dir="" tigge_dir="" diff --git a/tests/jpeg.sh b/tests/jpeg.sh index 2a07e7461..0669e30de 100755 --- a/tests/jpeg.sh +++ b/tests/jpeg.sh @@ -11,6 +11,26 @@ . ./include.sh REDIRECT=/dev/null + +# First check if jpeg decode/encode feature is enabled +skip_test=0 +src_config=${src_dir}/config.h +if [ -f ${src_config} ]; then + set +e + grep '#undef HAVE_JPEG' ${src_config} >/dev/null + status=$? + set -e + if [ $status -eq 0 ]; then + # Found the string so feature is disabled + skip_test=1 + fi +fi +if [ $skip_test -eq 1 ]; then + echo "JPEG feature was not enabled. Skipping this test." + exit 0 +fi +echo "JPEG feature was enabled." + BLACKLIST="totalLength,section5Length,section7Length,dataRepresentationTemplateNumber,typeOfPacking" infile=${data_dir}/jpeg.grib2