diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-12-23 22:00:43 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-12-23 22:00:43 (GMT) |
commit | 928d398be4143546e57c50788b429095328cb3ba (patch) | |
tree | 62e0c15ab90dead334cf25a99ba2eb4fe1322fd5 /tools/h5jam | |
parent | d03ae28886d062f7552334c204562a98bb7351e9 (diff) | |
parent | 92d4f32514e05a3cff1db0af0befcd489c74c1d3 (diff) | |
download | hdf5-928d398be4143546e57c50788b429095328cb3ba.zip hdf5-928d398be4143546e57c50788b429095328cb3ba.tar.gz hdf5-928d398be4143546e57c50788b429095328cb3ba.tar.bz2 |
[svn-r24593] merge from trunk
Diffstat (limited to 'tools/h5jam')
-rw-r--r-- | tools/h5jam/Makefile.am | 2 | ||||
-rw-r--r-- | tools/h5jam/Makefile.in | 3 | ||||
-rw-r--r-- | tools/h5jam/getub.c | 4 | ||||
-rw-r--r-- | tools/h5jam/testh5jam.sh.in | 21 |
4 files changed, 23 insertions, 7 deletions
diff --git a/tools/h5jam/Makefile.am b/tools/h5jam/Makefile.am index c6ccebf..62a5ba7 100644 --- a/tools/h5jam/Makefile.am +++ b/tools/h5jam/Makefile.am @@ -39,7 +39,7 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) # Temporary files. *.h5 are generated by jamgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES+=*.h5 +CHECK_CLEANFILES+=*.h5 testfiles/h5jam-*-sav testfiles/h5unjam-*-sav DISTCLEANFILES=testh5jam.sh include $(top_srcdir)/config/conclude.am diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 7256d6e..c16c300 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -445,7 +445,8 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. *.h5 are generated by jamgentest. They should # copied to the testfiles/ directory if update is required. -CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 +CHECK_CLEANFILES = *.chkexe *.chklog *.clog *.h5 testfiles/h5jam-*-sav \ + testfiles/h5unjam-*-sav # Include src and tools/lib directories INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index d84f7f2..3aff2b4 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -165,7 +165,7 @@ main (int argc, const char *argv[]) if (res < (long)size) { if (buf) - free (buf); + HDfree (buf); HDclose (fd); exit (EXIT_FAILURE); } @@ -173,7 +173,7 @@ main (int argc, const char *argv[]) HDwrite (1, buf, (unsigned)size); if (buf) - free (buf); + HDfree (buf); HDclose (fd); return (EXIT_SUCCESS); } 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." |