diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2024-03-10 23:43:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-10 23:43:37 (GMT) |
commit | 50a65223220142cf0b06a7d25ca53dc56811be01 (patch) | |
tree | 52d42dec08d723ee8949e50b7501dd7fbc1d21d5 /tools/test/h5dump/testh5dump.sh.in | |
parent | 9bc6c201666aa7fcd7937db7241d4074b67824c9 (diff) | |
download | hdf5-50a65223220142cf0b06a7d25ca53dc56811be01.zip hdf5-50a65223220142cf0b06a7d25ca53dc56811be01.tar.gz hdf5-50a65223220142cf0b06a7d25ca53dc56811be01.tar.bz2 |
Change compression tests reference files to use masking for compression ratios (#4083)
Rework TEST_FILTER tests to handle slightly different compression ratios
Diffstat (limited to 'tools/test/h5dump/testh5dump.sh.in')
-rw-r--r-- | tools/test/h5dump/testh5dump.sh.in | 75 |
1 files changed, 69 insertions, 6 deletions
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in index fdeb17d..4734865 100644 --- a/tools/test/h5dump/testh5dump.sh.in +++ b/tools/test/h5dump/testh5dump.sh.in @@ -537,6 +537,69 @@ TOOLTEST() { } +# same as TOOLTEST but masks out the compression values +TOOLTESTC() { + # check if caseless compare and diff requested + if [ "$1" = ignorecase ]; then + caseless="-i" + # replace cmp with diff which runs much longer. + xCMP="$DIFF -i" + shift + else + caseless="" + # stick with faster cmp if ignorecase is not requested. + xCMP="$CMP" + fi + + txttype=$1 + expect="$TESTDIR/$2" + actual="$TESTDIR/`basename $2 .ddl`.out" + actual_err="$TESTDIR/`basename $2 .ddl`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + tmp_file=/tmp/h5test_tmp_$$ + cp $actual $tmp_file + sed -e 's/SIZE [0-9]* ('"$txttype"'\.[0-9][0-9][0-9]:1 COMPRESSION)/SIZE XXXX ('"$txttype"'.XXX:1 COMPRESSION)/' \ + < $tmp_file > $actual + rm -f $tmp_file + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + echo " Expected result (*.ddl) missing" + nerrors="`expr $nerrors + 1`" + elif $xCMP $expect $actual > /dev/null 2>&1 ; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $caseless $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + fi + +} # same as TOOLTEST1 but compares generated file to expected output # and compares the generated data file to the expected data file @@ -1355,19 +1418,19 @@ TOOLTEST texceedsubblock.ddl --enable-error-stack -d 1d -k 1,3 taindices.h5 # tests for filters # SZIP -TOOLTEST tszip.ddl --enable-error-stack -H -p -d szip tfilters.h5 +TOOLTESTC 2 tszip.ddl --enable-error-stack -H -p -d szip tfilters.h5 # deflate -TOOLTEST tdeflate.ddl --enable-error-stack -H -p -d deflate tfilters.h5 +TOOLTESTC 2 tdeflate.ddl --enable-error-stack -H -p -d deflate tfilters.h5 # shuffle TOOLTEST tshuffle.ddl --enable-error-stack -H -p -d shuffle tfilters.h5 # fletcher32 -TOOLTEST tfletcher32.ddl --enable-error-stack -H -p -d fletcher32 tfilters.h5 +TOOLTESTC 0 tfletcher32.ddl --enable-error-stack -H -p -d fletcher32 tfilters.h5 # nbit -TOOLTEST tnbit.ddl --enable-error-stack -H -p -d nbit tfilters.h5 +TOOLTESTC 10 tnbit.ddl --enable-error-stack -H -p -d nbit tfilters.h5 # scaleoffset -TOOLTEST tscaleoffset.ddl --enable-error-stack -H -p -d scaleoffset tfilters.h5 +TOOLTESTC 4 tscaleoffset.ddl --enable-error-stack -H -p -d scaleoffset tfilters.h5 # all -TOOLTEST tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 +TOOLTESTC 1 tallfilters.ddl --enable-error-stack -H -p -d all tfilters.h5 # user defined TOOLTEST tuserfilter.ddl --enable-error-stack -H -p -d myfilter tfilters.h5 |