summaryrefslogtreecommitdiffstats
path: root/tools/h5ls/testh5ls.sh.in
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-07-06 19:45:35 (GMT)
commit98754fa9d12090f5e048fdb05cc5e9ce9111676f (patch)
tree407e611b19ee551d8153779104022dd886a467e5 /tools/h5ls/testh5ls.sh.in
parent29321bcafa9f1c6108bb92b5a844a9d4d9c2c8e7 (diff)
downloadhdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.zip
hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.gz
hdf5-98754fa9d12090f5e048fdb05cc5e9ce9111676f.tar.bz2
[svn-r19050] Description:
Bring r18704:19049 from trunk to revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (amani) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in debug mode Mac OS X/32 10.6.3 (amazon) in debug mode Mac OS X/32 10.6.3 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/h5ls/testh5ls.sh.in')
-rw-r--r--tools/h5ls/testh5ls.sh.in49
1 files changed, 39 insertions, 10 deletions
diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in
index 5c81b6d..2f681ac 100644
--- a/tools/h5ls/testh5ls.sh.in
+++ b/tools/h5ls/testh5ls.sh.in
@@ -15,6 +15,10 @@
#
# Tests for the h5ls tool
+TESTNAME=h5ls
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+
H5LS=h5ls # The tool name
H5LS_BIN=`pwd`/$H5LS # The path of the tool binary
@@ -26,6 +30,7 @@ WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
nerrors=0
verbose=yes
+h5haveexitcode=yes # default is yes
# The build (current) directory might be different than the source directory.
if test -z "$srcdir"; then
@@ -33,6 +38,13 @@ if test -z "$srcdir"; then
fi
test -d ../testfiles || mkdir ../testfiles
+# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
+if [ -n "$RUNSERIAL_NOEXITCODE" ]; then
+ echo "***Warning*** Serial Exit Code is not passed back to shell corretly."
+ echo "***Warning*** Exit code checking is skipped."
+ h5haveexitcode=no
+fi
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
TESTING() {
@@ -70,7 +82,7 @@ TOOLTEST() {
exitcode=$?
cat $actual_err >> $actual
- if [ $exitcode -ne $retvalexpect ]; then
+ if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then
echo "*FAILED*"
nerrors="`expr $nerrors + 1`"
if [ yes = "$verbose" ]; then
@@ -129,17 +141,32 @@ TOOLTEST tdset-1.ls 0 -w80 -r -d tdset.h5
# test for displaying soft links
TOOLTEST tslink-1.ls 0 -w80 -r tslink.h5
-# test for displaying external and user-defined links
+# test for displaying more soft links with --follow-symlinks
+TOOLTEST tsoftlinks-1.ls 0 --follow-symlinks tsoftlinks.h5
+TOOLTEST tsoftlinks-2.ls 0 --follow-symlinks -r tsoftlinks.h5
+TOOLTEST tsoftlinks-3.ls 0 --follow-symlinks tsoftlinks.h5/group1
+TOOLTEST tsoftlinks-4.ls 0 --follow-symlinks -r tsoftlinks.h5/group1
+TOOLTEST tsoftlinks-5.ls 0 --follow-symlinks tsoftlinks.h5/soft_dset1
+
+# test for displaying external and user-defined links with --follow-symlinks
TOOLTEST textlink-1.ls 0 -w80 -r textlink.h5
-TOOLTEST textlinksrc-1.ls 0 -w80 -Er textlinksrc.h5
-TOOLTEST textlinksrc-2.ls 0 -w80 -Erv textlinksrc.h5/ext_link5
-TOOLTEST textlinksrc-3.ls 0 -w80 -Er textlinksrc.h5/ext_link1
+TOOLTEST textlinksrc-1.ls 0 -w80 --follow-symlinks -r textlinksrc.h5
+TOOLTEST textlinksrc-2.ls 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5
+TOOLTEST textlinksrc-3.ls 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1
TOOLTEST textlinksrc-4.ls 0 -w80 -r textlinksrc.h5
TOOLTEST textlinksrc-5.ls 0 -w80 -r textlinksrc.h5/ext_link1
-TOOLTEST textlinksrc-6.ls 0 -w80 -E textlinksrc.h5
-TOOLTEST textlinksrc-7.ls 0 -w80 -E textlinksrc.h5/ext_link1
+TOOLTEST textlinksrc-6.ls 0 -w80 --follow-symlinks textlinksrc.h5
+TOOLTEST textlinksrc-7.ls 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1
TOOLTEST tudlink-1.ls 0 -w80 -r tudlink.h5
+# test for displaying external links with -E
+# the option -E will be depriciated but keep it for backward compatibility
+TOOLTEST textlinksrc-1-old.ls 0 -w80 -Er textlinksrc.h5
+TOOLTEST textlinksrc-2-old.ls 0 -w80 -Erv textlinksrc.h5/ext_link5
+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 hard links
TOOLTEST thlink-1.ls 0 -w80 thlink.h5
@@ -194,7 +221,9 @@ fi
TOOLTEST tdset_idx.ls 0 -w80 -d tdset_idx.h5
if test $nerrors -eq 0 ; then
- echo "All h5ls tests passed."
+ echo "All $TESTNAME tests passed."
+ exit $EXIT_SUCCESS
+else
+ echo "$TESTNAME tests failed with $nerrors errors."
+ exit $EXIT_FAILURE
fi
-
-exit $nerrors