summaryrefslogtreecommitdiffstats
path: root/tools/h5stat
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-11-01 21:15:37 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-11-01 21:15:37 (GMT)
commit819b8099e24809cdb9c9e2e11078cffc0e754ace (patch)
treefc87a9a3666851cd012e7782b3f14e306dc55490 /tools/h5stat
parent2136f11a47ef28553d9e6e3ade726d28590087f3 (diff)
downloadhdf5-819b8099e24809cdb9c9e2e11078cffc0e754ace.zip
hdf5-819b8099e24809cdb9c9e2e11078cffc0e754ace.tar.gz
hdf5-819b8099e24809cdb9c9e2e11078cffc0e754ace.tar.bz2
[svn-r24392] Cleanup testfiles from scripts. Update lists of files to be cleaned. CMake update to clean testfiles.
Tested: local cmake, autools, and h5committest
Diffstat (limited to 'tools/h5stat')
-rw-r--r--tools/h5stat/testh5stat.sh.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in
index f780c97..865093a 100644
--- a/tools/h5stat/testh5stat.sh.in
+++ b/tools/h5stat/testh5stat.sh.in
@@ -37,6 +37,7 @@ EXIT_FAILURE=1
STAT=h5stat # The tool name
STAT_BIN=`pwd`/$STAT # The path of the tool binary
+RM='rm -rf'
CMP='cmp -s'
DIFF='diff -c'
CP='cp'
@@ -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
+}
+
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
#
@@ -294,6 +308,9 @@ TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5
TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5
#
+# Clean up temporary files/directories
+CLEAN_TESTFILES_AND_TESTDIR
+
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS