summaryrefslogtreecommitdiffstats
path: root/tools/test/h5ls
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test/h5ls')
-rw-r--r--tools/test/h5ls/CMakeTests.cmake21
-rw-r--r--tools/test/h5ls/testh5ls.sh.in59
2 files changed, 51 insertions, 29 deletions
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index e7a5dd6..a66ae40 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -261,6 +261,19 @@
set (last_test "H5LS-clearall-objects")
endif (HDF5_ENABLE_USING_MEMCHECKER)
+# See which filters are usable (and skip tests for filters we
+# don't have). Do this by searching H5pubconf.h to see which
+# filters are defined.
+
+# detect whether the encoder is present.
+ if (H5_HAVE_FILTER_DEFLATE)
+ set (USE_FILTER_DEFLATE "true")
+ endif (H5_HAVE_FILTER_DEFLATE)
+
+ if (H5_HAVE_FILTER_SZIP)
+ set (USE_FILTER_SZIP "true")
+ endif (H5_HAVE_FILTER_SZIP)
+
# test the help syntax
ADD_H5_TEST (help-1 0 -w80 -h)
ADD_H5_TEST (help-2 0 -w80 --help)
@@ -392,6 +405,8 @@
endif (H5_WORDS_BIGENDIAN)
# test for file with datasets that use Fixed Array chunk indices
-#echo "***skip testing tdset_idx.h5"
-ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5)
-
+ if (USE_FILTER_DEFLATE)
+ # data read internal filters
+ ADD_H5_TEST (tdset_idx 0 -w80 -d tdset_idx.h5)
+ endif (USE_FILTER_DEFLATE)
+
diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in
index e2a72ba..15282f6 100644
--- a/tools/test/h5ls/testh5ls.sh.in
+++ b/tools/test/h5ls/testh5ls.sh.in
@@ -17,6 +17,9 @@
srcdir=@srcdir@
+USE_FILTER_SZIP="@USE_FILTER_SZIP@"
+USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
+
TESTNAME=h5ls
EXIT_SUCCESS=0
EXIT_FAILURE=1
@@ -180,10 +183,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
@@ -238,10 +241,10 @@ TOOLTEST() {
# any unexpected output from that stream too.
TESTING $H5LS $@
(
- cd $TESTDIR
+ cd $TESTDIR
$RUNSERIAL $H5LS_BIN "$@"
- ) >$actual 2>$actual_err
-
+ ) >$actual 2>$actual_err
+
exitcode=$?
# save actual and actual_err in case they are needed later.
cp $actual $actual_sav
@@ -250,37 +253,37 @@ TOOLTEST() {
STDERR_FILTER $actual_err
cat $actual_err >> $actual
if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then
- echo "*FAILED*"
- nerrors="`expr $nerrors + 1`"
- if [ yes = "$verbose" ]; then
- echo "test returned with exit code $exitcode"
- echo "test output: (up to $NLINES lines)"
- head -$NLINES $actual
- echo "***end of test output***"
- echo ""
- fi
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ if [ yes = "$verbose" ]; then
+ echo "test returned with exit code $exitcode"
+ echo "test output: (up to $NLINES lines)"
+ head -$NLINES $actual
+ echo "***end of test output***"
+ echo ""
+ fi
elif [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
+ # Create the expect file if it doesn't yet exist.
echo " CREATED"
cp $actual $expect
elif $CMP $expect $actual; then
echo " PASSED"
else
echo "*FAILED*"
- echo " Expected result differs from actual result"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ echo " Expected result differs from actual result"
+ 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
+ rm -f $actual $actual_err $actual_sav $actual_err_sav
fi
}
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
# prepare for test
@@ -339,7 +342,7 @@ TOOLTEST textlinksrc-3-old.ls 0 -w80 -Er textlinksrc.h5/ext_link1
TOOLTEST textlinksrc-6-old.ls 0 -w80 -E textlinksrc.h5
TOOLTEST textlinksrc-7-old.ls 0 -w80 -E textlinksrc.h5/ext_link1
-# tests for no-dangling-links
+# tests for no-dangling-links
# if this option is given on dangling link, h5ls should return exit code 1
# when used alone , expect to print out help and return exit code 1
TOOLTEST textlinksrc-nodangle-1.ls 1 -w80 --no-dangling-links textlinksrc.h5
@@ -374,7 +377,7 @@ TOOLTEST tnestcomp-4.ls 0 -w80 -r -d -l -S tnestedcomp.h5
# test for loop detection
TOOLTEST tloop-1.ls 0 -w80 -r -d tloop.h5
-# test for string
+# test for string
TOOLTEST tstr-1.ls 0 -w80 -r -d tstr.h5
# test test file created from lib SAF team
@@ -405,22 +408,26 @@ fi
# test for non-existing file
TOOLTEST nosuchfile.ls 1 nosuchfile.h5
-# test for variable length data types in verbose mode
+# test for variable length data types in verbose mode
if test $WORDS_BIGENDIAN != "yes"; then
TOOLTEST tvldtypes2le.ls 0 -v tvldtypes1.h5
else
TOOLTEST tvldtypes2be.ls 0 -v tvldtypes1.h5
-fi
+fi
-# test for dataset region references data types in verbose mode
+# test for dataset region references data types in verbose mode
if test $WORDS_BIGENDIAN != "yes"; then
TOOLTEST tdataregle.ls 0 -v tdatareg.h5
else
TOOLTEST tdataregbe.ls 0 -v tdatareg.h5
-fi
+fi
# test for file with datasets that use Fixed Array chunk indices
+if test $USE_FILTER_DEFLATE = "yes" ; then
+ # data read internal filters
+ TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5
+fi
echo "***skip testing tdset_idx.h5"
TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5