From 2a93f993174ed44a85a2d8fca7b3c68e5bb41389 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Thu, 4 Mar 2004 11:55:07 -0500 Subject: [svn-r8232] Purpose: new feature Description: added a check for the return value of the tools h5repack and h5diff in the run script. the return value is used to print PASSED (tool returns 0) or FAILED Solution: Platforms tested: linux Misc. update: --- tools/h5repack/h5repack.sh | 17 +++++++++++++++-- tools/h5repack/h5repack_main.c | 21 ++++++++------------- tools/h5repack/testh5repack_filters.c | 15 --------------- 3 files changed, 23 insertions(+), 30 deletions(-) diff --git a/tools/h5repack/h5repack.sh b/tools/h5repack/h5repack.sh index 8b8f44a..2b8168d 100644 --- a/tools/h5repack/h5repack.sh +++ b/tools/h5repack/h5repack.sh @@ -64,7 +64,13 @@ TOOLTEST() $RUNSERIAL $H5REPACK_BIN "$@" fi ) -echo " PASSED" + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + else + echo " PASSED" + fi + } # Call the h5diff tool @@ -80,7 +86,14 @@ DIFFTEST() $RUNSERIAL $H5DIFF_BIN "$@" fi ) - echo " PASSED" + RET=$? +# echo $RET + if [ $RET != 0 ] ; then + echo "*FAILED*" + else + echo " PASSED" + fi + } diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 71308d9..05a9c1e 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -15,24 +15,22 @@ #include #include "h5repack.h" - - static void usage(void); - /* +h5repack main program + Examples of use: -v -i file1.h5 -o file2.h5 -f "dataset:GZIP 6" -l "dataset:CHUNK 2x2" -v -i file1.h5 -o file2.h5 -f "GZIP 6" */ - int main(int argc, char **argv) { char *infile = NULL; char *outfile = NULL; pack_opt_t options; /*the global options */ - int i; + int i, ret; /* initialize options */ h5repack_init (&options,0); @@ -87,20 +85,17 @@ int main(int argc, char **argv) usage(); /* pack it */ - h5repack(infile,outfile,&options); - -#if defined(H5_REPACK_DEBUG) - if (h5repack_verify(outfile,&options)<=0) - printf("Warning: Output file does not have some of the requested filters\n"); -#endif + ret=h5repack(infile,outfile,&options); /* free tables */ h5repack_end(&options); - return 0; + if (ret==-1) + return 1; + else + return 0; } - /*------------------------------------------------------------------------- * Function: usage * diff --git a/tools/h5repack/testh5repack_filters.c b/tools/h5repack/testh5repack_filters.c index 7a2265c..f8efa74 100644 --- a/tools/h5repack/testh5repack_filters.c +++ b/tools/h5repack/testh5repack_filters.c @@ -142,21 +142,6 @@ int make_filters(hid_t loc_id) goto out; /*------------------------------------------------------------------------- - * checksum - *------------------------------------------------------------------------- - */ -#if 0 - /* remove the filters from the dcpl */ - if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0) - goto out; - /* set the checksum filter */ - if (H5Pset_fletcher32(dcpl)<0) - goto out; - if (make_dset(loc_id,"dset_fletcher32",sid,dcpl,buf)<0) - goto out; -#endif - -/*------------------------------------------------------------------------- * shuffle + SZIP *------------------------------------------------------------------------- */ -- cgit v0.12