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.in127
1 files changed, 78 insertions, 49 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index a5e8c4e..f941afc 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -6,12 +6,10 @@
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
-# the files COPYING and Copyright.html. COPYING can be found at the root
-# of the source code distribution tree; Copyright.html can be found at the
-# root level of an installed copy of the electronic HDF5 document set and
-# is linked from the top-level documents page. It can also be found at
-# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
-# access to either file, you may request a copy from help@hdfgroup.org.
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
#
# Tests for the h5dump tool
@@ -44,6 +42,8 @@ AWK='awk'
# Skip plugin module to test missing filter
ENVCMD="env HDF5_PLUGIN_PRELOAD=::"
+WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
+
nerrors=0
verbose=yes
@@ -98,6 +98,7 @@ $SRC_H5DUMP_TESTFILES/tattrintsize.h5
$SRC_H5DUMP_TESTFILES/tattrreg.h5
$SRC_H5DUMP_TESTFILES/tbigdims.h5
$SRC_H5DUMP_TESTFILES/tbinary.h5
+$SRC_H5DUMP_TESTFILES/tbitnopaque.h5
$SRC_H5DUMP_TESTFILES/tchar.h5
$SRC_H5DUMP_TESTFILES/tcmpdattrintsize.h5
$SRC_H5DUMP_TESTFILES/tcmpdintsize.h5
@@ -217,6 +218,8 @@ $SRC_H5DUMP_TESTFILES/tbin3.ddl
$SRC_H5DUMP_TESTFILES/tbin4.ddl
$SRC_H5DUMP_TESTFILES/tbinregR.ddl
$SRC_H5DUMP_TESTFILES/tbigdims.ddl
+$SRC_H5DUMP_TESTFILES/tbitnopaque_be.ddl
+$SRC_H5DUMP_TESTFILES/tbitnopaque_le.ddl
$SRC_H5DUMP_TESTFILES/tboot1.ddl
$SRC_H5DUMP_TESTFILES/tboot2.ddl
$SRC_H5DUMP_TESTFILES/tboot2A.ddl
@@ -275,7 +278,7 @@ $SRC_H5DUMP_TESTFILES/tints4dimsCountEq.ddl
$SRC_H5DUMP_TESTFILES/tints4dimsStride2.ddl
$SRC_H5DUMP_TESTFILES/tintsattrs.ddl
$SRC_H5DUMP_TESTFILES/tlarge_objname.ddl
-#$SRC_H5DUMP_TESTFILES/tldouble.ddl
+#$SRC_H5DUMP_TESTFILES/tldouble.ddl
$SRC_H5DUMP_TESTFILES/tlonglinks.ddl
$SRC_H5DUMP_TESTFILES/tloop-1.ddl
$SRC_H5DUMP_TESTFILES/tmulti.ddl
@@ -404,10 +407,10 @@ COPY_TESTFILES_TO_TESTDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $CP -f $tstfile $TESTDIR
+ $CP -f $tstfile $TESTDIR
if [ $? -ne 0 ]; then
echo "Error: FAILED to copy $tstfile ."
-
+
# Comment out this to CREATE expected file
exit $EXIT_FAILURE
fi
@@ -421,7 +424,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
# skip rm if srcdir is same as destdir
# this occurs when build/test performed in source dir and
# make cp fail
- SDIR=`$DIRNAME $tstfile`
+ SDIR=$SRC_H5DUMP_TESTFILES
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
@@ -452,14 +455,14 @@ TESTING() {
TOOLTEST() {
# 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
+ 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"
+ caseless=""
+ # stick with faster cmp if ignorecase is not requested.
+ xCMP="$CMP"
fi
expect="$TESTDIR/$1"
@@ -487,6 +490,8 @@ TOOLTEST() {
# 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
@@ -529,11 +534,15 @@ TOOLTEST2() {
# 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 $CMP $expect $actual; then
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actualdata $expectdata
+ echo " Expected data (*.exp) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expectdata $actualdata; then
echo " PASSED"
else
@@ -548,7 +557,7 @@ TOOLTEST2() {
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
@@ -556,7 +565,7 @@ TOOLTEST2() {
}
-# same as TOOLTEST2 but compares generated file to expected ddl file
+# 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
@@ -584,16 +593,22 @@ TOOLTEST2A() {
# 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 $CMP $expect $actual; then
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actualdata $expectdata
+ echo " Expected data (*.exp) missing"
+ nerrors="`expr $nerrors + 1`"
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
+ echo " Expected metafile (*.ddl) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expectmeta $actualmeta; then
echo " PASSED"
else
@@ -614,7 +629,7 @@ TOOLTEST2A() {
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
@@ -645,6 +660,8 @@ TOOLTEST2B() {
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actualdata $expectdata
+ echo " Expected data (*.exp) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expectdata $actualdata; then
echo " PASSED"
else
@@ -653,7 +670,7 @@ TOOLTEST2B() {
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
@@ -700,6 +717,8 @@ TOOLTEST3() {
# 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 $CMP $expect $actual; then
echo " PASSED"
else
@@ -757,15 +776,17 @@ TOOLTEST4() {
# 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 $CMP $expect $actual; then
if $CMP $expect_err $actual_ext; then
echo " PASSED"
- else
- echo "*FAILED*"
- echo " Expected result (*.err) differs from actual result (*.oerr)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /'
- fi
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.err) differs from actual result (*.oerr)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /'
+ fi
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
@@ -821,15 +842,17 @@ TOOLTEST5() {
# 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 $CMP $expect $actual; then
if $CMP $expect_err $actual_ext; then
echo " PASSED"
- else
- echo "*FAILED*"
- echo " Expected result (*.err) differs from actual result (*.oerr)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /'
- fi
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.err) differs from actual result (*.oerr)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_ext |sed 's/^/ /'
+ fi
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
@@ -863,6 +886,8 @@ TOOLTEST_HELP() {
# Create the expect data file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect-CREATED
+ echo " Expected output (*.txt) missing"
+ nerrors="`expr $nerrors + 1`"
elif $CMP $expect $actual; then
echo " PASSED"
else
@@ -870,7 +895,7 @@ TOOLTEST_HELP() {
echo " Expected output (*.txt) differs from actual output (*.out)"
nerrors="`expr $nerrors + 1`"
fi
-
+
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
rm -f $actual $actual_err
@@ -883,7 +908,7 @@ SKIP() {
TESTING $DUMPER $@
echo " -SKIP-"
}
-
+
# Print a line-line message left justified in a field of 70 characters
#
PRINT_H5DIFF() {
@@ -894,7 +919,7 @@ PRINT_H5DIFF() {
# Call the h5diff tool
#
-DIFFTEST()
+DIFFTEST()
{
PRINT_H5DIFF $@
(
@@ -908,7 +933,7 @@ DIFFTEST()
else
echo " PASSED"
fi
-
+
}
# Print a line-line message left justified in a field of 70 characters
@@ -921,7 +946,7 @@ PRINT_H5IMPORT() {
# Call the h5import tool
#
-IMPORTTEST()
+IMPORTTEST()
{
# remove the output hdf5 file if it exists
hdf5_file="$TESTDIR/$5"
@@ -932,7 +957,7 @@ IMPORTTEST()
PRINT_H5IMPORT $@
(
cd $TESTDIR
- $RUNSERIAL $H5IMPORT_BIN "$@"
+ $RUNSERIAL $H5IMPORT_BIN "$@"
)
RET=$?
if [ $RET != 0 ] ; then
@@ -941,7 +966,7 @@ IMPORTTEST()
else
echo " PASSED"
fi
-
+
}
@@ -1032,13 +1057,17 @@ TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5
# test for named data types
TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5
TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5
-# test for unamed type
+# test for unamed type
TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5
# test complicated compound datatype
TOOLTEST tcomp-4.ddl --enable-error-stack tcompound_complex.h5
-TOOLTEST tcompound_complex.ddl --enable-error-stack tcompound_complex2.h5
+TOOLTEST tcompound_complex2.ddl --enable-error-stack tcompound_complex2.h5
# tests for bitfields and opaque data types
-TOOLTEST tbitnopaque.ddl --enable-error-stack tbitnopaque.h5
+if test $WORDS_BIGENDIAN != "yes"; then
+TOOLTEST tbitnopaque_le.ddl --enable-error-stack tbitnopaque.h5
+else
+TOOLTEST tbitnopaque_be.ddl --enable-error-stack tbitnopaque.h5
+fi
#test for the nested compound type
TOOLTEST tnestcomp-1.ddl --enable-error-stack tnestedcomp.h5
@@ -1055,7 +1084,7 @@ TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5
# test for loop detection
TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5
-# test for string
+# test for string
TOOLTEST tstr-1.ddl --enable-error-stack tstr.h5
TOOLTEST tstr-2.ddl --enable-error-stack tstr2.h5
@@ -1156,7 +1185,7 @@ TOOLTEST tcompact.ddl --enable-error-stack -H -p -d compact tfilters.h5
TOOLTEST tcontiguos.ddl --enable-error-stack -H -p -d contiguous tfilters.h5
# chunked
TOOLTEST tchunked.ddl --enable-error-stack -H -p -d chunked tfilters.h5
-# external
+# external
TOOLTEST texternal.ddl --enable-error-stack -H -p -d external tfilters.h5
# fill values
@@ -1225,7 +1254,7 @@ fi
# test for displaying objects with very long names
TOOLTEST tlonglinks.ddl --enable-error-stack tlonglinks.h5
-# dimensions over 4GB, print boundary
+# dimensions over 4GB, print boundary
TOOLTEST tbigdims.ddl --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5
# hyperslab read
@@ -1233,7 +1262,7 @@ TOOLTEST thyperslab.ddl --enable-error-stack thyperslab.h5
#
-
+
# test for displaying dataset and attribute of null space
TOOLTEST tnullspace.ddl --enable-error-stack tnullspace.h5
@@ -1272,7 +1301,7 @@ IMPORTTEST out3.bin -c tbin3.ddl -o out3D.h5
DIFFTEST tbinary.h5 out3D.h5 /integer /integer
TOOLTEST tbin4.ddl --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5
-
+
# Clean up binary output files
if test -z "$HDF5_NOCLEANUP"; then
rm -f out[1-4].bin
@@ -1280,7 +1309,7 @@ if test -z "$HDF5_NOCLEANUP"; then
rm -f out3.h5
fi
-# test for dataset region references
+# test for dataset region references
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