diff options
Diffstat (limited to 'tools')
33 files changed, 227 insertions, 174 deletions
diff --git a/tools/Makefile.in b/tools/Makefile.in index e482ea2..f403257 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -330,12 +330,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -845,7 +845,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -916,7 +916,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5copy/Makefile.in b/tools/h5copy/Makefile.in index d2a8e0d..113abba 100644 --- a/tools/h5copy/Makefile.in +++ b/tools/h5copy/Makefile.in @@ -322,12 +322,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -839,7 +839,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -910,7 +910,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index f2a41ae..2d5b95d 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -428,7 +428,7 @@ main (int argc, const char *argv[]) h5tools_close(); - return 0; + return EXIT_SUCCESS; error: printf("Error in copy...Exiting\n"); @@ -449,6 +449,6 @@ error: h5tools_close(); - return 1; + return EXIT_FAILURE; } diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index c374e08..4f1d8cc 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -19,6 +19,10 @@ # Thursday, July 20, 2006 # +TESTNAME=h5copy +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5COPY=h5copy # The tool name H5COPY_BIN=`pwd`/$H5COPY # The path of the tool binary H5DIFF=h5diff # The h5diff tool name @@ -300,8 +304,9 @@ COPYOBJECTS if test $nerrors -eq 0 ; then - echo "All h5copy tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors - diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 04a64da..e11ee1f 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -329,12 +329,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -860,7 +860,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -931,7 +931,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index dec91d3..f95e260 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -56,6 +56,10 @@ FILE10="$INDIR/$SRCFILE10" FILE11="$INDIR/$SRCFILE11" +TESTNAME=h5diff +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5DIFF=h5diff # The tool name H5DIFF_BIN=`pwd`/$H5DIFF # The path of the tool binary @@ -80,6 +84,7 @@ test -d ./testfiles || mkdir ./testfiles while [ $# -gt 0 ]; do case "$1" in -p) # reset the tool name and bin to run ph5diff tests + TESTNAME=ph5diff H5DIFF=ph5diff # The tool name H5DIFF_BIN=`pwd`/$H5DIFF pmode=yes @@ -201,7 +206,6 @@ TOOLTEST() { fi # Run test. - #TESTING $H5DIFF $@ ( #echo "#############################" #echo "Expected output for '$H5DIFF $@'" @@ -617,7 +621,9 @@ TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9 # ############################################################################## if test $nerrors -eq 0 ; then - echo "All $H5DIFF tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors diff --git a/tools/h5diff/testph5diff.sh b/tools/h5diff/testph5diff.sh index 1375756..0734d21 100755 --- a/tools/h5diff/testph5diff.sh +++ b/tools/h5diff/testph5diff.sh @@ -19,6 +19,10 @@ if test -z "$srcdir"; then srcdir=. fi +TESTNAME=ph5diff +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + TOOL=${srcdir}/testh5diff.sh nerrors=0 @@ -53,12 +57,10 @@ TOOLTEST() { # testphdf5 test using the MPI-POSIX VFL driver TOOLTEST -p -# Emit message about testing status +# no need to print any message since this is just a shell to invoke +# testh5diff.sh which has already printed the result. Just exit. if test $nerrors -eq 0 ; then - echo "All $TEST_APP tests passed." + exit $EXIT_SUCCESS else - echo "ERROR! One or more $TOOL tests failed." + exit $EXIT_FAILURE fi - -# Propagate a useful exit code -exit $nerrors diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 8ca6684..1791da5 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -327,12 +327,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -851,7 +851,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -922,7 +922,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index ad8b1af..6e661df 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -2707,15 +2707,12 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) H5D_fill_time_t ft; hsize_t storage_size; haddr_t ioffset; - int i, next; + int i; unsigned j; storage_size = H5Dget_storage_size(obj_id); nfilters = H5Pget_nfilters(dcpl_id); ioffset = H5Dget_offset(obj_id); - next = H5Pget_external_count(dcpl_id); - if(next < 0) - return; HDstrcpy(f_name,"\0"); /*------------------------------------------------------------------------- @@ -2821,6 +2818,10 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) printf("%s\n",END); } else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { + int next; + + next = H5Pget_external_count(dcpl_id); + /*------------------------------------------------------------------------- * EXTERNAL_FILE *------------------------------------------------------------------------- @@ -4512,17 +4513,13 @@ print_enum(hid_t type) unsigned char *value = NULL; /*value array */ unsigned char *copy = NULL; /*a pointer to value array */ unsigned nmembs; /*number of members */ - int snmembs; int nchars; /*number of output characters */ hid_t super; /*enum base integer type */ hid_t native = -1; /*native integer datatype */ size_t dst_size; /*destination value type size */ unsigned i; - snmembs = H5Tget_nmembers(type); - if(snmembs < 0) - return; - nmembs = (unsigned)snmembs; + nmembs = (unsigned)H5Tget_nmembers(type); super = H5Tget_super(type); /* @@ -6695,17 +6692,13 @@ xml_print_enum(hid_t type) char **name = NULL; /*member names */ unsigned char *value = NULL; /*value array */ unsigned nmembs; /*number of members */ - int snmembs; hid_t super; /*enum base integer type */ hid_t native = -1; /*native integer datatype */ size_t dst_size; /*destination value type size */ unsigned i; /*miscellaneous counters */ size_t j; - snmembs = H5Tget_nmembers(type); - if(snmembs < 0) - return; - nmembs = (unsigned)snmembs; + nmembs = (unsigned)H5Tget_nmembers(type); super = H5Tget_super(type); indentation(indent); diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 2c2f69f..a147b45 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -23,6 +23,10 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" USE_FILTER_NBIT="@USE_FILTER_NBIT@" USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" +TESTNAME=h5dump +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + DUMPER=h5dump # The tool name DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary TESTDIR=`pwd`/../testfiles @@ -508,11 +512,10 @@ TOOLTEST textlinksrc.ddl textlinksrc.h5 TOOLTEST textlinkfar.ddl textlinkfar.h5 - - if test $nerrors -eq 0 ; then - echo "All $DUMPER tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors - diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index 3e81a05..c4c8657 100755 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -15,6 +15,10 @@ # # Tests for the h5dump tool +TESTNAME=h5dumpxml +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5_LONE_COLON="@H5_LONE_COLON@" DUMPER=h5dump # The tool name @@ -185,10 +189,10 @@ TOOLTEST torderattr3.h5.xml --xml -H --sort_by=creation_order --sort_order=ascen TOOLTEST torderattr4.h5.xml --xml -H --sort_by=creation_order --sort_order=descending torderattr.h5 - - if test $nerrors -eq 0 ; then - echo "All $DUMPER tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in index 15fcf90..620d0c0 100755 --- a/tools/h5import/Makefile.in +++ b/tools/h5import/Makefile.in @@ -322,12 +322,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -833,7 +833,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -904,7 +904,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 60ef494..e9e7dac 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -116,7 +116,7 @@ int main(int argc, char *argv[]) case 6: /* -h found; help, then exit */ help(argv[0]); - exit(0); + exit(EXIT_SUCCESS); break; case 7: /* -d found; look for dimensions */ diff --git a/tools/h5import/h5importtestutil.sh b/tools/h5import/h5importtestutil.sh index 0409b46..9ec8e15 100755 --- a/tools/h5import/h5importtestutil.sh +++ b/tools/h5import/h5importtestutil.sh @@ -16,8 +16,12 @@ # HDF Utilities Test script # Usage: h5importtestutil.sh [machine-type] +TESTNAME=h5import +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + # initialize errors variable -errors=0 +nerrors=0 TESTING() { SPACES=" " @@ -37,7 +41,7 @@ cd .. cmp -s tmp_testfiles/log1 log2 || err=1 rm -f log2 tmp_testfiles/log1 if [ $err -eq 1 ]; then -errors="` expr $errors + 1 `"; +nerrors="` expr $nerrors + 1 `"; echo "*FAILED*" else echo " PASSED" @@ -108,18 +112,15 @@ rm -f *.txt *.bin *.h5 rm -rf tmp_testfiles else echo "** h5import or h5importtest not available ***" - errors="` expr $errors + 1 `"; + nerrors="` expr $nerrors + 1 `"; fi # # Check errors result -if [ $errors -eq 0 ]; then - echo "======================================" - echo " H5IMPORT Utilities tests have passed." - echo "======================================" +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS else - echo "*********************************************" - echo " H5IMPORT Utilities tests encountered errors" - echo "*********************************************" + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi -exit $errors diff --git a/tools/h5jam/Makefile.in b/tools/h5jam/Makefile.in index 5509801..fe7fbd7 100644 --- a/tools/h5jam/Makefile.in +++ b/tools/h5jam/Makefile.in @@ -336,12 +336,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -864,7 +864,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -935,7 +935,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index c6fdb5c..cceed75 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -454,7 +454,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, if (nchars <= 0) { printf ("huh? \n"); - exit (1); + exit (EXIT_FAILURE); } /*ncw = */ HDwrite (outfid, buf, (unsigned) nchars); diff --git a/tools/h5jam/testh5jam.sh.in b/tools/h5jam/testh5jam.sh.in index e17c860..cfefcdc 100644 --- a/tools/h5jam/testh5jam.sh.in +++ b/tools/h5jam/testh5jam.sh.in @@ -21,6 +21,10 @@ USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" +TESTNAME=h5jam/h5unjam +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + DUMPER=h5dump # The dumper to use DUMPER_BIN=`pwd`/../$DUMPER # The path of the dumper binary JAM=h5jam # Tool to test @@ -526,7 +530,9 @@ CLEANUP tac3.h5 taj3.h5 if test $nerrors -eq 0 ; then - echo "All $JAM tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in index c11dc43..fdd09c6 100644 --- a/tools/h5ls/Makefile.in +++ b/tools/h5ls/Makefile.in @@ -316,12 +316,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -814,7 +814,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -885,7 +885,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5ls/testh5ls.sh.in b/tools/h5ls/testh5ls.sh.in index ddb09b5..076c529 100644 --- a/tools/h5ls/testh5ls.sh.in +++ b/tools/h5ls/testh5ls.sh.in @@ -15,6 +15,10 @@ # # Tests for the h5ls tool +TESTNAME=h5ls +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5LS=h5ls # The tool name H5LS_BIN=`pwd`/$H5LS # The path of the tool binary @@ -192,7 +196,9 @@ fi if test $nerrors -eq 0 ; then - echo "All h5ls tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in index dd33879..aa7781e 100644 --- a/tools/h5repack/Makefile.in +++ b/tools/h5repack/Makefile.in @@ -336,12 +336,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -887,7 +887,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -958,7 +958,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index e9aae81..69f5059 100755 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -27,6 +27,10 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" USE_FILTER_NBIT="@USE_FILTER_NBIT@" USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" +TESTNAME=h5repack +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5REPACK=h5repack # The tool name H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary @@ -528,8 +532,10 @@ TOOLTEST $FILE15 TOOLTEST1 $FILE16 if test $nerrors -eq 0 ; then - echo "All $H5REPACK tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi -exit $nerrors - diff --git a/tools/h5stat/Makefile.in b/tools/h5stat/Makefile.in index 08de49b..a9bedaa 100644 --- a/tools/h5stat/Makefile.in +++ b/tools/h5stat/Makefile.in @@ -345,12 +345,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -907,7 +907,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -978,7 +978,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index 66d05be..e387eb1 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -23,6 +23,10 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" USE_FILTER_NBIT="@USE_FILTER_NBIT@" USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" +TESTNAME=h5stat +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + STAT=h5stat # The tool name STAT_BIN=`pwd`/$STAT # The path of the tool binary @@ -124,12 +128,12 @@ TOOLTEST h5stat_filters-dT.ddl -dT h5stat_filters.h5 TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5 # h5stat_newgrat.h5 is generated by h5stat_gentest.c TOOLTEST h5stat_newgrat.ddl h5stat_newgrat.h5 -echo if test $nerrors -eq 0 ; then - echo "All $STAT tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors - diff --git a/tools/lib/Makefile.in b/tools/lib/Makefile.in index 2b269ca..09c8edf 100644 --- a/tools/lib/Makefile.in +++ b/tools/lib/Makefile.in @@ -315,12 +315,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -796,7 +796,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -867,7 +867,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 808ec85..f510a5b 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -2082,8 +2082,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c } /* hyperslab_count loop */ CATCH - - if (sm_buf) + if(sm_buf) HDfree(sm_buf); return ret_value; @@ -3385,10 +3384,9 @@ h5tools_print_enum(h5tools_str_t *buffer, hid_t type) } CATCH - if(name) { /* Release resources */ - for (i = 0; i < nmembs; i++) + for(i = 0; i < nmembs; i++) if(name[i]) free(name[i]); free(name); @@ -3400,7 +3398,7 @@ CATCH if(super >= 0 && H5Tclose(super) < 0) H5E_THROW(FAIL, H5E_tools_min_id_g, "Could not close datatype's super class"); - if (0 == nmembs) + if(0 == nmembs) h5tools_str_append(buffer, "\n<empty>"); return ret_value; diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in index a3d3e23..0b8ccb6 100644 --- a/tools/misc/Makefile.in +++ b/tools/misc/Makefile.in @@ -370,12 +370,12 @@ CP = cp # Some machines need a command to run executables; this is that command # so that our tests will run. -# We use RUNTESTS instead of RUNSERIAL directly because it may be that +# We use RUNEXEC instead of RUNSERIAL directly because it may be that # some tests need to be run with a different command. Older versions # of the makefiles used the command # $(LIBTOOL) --mode=execute # in some directories, for instance. -RUNTESTS = $(RUNSERIAL) +RUNEXEC = $(RUNSERIAL) # Libraries to link to while building LIBHDF5 = $(top_builddir)/src/libhdf5.la @@ -969,7 +969,7 @@ $(TEST_PROG_CHKEXE) $(TEST_PROG_PARA_CHKEXE) dummy.chkexe_: fi; \ echo "============================" >> $${log}; \ srcdir="$(srcdir)" \ - $(TIME) $(RUNTESTS) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ + $(TIME) $(RUNEXEC) ./$${tname} $(TEST_FLAGS) >> $${log} 2>&1 \ && touch $(@:.chkexe_=.chkexe) || \ (test $$HDF5_Make_Ignore && echo "*** Error ignored") || \ (cat $${log} && false) || exit 1; \ @@ -1040,7 +1040,7 @@ build-check-p: $(LIB) $(PROGS) $(TESTS) @for test in $(TEST_PROG_PARA) dummy; do \ if test $$test != dummy; then \ $(MAKE) $(AM_MAKEFLAGS) $$test.chkexe_ \ - RUNTESTS="$(RUNPARALLEL)" || exit 1; \ + RUNEXEC="$(RUNPARALLEL)" || exit 1; \ fi; \ done @for test in $(TEST_SCRIPT_PARA) dummy; do \ diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index 28f0dee..c274f3f 100755 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -38,6 +38,10 @@ HL="@HL@" ## ## ############################################################################ +# Constants definitions +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + host_os="@host_os@" prog_name="`basename $0`" @@ -95,7 +99,7 @@ usage() { echo " HDF5_USE_SHLIB=[yes|no] - use shared or static version of the HDF5 library" echo " [default: no]" echo " " - exit 1 + exit $EXIT_FAILURE } # Show the configuration summary of the library recorded in the @@ -107,7 +111,7 @@ showconfigure() } # Main -status=0 +status=$EXIT_SUCCESS if test "$#" = "0"; then # No parameters specified, issue usage statement and exit. diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index 1452a64..a6fdc56 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -319,6 +319,6 @@ main(int argc, const char *argv[]) /* Shut down h5tools lib */ h5tools_close(); - return 0; + return EXIT_SUCCESS; } /* end main() */ diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in index 6abca62..ae79b70 100755 --- a/tools/misc/h5redeploy.in +++ b/tools/misc/h5redeploy.in @@ -18,6 +18,10 @@ ## in a new location. ## For help page, use "h5redeploy -help" +# Constants definitions +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + # Function definitions # show help page @@ -34,7 +38,7 @@ usage() { echo " directory and writable. [default: $h5tools]" echo " -show Show the commands without executing them" echo " " - exit 1 + exit $EXIT_FAILURE } # display variable values @@ -96,7 +100,7 @@ for arg in $@ ; do *) ERROR "Unknown Option($arg)" usage - exit 1 + exit $EXIT_FAILURE ;; esac done @@ -104,7 +108,7 @@ done # Sanity checks if [ ! -d $prefix ]; then ERROR "prefix($prefix) is not an existing directory" - exit 1 + exit $EXIT_FAILURE fi for x in $h5tools; do @@ -112,14 +116,14 @@ for x in $h5tools; do foundtools="$foundtools $x" if [ ! -w $x ]; then ERROR "h5tool($x) is not writable" - exit 1 + exit $EXIT_FAILURE fi fi done if [ -z "$foundtools" ]; then ERROR "found no tools to modify" - exit 1 + exit $EXIT_FAILURE fi # Show actions to be taken and get consent @@ -131,7 +135,7 @@ if [ x-$fmode = x- ]; then ans=`echo $ansx | tr "[A-Z]" "[a-z]"` if [ x-$ans != x-yes ]; then echo ABORT. No tools changed. - exit 1 + exit $EXIT_FAILURE fi fi @@ -166,7 +170,7 @@ done # Cleanup rm -f $CMDFILE -exit 0 +exit $EXIT_SUCCESS # Some possible future features to add # CCBASE - Name of the alternative C compiler diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index 91df7b6..d41dfc9 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -98,7 +98,7 @@ usage (const char *progname) "`k' for kB.\n"); fprintf(stderr, "File family names include an integer printf " "format such as `%%d'\n"); - exit (1); + exit (EXIT_FAILURE); } @@ -238,7 +238,7 @@ main (int argc, char *argv[]) } else if (!strcmp(argv[argno], "-V")) { printf("This is %s version %u.%u release %u\n", prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); - exit(0); + exit(EXIT_SUCCESS); } else if (!strcmp (argv[argno], "-family_to_sec2")) { family_to_sec2 = TRUE; argno++; @@ -262,12 +262,12 @@ main (int argc, char *argv[]) if ((src=HDopen(src_name, O_RDONLY,0))<0) { perror (src_name); - exit (1); + exit (EXIT_FAILURE); } if (HDfstat(src, &sb)<0) { perror ("fstat"); - exit (1); + exit (EXIT_FAILURE); } src_size = src_act_size = sb.st_size; if (verbose) fprintf (stderr, "< %s\n", src_name); @@ -282,7 +282,7 @@ main (int argc, char *argv[]) if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) { perror (dst_name); - exit (1); + exit (EXIT_FAILURE); } if (verbose) fprintf (stderr, "> %s\n", dst_name); @@ -308,10 +308,10 @@ main (int argc, char *argv[]) n = (size_t)MIN ((off_t)n, src_act_size-src_offset); if ((nio=HDread (src, buf, n))<0) { perror ("read"); - exit (1); + exit (EXIT_FAILURE); } else if ((size_t)nio!=n) { fprintf (stderr, "%s: short read\n", src_name); - exit (1); + exit (EXIT_FAILURE); } for (i=0; i<n; i++) { if (buf[i]) break; @@ -331,14 +331,14 @@ main (int argc, char *argv[]) if (need_write) { if (need_seek && HDlseek (dst, dst_offset, SEEK_SET)<0) { perror ("HDlseek"); - exit (1); + exit (EXIT_FAILURE); } if ((nio=HDwrite (dst, buf, n))<0) { perror ("write"); - exit (1); + exit (EXIT_FAILURE); } else if ((size_t)nio!=n) { fprintf (stderr, "%s: short write\n", dst_name); - exit (1); + exit (EXIT_FAILURE); } need_seek = FALSE; } else { @@ -366,11 +366,11 @@ main (int argc, char *argv[]) break; } else if (src<0) { perror (src_name); - exit (1); + exit (EXIT_FAILURE); } if (HDfstat (src, &sb)<0) { perror ("fstat"); - exit (1); + exit (EXIT_FAILURE); } src_act_size = sb.st_size; if (src_act_size>src_size) { @@ -391,26 +391,26 @@ main (int argc, char *argv[]) if (0==dst_membno) { if (HDlseek (dst, dst_size-1, SEEK_SET)<0) { perror ("HDHDlseek"); - exit (1); + exit (EXIT_FAILURE); } if (HDread (dst, buf, 1)<0) { perror ("read"); - exit (1); + exit (EXIT_FAILURE); } if (HDlseek (dst, dst_size-1, SEEK_SET)<0) { perror ("HDlseek"); - exit (1); + exit (EXIT_FAILURE); } if (HDwrite (dst, buf, 1)<0) { perror ("write"); - exit (1); + exit (EXIT_FAILURE); } } HDclose (dst); sprintf (dst_name, dst_gen_name, ++dst_membno); if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) { perror (dst_name); - exit (1); + exit (EXIT_FAILURE); } dst_offset = 0; need_seek = FALSE; @@ -426,19 +426,19 @@ main (int argc, char *argv[]) if (need_seek) { if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) { perror ("HDlseek"); - exit (1); + exit (EXIT_FAILURE); } if (HDread (dst, buf, 1)<0) { perror ("read"); - exit (1); + exit (EXIT_FAILURE); } if (HDlseek (dst, dst_offset-1, SEEK_SET)<0) { perror ("HDlseek"); - exit (1); + exit (EXIT_FAILURE); } if (HDwrite (dst, buf, 1)<0) { perror ("write"); - exit (1); + exit (EXIT_FAILURE); } } HDclose (dst); @@ -447,7 +447,7 @@ main (int argc, char *argv[]) * These private properties are for this tool only. */ if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) { perror ("H5Pcreate"); - exit (1); + exit (EXIT_FAILURE); } if(family_to_sec2) { @@ -456,7 +456,7 @@ main (int argc, char *argv[]) * driver information saved in the superblock. */ if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SEC2_NAME, &family_to_sec2) < 0) { perror ("H5Pset"); - exit (1); + exit (EXIT_FAILURE); } } else { /* Modify family size saved in superblock through private property. It signals @@ -464,14 +464,14 @@ main (int argc, char *argv[]) * This private property is for this tool only. */ if(H5Pset_fapl_family(fapl, H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) { perror ("H5Pset_fapl_family"); - exit (1); + exit (EXIT_FAILURE); } /* Set the property of the new member size as hsize_t */ hdsize = dst_size; if(H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) { perror ("H5Pset"); - exit (1); + exit (EXIT_FAILURE); } } @@ -488,16 +488,16 @@ main (int argc, char *argv[]) if(file>=0) { if(H5Fclose(file)<0) { perror ("H5Fclose"); - exit (1); + exit (EXIT_FAILURE); } } if(H5Pclose(fapl)<0) { perror ("H5Pclose"); - exit (1); + exit (EXIT_FAILURE); } /* Free resources and return */ free (buf); - return 0; + return EXIT_SUCCESS; } diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c index 9fcc9c8..8420da5 100644 --- a/tools/misc/h5repart_gentest.c +++ b/tools/misc/h5repart_gentest.c @@ -39,29 +39,29 @@ int main(void) /* Set property list and file name for FAMILY driver */ if ((fapl=H5Pcreate(H5P_FILE_ACCESS)) < 0) { perror ("H5Pcreate"); - exit (1); + exit (EXIT_FAILURE); } if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) { perror ("H5Pset_fapl_family"); - exit (1); + exit (EXIT_FAILURE); } if((file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) { perror("H5Fcreate"); - exit(1); + exit(EXIT_FAILURE); } /* Create and write dataset */ if((space = H5Screate_simple(2, dims, NULL)) < 0) { perror("H5Screate_simple"); - exit(1); + exit(EXIT_FAILURE); } if((dset = H5Dcreate2(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { perror("H5Dcreate2"); - exit(1); + exit(EXIT_FAILURE); } @@ -71,28 +71,28 @@ int main(void) if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) { perror("H5Dwrite"); - exit(1); + exit(EXIT_FAILURE); } if(H5Sclose(space) < 0) { perror ("H5Sclose"); - exit (1); + exit (EXIT_FAILURE); } if(H5Dclose(dset) < 0) { perror ("H5Dclose"); - exit (1); + exit (EXIT_FAILURE); } if(H5Pclose(fapl) < 0) { perror ("H5Pclose"); - exit (1); + exit (EXIT_FAILURE); } if(H5Fclose(file) < 0) { perror ("H5Fclose"); - exit (1); + exit (EXIT_FAILURE); } puts(" PASSED"); fflush(stdout); diff --git a/tools/misc/testh5mkgrp.sh b/tools/misc/testh5mkgrp.sh index 50ac23b..e6cb96e 100644 --- a/tools/misc/testh5mkgrp.sh +++ b/tools/misc/testh5mkgrp.sh @@ -19,6 +19,10 @@ # Tuesday, February 13, 2007 # +TESTNAME=h5mkgrp +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + H5MKGRP=h5mkgrp # The tool name H5MKGRP_BIN=`pwd`/$H5MKGRP # The path of the tool binary H5LS=h5ls # The h5ls tool name @@ -182,8 +186,9 @@ RUNTEST h5mkgrp_nested_mult_latest.h5 "-lp" /one/two /three/four if test $nerrors -eq 0 ; then - echo "All h5mkgrp tests passed." + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE fi - -exit $nerrors - diff --git a/tools/misc/testh5repart.sh.in b/tools/misc/testh5repart.sh.in index 62c99d7..7d4e020 100644 --- a/tools/misc/testh5repart.sh.in +++ b/tools/misc/testh5repart.sh.in @@ -15,6 +15,10 @@ # # Tests for the h5repart tool +TESTNAME=h5repart +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + REPART=h5repart # The tool name REPART_BIN=`pwd`/$REPART # The path of the tool binary @@ -100,14 +104,16 @@ TOOLTEST -m 20000 -family_to_sec2 family_file%05d.h5 $actual_dir/family_to_sec2. OUTPUTTEST echo -if test $nerrors -eq 0 ; then - echo "All $REPART tests passed." -fi - # Clean up output file if test -z "$HDF5_NOCLEANUP"; then cd $actual_dir rm -f fst_family*.h5 scd_family*.h5 family_to_sec2.h5 fi -exit $nerrors +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi |