summaryrefslogtreecommitdiffstats
path: root/tools/h5copy
diff options
context:
space:
mode:
Diffstat (limited to 'tools/h5copy')
-rw-r--r--tools/h5copy/testh5copy.sh.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5copy/testh5copy.sh.in b/tools/h5copy/testh5copy.sh.in
index bec3bfc..77c64c4 100644
--- a/tools/h5copy/testh5copy.sh.in
+++ b/tools/h5copy/testh5copy.sh.in
@@ -67,6 +67,8 @@ H5DIFF_BIN=`pwd`/../h5diff/$H5DIFF # The path of the h5diff tool binary
H5LS=h5ls # The h5ls tool name
H5LS_ARGS=-Svr # Arguments to the h5ls tool
H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary
+
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -121,6 +123,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
+}
+
# Print a "SKIP" message
SKIP() {
@@ -578,6 +593,8 @@ COPY_REFERENCES
COPY_EXT_LINKS
TEST_MISC
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."