[svn-r13775]

Modified the current h5dump test script to use h5import/h5diff calls to validate the binary output. At this moment it can only be used with the native test, since h5import does not deal with input endianess.


tested: linux, sunos 5.10
This commit is contained in:
Pedro Vicente Nunes 2007-05-21 10:24:50 -05:00
parent 71befdadcf
commit c80d46791f
5 changed files with 112 additions and 20 deletions

View File

@ -995,6 +995,7 @@
./tools/misc/testfiles/h5stat_help1.ddl
./tools/misc/testfiles/h5stat_help2.ddl
# h5dump
./tools/testfiles/family_file00000.h5
./tools/testfiles/family_file00001.h5
./tools/testfiles/family_file00002.h5
@ -1191,7 +1192,8 @@
./tools/testfiles/tbigdims.ddl
./tools/testfiles/tbigdims.h5
./tools/testfiles/thyperslab.h5
# h5dump h5import validation
./tools/testfiles/out3.h5import
# Expected output from h5ls tests

View File

@ -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

View File

@ -0,0 +1,7 @@
PATH /integer
RANK 1
DIMENSION-SIZES 6
INPUT-CLASS IN

View File

@ -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

View File

@ -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 {
}
}