diff options
Diffstat (limited to 'tools/h5jam/testh5jam.sh.in')
-rw-r--r-- | tools/h5jam/testh5jam.sh.in | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index 86edbee..36f0657 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -34,6 +34,7 @@ UNJAM=h5unjam # Tool to test JAM_BIN="$RUNSERIAL "`pwd` # The path of the jam binary UNJAM_BIN=`pwd` # The path of the jam binary +RM='rm -rf' CMP='cmp -s' DIFF='diff -c' AWK='awk' @@ -122,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 line-line message left justified in a field of 70 characters # beginning with the word "Testing". # @@ -497,10 +511,10 @@ TOOLTEST_OUTPUT() { # Create the expect file if it doesn't yet exist. echo " CREATED" cp $actual $expect - rm -f $actual $actual_err + rm -f $actual $actual_sav $actual_err $actual_err_sav elif $CMP $expect $actual; then echo " PASSED" - rm -f $actual $actual_err + rm -f $actual $actual_sav $actual_err $actual_err_sav else echo "*FAILED*" echo " Expected result differs from actual result" @@ -675,7 +689,8 @@ UNJAMTEST taj3.h5 --delete tac3.h5 CHECKFILE $TESTDIR/tall.h5 tac3.h5 CLEANUP tac3.h5 taj3.h5 - +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." |