summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/testh5diff.sh.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5diff/testh5diff.sh.in b/tools/h5diff/testh5diff.sh.in
index 3455287..549da49 100644
--- a/tools/h5diff/testh5diff.sh.in
+++ b/tools/h5diff/testh5diff.sh.in
@@ -38,6 +38,7 @@ EXIT_FAILURE=1
H5DIFF=h5diff # The tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -336,6 +337,19 @@ COPY_TESTFILES_TO_TESTDIR()
done
}
+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`
+ 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
+ $RM $TESTDIR
+ fi
+}
+
# Parse option
# -p run ph5diff tests
# -h print help page
@@ -1096,6 +1110,9 @@ TOOLTEST h5diff_646.txt -v --use-system-epsilon -p 0.05 h5diff_basic1.h5 h5diff_
# # END
# ##############################################################################
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS