summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/testh5dump.sh.in102
-rw-r--r--tools/testfiles/out3.h5import7
-rw-r--r--tools/testfiles/tbin1.ddl11
-rw-r--r--tools/testfiles/tbin3.ddl8
4 files changed, 109 insertions, 19 deletions
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index a2455a6..c6a4dff 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -23,8 +23,15 @@ USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@"
USE_FILTER_NBIT="@USE_FILTER_NBIT@"
USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@"
-DUMPER=h5dump # The tool name
-DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
+DUMPER=h5dump # The tool name
+DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary
+
+H5DIFF=../h5diff/h5diff # The h5diff tool name
+H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
+
+H5IMPORT=../h5import/h5import # The h5import tool name
+H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
+
CMP='cmp -s'
DIFF='diff -c'
@@ -99,6 +106,73 @@ SKIP() {
echo " -SKIP-"
}
+# Print a line-line message left justified in a field of 70 characters
+#
+PRINT_H5DIFF() {
+ SPACES=" "
+ echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+
+# Call the h5diff tool
+#
+DIFFTEST()
+{
+ PRINT_H5DIFF $@
+ (
+ cd $srcdir/../testfiles
+ if [ "`uname -s`" = "TFLOPS O/S" ]; then
+ $RUNSERIAL $H5DIFF_BIN $@ -q
+ else
+ $RUNSERIAL $H5DIFF_BIN "$@" -q
+ fi
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ fi
+
+}
+
+# Print a line-line message left justified in a field of 70 characters
+# beginning with the word "Verifying".
+#
+PRINT_H5IMPORT() {
+ SPACES=" "
+ echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012'
+}
+
+# Call the h5import tool
+#
+IMPORTTEST()
+{
+ # remove the output hdf5 file if it exists
+ hdf5_file="$srcdir/../testfiles/$5"
+ if [ -f $hdf5_file ]; then
+ rm -f $hdf5_file
+ fi
+
+ PRINT_H5IMPORT $@
+ (
+ cd $srcdir/../testfiles
+ if [ "`uname -s`" = "TFLOPS O/S" ]; then
+ $RUNSERIAL $H5IMPORT_BIN $@
+ else
+ $RUNSERIAL $H5IMPORT_BIN "$@"
+ fi
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ fi
+
+}
##############################################################################
@@ -340,14 +414,22 @@ TOOLTEST tnullspace.ddl tnullspace.h5
TOOLTEST tvms.ddl tvms.h5
# test for binary output
-TOOLTEST tbin1.ddl -d integer -o out1.bin -b LE tbinary.h5
-TOOLTEST tbin2.ddl -d float -o out2.bin -b BE tbinary.h5
-TOOLTEST tbin3.ddl -d array -o out3.bin -b MEMORY tbinary.h5
-TOOLTEST tbin4.ddl -d double -o out4.bin -b FILE tbinary.h5
- # Clean up binary output files
- if test -z "$HDF5_NOCLEANUP"; then
- rm -f $srcdir/../testfiles/out[1-4].bin
- fi
+TOOLTEST tbin1.ddl -d array -o out1.bin -b LE tbinary.h5
+TOOLTEST tbin2.ddl -d float -o out2.bin -b BE tbinary.h5
+
+# the MEMORY test can be validated with h5import/h5diff
+TOOLTEST tbin3.ddl -d integer -o out3.bin -b MEMORY tbinary.h5
+IMPORTTEST out3.bin -c out3.h5import -o out3.h5
+DIFFTEST tbinary.h5 out3.h5 /integer /integer
+
+TOOLTEST tbin4.ddl -d double -o out4.bin -b FILE tbinary.h5
+
+# Clean up binary output files
+if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $srcdir/../testfiles/out[1-4].bin
+ rm -f $srcdir/../testfiles/out3.h5
+fi
+
# test for dataset region references
TOOLTEST tregref.ddl tdatareg.h5
diff --git a/tools/testfiles/out3.h5import b/tools/testfiles/out3.h5import
new file mode 100644
index 0000000..29346e1
--- /dev/null
+++ b/tools/testfiles/out3.h5import
@@ -0,0 +1,7 @@
+PATH /integer
+RANK 1
+DIMENSION-SIZES 6
+INPUT-CLASS IN
+
+
+
diff --git a/tools/testfiles/tbin1.ddl b/tools/testfiles/tbin1.ddl
index 3adbac0..22facb8 100644
--- a/tools/testfiles/tbin1.ddl
+++ b/tools/testfiles/tbin1.ddl
@@ -1,11 +1,12 @@
#############################
-Expected output for 'h5dump -d integer -o out1.bin -b LE tbinary.h5'
+Expected output for 'h5dump -d array -o out1.bin -b LE tbinary.h5'
#############################
HDF5 "tbinary.h5" {
-DATASET "integer" {
- DATATYPE H5T_STD_I32LE
- DATASPACE SIMPLE { ( 6 ) / ( 6 ) }
+DATASET "array" {
+ DATATYPE H5T_ARRAY { [6] H5T_STD_I32LE }
+ DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
- }
+ }
}
}
+h5dump error: unable to print data
diff --git a/tools/testfiles/tbin3.ddl b/tools/testfiles/tbin3.ddl
index a49547f..cd2c2b5 100644
--- a/tools/testfiles/tbin3.ddl
+++ b/tools/testfiles/tbin3.ddl
@@ -1,10 +1,10 @@
#############################
-Expected output for 'h5dump -d array -o out3.bin -b MEMORY tbinary.h5'
+Expected output for 'h5dump -d integer -o out3.bin -b MEMORY tbinary.h5'
#############################
HDF5 "tbinary.h5" {
-DATASET "array" {
- DATATYPE H5T_ARRAY { [6] H5T_STD_I32LE }
- DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
+DATASET "integer" {
+ DATATYPE H5T_STD_I32LE
+ DATASPACE SIMPLE { ( 6 ) / ( 6 ) }
DATA {
}
}