summaryrefslogtreecommitdiffstats
path: root/tools/h5dump/testh5dump.sh.in
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5dump/testh5dump.sh.in')
-rw-r--r--tools/h5dump/testh5dump.sh.in169
1 files changed, 151 insertions, 18 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 8a2483b..238eee9 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -31,7 +31,7 @@ H5IMPORT=../h5import/h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
-CMP='cmp -s'
+CMP='cmp'
DIFF='diff -c'
CP='cp'
DIRNAME='dirname'
@@ -56,8 +56,8 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
-TESTDIR=./testfiles
-test -d $TESTDIR || mkdir $TESTDIR
+TESTDIR=./testfiles/std
+test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
# test files
@@ -160,7 +160,6 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.h5
$SRC_H5DUMP_TESTFILES/tvldtypes5.h5
$SRC_H5DUMP_TESTFILES/tvlstr.h5
$SRC_H5DUMP_TESTFILES/tvms.h5
-$SRC_H5DUMP_TESTFILES/twidedisplay.ddl
"
LIST_OTHER_TEST_FILES="
@@ -176,6 +175,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 +261,16 @@ $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/tnoattrdata.ddl
+$SRC_H5DUMP_TESTFILES/tnoattrddl.ddl
+$SRC_H5DUMP_TESTFILES/tnodata.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
@@ -291,6 +299,8 @@ $SRC_H5DUMP_TESTFILES/tslink-D.ddl
$SRC_H5DUMP_TESTFILES/tsplit_file.ddl
$SRC_H5DUMP_TESTFILES/tstr-1.ddl
$SRC_H5DUMP_TESTFILES/tstr-2.ddl
+$SRC_H5DUMP_TESTFILES/tstr2bin2.exp
+$SRC_H5DUMP_TESTFILES/tstr2bin6.exp
$SRC_H5DUMP_TESTFILES/tstring.ddl
$SRC_H5DUMP_TESTFILES/tstring2.ddl
$SRC_H5DUMP_TESTFILES/tstringe.ddl
@@ -305,6 +315,10 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.ddl
$SRC_H5DUMP_TESTFILES/tvldtypes5.ddl
$SRC_H5DUMP_TESTFILES/tvlstr.ddl
$SRC_H5DUMP_TESTFILES/tvms.ddl
+$SRC_H5DUMP_TESTFILES/twidedisplay.ddl
+$SRC_H5DUMP_TESTFILES/twithddl.exp
+$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 +401,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"
@@ -419,13 +433,13 @@ TOOLTEST() {
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ 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 $actual_err $actual_sav $actual_err_sav $actual_ext
+ rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext
fi
}
@@ -434,6 +448,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 +497,111 @@ 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 .exp`.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 $DIFF $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 TOOLTEST2 but only compares the generated data file to the expected data file
+# used for the binary tests that expect a full path in -o with -b
+# ADD_H5_EXPORT_TEST
+TOOLTEST2B() {
+
+ expectdata="$TESTDIR/$1"
+ actualdata="$TESTDIR/`basename $1 .exp`.txt"
+ actual="$TESTDIR/`basename $1 .exp`.out"
+ actual_err="$TESTDIR/`basename $1 .exp`.err"
+ shift
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $DUMPER_BIN "$@"
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ 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
+ echo " PASSED"
+ 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
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actualdata $actual_err
+ 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 +659,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 +790,7 @@ IMPORTTEST()
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
# prepare for test
@@ -677,6 +798,15 @@ COPY_TESTFILES_TO_TESTDIR
#TOOLTEST h5dump-help.txt -h
+# test data output redirection
+TOOLTEST tnoddl.ddl --enable-error-stack --ddl -y packedbits.h5
+TOOLTEST tnodata.ddl --enable-error-stack --output packedbits.h5
+TOOLTEST tnoattrddl.ddl --enable-error-stack -O -y tattr.h5
+TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5
+TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5
+TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5
+TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5
+
# test for maximum display datasets
TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5
@@ -783,7 +913,7 @@ TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5
# test for wildcards in filename (does not work with cmake)
# inconsistent across platforms TOOLTEST3 tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5
-TOOLTEST4 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
+#TOOLTEST4 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
TOOLTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5
# test for files with empty data
@@ -924,17 +1054,21 @@ TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5
TOOLTEST tvms.ddl --enable-error-stack tvms.h5
# test for binary output
-TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinary.h5
+TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinary.h5
+
+# test for string binary output
+TOOLTEST2B tstr2bin2.exp --enable-error-stack -d /g2/dset2 -b -o tstr2bin2.txt tstr2.h5
+TOOLTEST2B tstr2bin6.exp --enable-error-stack -d /g6/dset6 -b -o tstr2bin6.txt tstr2.h5
# NATIVE default. the NATIVE test can be validated with h5import/h5diff
-TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5
+TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5
IMPORTTEST out1.bin -c out3.h5import -o out1.h5
DIFFTEST tbinary.h5 out1.h5 /integer /integer
# Same but use h5dump as input to h5import
IMPORTTEST out1.bin -c tbin1.ddl -o out1D.h5
DIFFTEST tbinary.h5 out1D.h5 /integer /integer
-TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5
+TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5
# the NATIVE test can be validated with h5import/h5diff
TOOLTEST tbin3.ddl --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5
@@ -954,12 +1088,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 +1131,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