summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2009-06-15 19:05:42 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2009-06-15 19:05:42 (GMT)
commitaad47d8e8bd166f9d9f981c9ef81f5d5398a9f65 (patch)
tree251d00e0276266c633dba64bcdfabec04aea0772 /tools
parent049ce53e19cc9c4417b91acf4ad3b8819eaa7992 (diff)
downloadhdf5-aad47d8e8bd166f9d9f981c9ef81f5d5398a9f65.zip
hdf5-aad47d8e8bd166f9d9f981c9ef81f5d5398a9f65.tar.gz
hdf5-aad47d8e8bd166f9d9f981c9ef81f5d5398a9f65.tar.bz2
[svn-r17052] Add a run to the h5repack shell script to read a family file
The file used for input is located in the common source tools for testfiles, in tools/testfiles Modified the h5repack shell script to read files from this location (h5repack reads its input files from a dedicated testfiles location in h5repack/testfiles) Changed the h5diff open file call to use h5tools_fopen, so that it can open all file drivers Tested: windows, linux, solaris
Diffstat (limited to 'tools')
-rw-r--r--tools/h5diff/h5diff_main.c3
-rwxr-xr-xtools/h5repack/h5repack.sh.in38
-rw-r--r--tools/lib/h5diff.c15
3 files changed, 53 insertions, 3 deletions
diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c
index 822d59c..1cb8f2f 100644
--- a/tools/h5diff/h5diff_main.c
+++ b/tools/h5diff/h5diff_main.c
@@ -68,6 +68,9 @@
*/
+/* module-scoped variables */
+int d_status = EXIT_SUCCESS;
+
int main(int argc, const char *argv[])
{
int ret;
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index a09e8b9..01c33ef 100755
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -54,6 +54,7 @@ FILE13=h5repack_soffset.h5
FILE14=h5repack_layouto.h5 # A file with an older version of the layout message
# (copy of test/tlayouto.h5)
FILE15=h5repack_named_dtypes.h5
+FILE16=tfamily%05d.h5 # located in common testfiles folder
nerrors=0
@@ -140,6 +141,8 @@ TOOLTEST()
rm -f $outfile
}
+# same as TOOLTEST, but it uses the old syntax -i input_file -o output_file
+#
TOOLTEST0()
{
# Run test.
@@ -168,6 +171,38 @@ TOOLTEST0()
rm -f $outfile
}
+
+# same as TOOLTEST, but it uses the common testfiles at $srcdir/../testfiles/
+# used to test the family driver, where these files reside
+#
+TOOLTEST1()
+{
+ # Run test.
+ # Tflops interprets "$@" as "" when no parameter is given (e.g., the
+ # case of missing file name). Changed it to use $@ till Tflops fixes it.
+ TESTING $H5REPACK $@
+
+ infile=$srcdir/../testfiles/$1
+ path=`pwd`
+ outfile=$path/out.$1
+ shift
+ if [ "`uname -s`" = "TFLOPS O/S" ]; then
+ $RUNSERIAL $H5REPACK_BIN $@ $infile $outfile
+ else
+ $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ fi
+
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ DIFFTEST $infile $outfile
+ fi
+ rm -f $outfile
+}
+
#
# The tests
# We use the files generated by h5repacktst
@@ -514,6 +549,9 @@ TOOLTEST $FILE1 -f GZIP=1
# Check repacking file with committed datatypes in odd configurations
TOOLTEST $FILE15
+# tests family driver (file is located in common testfiles folder, uses TOOLTEST1
+TOOLTEST1 $FILE16
+
if test $nerrors -eq 0 ; then
echo "All $H5REPACK tests passed."
fi
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index 432dd95..5a4e2f2 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -17,6 +17,8 @@
#include "h5diff.h"
#include "H5private.h"
#include "ph5diff.h"
+#include "h5tools.h"
+#include "h5tools_utils.h"
/*
* Debug printf macros. The prefix allows output filtering by test scripts.
@@ -210,9 +212,11 @@ hsize_t h5diff(const char *fname1,
/* disable error reporting */
H5E_BEGIN_TRY
{
- /* open the files */
- if((file1_id = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ /* open file 1 */
+
+ if((file1_id = h5tools_fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0)
{
+
parallel_print("h5diff: <%s>: unable to open file\n", fname1);
options->err_stat = 1;
@@ -223,8 +227,13 @@ hsize_t h5diff(const char *fname1,
#endif
goto out;
} /* end if */
- if((file2_id = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+
+
+ /* open file 2 */
+
+ if((file2_id = h5tools_fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0)
{
+
parallel_print("h5diff: <%s>: unable to open file\n", fname2);
options->err_stat = 1;