diff options
Diffstat (limited to 'tools/h5import/h5importtestutil.sh.in')
-rw-r--r-- | tools/h5import/h5importtestutil.sh.in | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5import/h5importtestutil.sh.in b/tools/h5import/h5importtestutil.sh.in index fd21dc1..e50ddac 100644 --- a/tools/h5import/h5importtestutil.sh.in +++ b/tools/h5import/h5importtestutil.sh.in @@ -25,6 +25,7 @@ TESTNAME=h5import EXIT_SUCCESS=0 EXIT_FAILURE=1 +RM='rm -rf' CP='cp' DIRNAME='dirname' LS='ls' @@ -147,6 +148,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 +} + TESTING() { SPACES=" " echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' @@ -350,6 +364,9 @@ else nerrors="` expr $nerrors + 1 `"; fi +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + # # Check errors result if test $nerrors -eq 0 ; then |