diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2013-11-01 21:15:37 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2013-11-01 21:15:37 (GMT) |
commit | 819b8099e24809cdb9c9e2e11078cffc0e754ace (patch) | |
tree | fc87a9a3666851cd012e7782b3f14e306dc55490 /tools/h5repack | |
parent | 2136f11a47ef28553d9e6e3ade726d28590087f3 (diff) | |
download | hdf5-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/h5repack')
-rw-r--r-- | tools/h5repack/h5repack.sh.in | 17 | ||||
-rw-r--r-- | tools/h5repack/h5repack_plugin.sh.in | 19 |
2 files changed, 35 insertions, 1 deletions
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 583b6ef..045aebf 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -42,6 +42,7 @@ H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary H5DUMP=../h5dump/h5dump # The h5dump tool name H5DUMP_BIN=`pwd`/$H5DUMP # The path of the h5dump tool binary +RM='rm -rf' GREP='grep' CP='cp' DIRNAME='dirname' @@ -161,6 +162,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 $* message left justified in a field of 70 characters # MESSAGE() { @@ -1088,6 +1102,9 @@ TOOLTEST HDFFV-7840 h5diff_attr1.h5 TOOLTEST_META meta_short h5repack_layout.h5 -M 8192 TOOLTEST_META meta_long h5repack_layout.h5 --metadata_block_size=8192 +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." exit $EXIT_SUCCESS diff --git a/tools/h5repack/h5repack_plugin.sh.in b/tools/h5repack/h5repack_plugin.sh.in index a45d1fe..df4b374 100644 --- a/tools/h5repack/h5repack_plugin.sh.in +++ b/tools/h5repack/h5repack_plugin.sh.in @@ -35,7 +35,7 @@ TEST_NAME=ud_plugin FROM_DIR=`pwd`/.libs PLUGIN_LIB="$FROM_DIR/libdynlibadd.*" PLUGIN_LIBDIR=testdir3 -RM="rm -rf" +RM='rm -rf' GREP='grep' CP='cp' @@ -118,6 +118,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 $* message left justified in a field of 70 characters # MESSAGE() { @@ -233,6 +246,10 @@ else exit_code=$EXIT_SUCCESS fi +# Clean up temporary files/directories +CLEAN_TESTFILES_AND_TESTDIR + # Clean up temporary files/directories and leave $RM $PLUGIN_LIBDIR + exit $exit_code |