diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2013-01-15 14:34:44 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2013-01-15 14:34:44 (GMT) |
commit | c326a3bd9ce1d484e3e28c7557ab470e738de51f (patch) | |
tree | b1592d999fcf163e0e22e233c37148c3e1245359 /tools | |
parent | 2a7ae0367b157c0d51efebc4d46b2dd5e91a5af6 (diff) | |
download | hdf5-c326a3bd9ce1d484e3e28c7557ab470e738de51f.zip hdf5-c326a3bd9ce1d484e3e28c7557ab470e738de51f.tar.gz hdf5-c326a3bd9ce1d484e3e28c7557ab470e738de51f.tar.bz2 |
[svn-r23164] HDFFV-8285: H5dump suppress ddl option test script
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 96 |
1 files changed, 89 insertions, 7 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 8a2483b..e46887f 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -176,6 +176,7 @@ $SRC_H5DUMP_TESTFILES/tall-3.ddl $SRC_H5DUMP_TESTFILES/tall-4s.ddl $SRC_H5DUMP_TESTFILES/tall-5s.ddl $SRC_H5DUMP_TESTFILES/tall-6.ddl +$SRC_H5DUMP_TESTFILES/tall-6.exp $SRC_H5DUMP_TESTFILES/tallfilters.ddl $SRC_H5DUMP_TESTFILES/tarray1.ddl $SRC_H5DUMP_TESTFILES/tarray1_big.ddl @@ -261,8 +262,13 @@ $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl $SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl $SRC_H5DUMP_TESTFILES/tnestedcmpddt.ddl $SRC_H5DUMP_TESTFILES/tnbit.ddl +$SRC_H5DUMP_TESTFILES/tnoddl.ddl +$SRC_H5DUMP_TESTFILES/tnoddlfile.ddl +$SRC_H5DUMP_TESTFILES/tnoddlfile.exp $SRC_H5DUMP_TESTFILES/tno-subset.ddl $SRC_H5DUMP_TESTFILES/tnullspace.ddl +$SRC_H5DUMP_TESTFILES/trawdatafile.ddl +$SRC_H5DUMP_TESTFILES/trawdatafile.exp $SRC_H5DUMP_TESTFILES/zerodim.ddl $SRC_H5DUMP_TESTFILES/tordergr1.ddl $SRC_H5DUMP_TESTFILES/tordergr2.ddl @@ -305,6 +311,9 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.ddl $SRC_H5DUMP_TESTFILES/tvldtypes5.ddl $SRC_H5DUMP_TESTFILES/tvlstr.ddl $SRC_H5DUMP_TESTFILES/tvms.ddl +$SRC_H5DUMP_TESTFILES/twithddl.ddl +$SRC_H5DUMP_TESTFILES/twithddlfile.ddl +$SRC_H5DUMP_TESTFILES/twithddlfile.exp $SRC_H5DUMP_TESTFILES/h5dump-help.txt $SRC_H5DUMP_TESTFILES/out3.h5import $SRC_H5DUMP_TESTFILES/tbinregR.exp @@ -387,7 +396,7 @@ TESTING() { # the actual output file is calculated by replacing the `.ddl' with # `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a # non-zero value. -# +# ADD_H5_TEST TOOLTEST() { expect="$TESTDIR/$1" actual="$TESTDIR/`basename $1 .ddl`.out" @@ -434,6 +443,7 @@ TOOLTEST() { # same as TOOLTEST1 but compares generated file to expected output # and compares the generated data file to the expected data file # used for the binary tests that expect a full path in -o without -b +# ADD_H5_EXPORT_TEST TOOLTEST2() { expectdata="$TESTDIR/$1" @@ -482,6 +492,72 @@ TOOLTEST2() { } +# same as TOOLTEST2 but compares generated file to expected ddl file +# and compares the generated data file to the expected data file +# used for the binary tests that expect a full path in -o without -b +# ADD_H5_TEST_EXPORT +TOOLTEST2A() { + + expectdata="$TESTDIR/$1" + expect="$TESTDIR/`basename $1 .exp`.ddl" + actualdata="$TESTDIR/`basename $1 .exp`.txt" + actual="$TESTDIR/`basename $1 .exp`.out" + actual_err="$TESTDIR/`basename $1 .exp`.err" + shift + expectmeta="$TESTDIR/$1" + actualmeta="$TESTDIR/`basename $1 .ddl`.txt" + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + cat $actual_err >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + elif $CMP $expectdata $actualdata; then + if [ ! -f $expectmeta ]; then + # Create the expect meta file if it doesn't yet exist. + echo " CREATED" + cp $actualmeta $expectmeta + elif $CMP $expectmeta $actualmeta; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actualdata $actual_err $actualmeta + fi + +} + # same as TOOLTEST but filters error stack outp # Extract file name, line number, version and thread IDs because they may be different TOOLTEST3() { @@ -539,6 +615,7 @@ TOOLTEST3() { # same as TOOLTEST3 but filters error stack output and compares to an error file # Extract file name, line number, version and thread IDs because they may be different +# ADD_H5ERR_MASK_TEST TOOLTEST4() { expect="$TESTDIR/$1" @@ -669,7 +746,7 @@ IMPORTTEST() ############################################################################## ############################################################################## -### T H E T E S T S ### +### T H E T E S T S ### ############################################################################## ############################################################################## # prepare for test @@ -677,6 +754,12 @@ COPY_TESTFILES_TO_TESTDIR #TOOLTEST h5dump-help.txt -h +# test data output redirection +TOOLTEST tnoddl.ddl --enable-error-stack --redirect-metadata=NULL -y packedbits.h5 +TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5 +TOOLTEST2 tnoddlfile.exp --enable-error-stack --redirect-metadata=NULL -y -o tnoddlfile.txt packedbits.h5 +TOOLTEST2A twithddlfile.exp twithddl.ddl --enable-error-stack --redirect-metadata=twithddl.txt -y -o twithddlfile.txt packedbits.h5 + # test for maximum display datasets TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5 @@ -954,12 +1037,11 @@ if test -z "$HDF5_NOCLEANUP"; then fi # test for dataset region references -TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 +TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5 TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5 -TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 +TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5 TOOLTEST4 tattrregR.ddl --enable-error-stack -R tattrreg.h5 - -TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 +TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5 # Clean up text output files if test -z "$HDF5_NOCLEANUP"; then @@ -998,7 +1080,7 @@ TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5 TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes -TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5 +TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5 # Report test results and exit |