diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-13 23:21:07 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-02-13 23:21:07 (GMT) |
commit | c6b3059a92b61a119da49c04fbdcd54545d95242 (patch) | |
tree | 573c34c87c767ce9a1659a7c24b0e9f95ac3b3a6 /tools/h5copy/testh5copy.sh | |
parent | d3c5ab50fc8fba8ff72417b125feaac8a3faed68 (diff) | |
download | hdf5-c6b3059a92b61a119da49c04fbdcd54545d95242.zip hdf5-c6b3059a92b61a119da49c04fbdcd54545d95242.tar.gz hdf5-c6b3059a92b61a119da49c04fbdcd54545d95242.tar.bz2 |
[svn-r13293] Description:
Refactor h5copy testing script to abstract out some of the common behavior,
obey the "HDF5_NOCLEANUP" environment variable, delete any output file left
over from a previous run, add a "test variation" parameter to output file name
for adding next sequence of test variations, etc.
Tested on:
Linux/32 2.6 (chicago)
Linux/64 2.6 (chicago2)
Diffstat (limited to 'tools/h5copy/testh5copy.sh')
-rw-r--r-- | tools/h5copy/testh5copy.sh | 53 |
1 files changed, 35 insertions, 18 deletions
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index af8fb4b..e0056ac 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -27,12 +27,10 @@ H5LS=h5ls # The h5ls tool name H5LS_ARGS=-vr # Arguments to the h5ls tool H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary -TESTFILE=$srcdir/../testfiles/h5copytst.h5 -FILEOUT=h5copytst.out.h5 - nerrors=0 verbose=yes +SRCFILE=h5copytst.h5 CMP='cmp -s' DIFF='diff -c' @@ -166,25 +164,44 @@ H5LSTEST() fi } -############################################################################## -### T H E T E S T S ### -############################################################################## - # Copy single datasets of various forms from one root group to another, # adding new object to the destination file each time -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compact -d compact -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compound -d compound -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s compressed -d compressed -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s named_vl -d named_vl -TOOLTEST -i $TESTFILE -o $FILEOUT -v -s nested_vl -d nested_vl - -# Verify that the file created above is correct -H5LSTEST $FILEOUT -rm -f $FILEOUT +# +# Assumed arguments: +# $1 is test "variation" +# $2 is group within source file +# $3 is group within destination file +SIMPLETEST() +{ + TESTFILE=$srcdir/../testfiles/$SRCFILE + FILEOUT="../testfiles/`basename $SRCFILE .h5`.$1.out.h5" + + # Remove any output file left over from previous test run + rm -f $FILEOUT + + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"simple -d "$3"simple + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"chunk -d "$3"chunk + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"compact -d "$3"compact + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"compound -d "$3"compound + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"compressed -d "$3"compressed + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"named_vl -d "$3"named_vl + TOOLTEST -i $TESTFILE -o $FILEOUT -v -s "$2"nested_vl -d "$3"nested_vl + + # Verify that the file created above is correct + H5LSTEST $FILEOUT + + # Remove output file created, if the "no cleanup" environment variable is + # not defined + if [ x$HDF5_NOCLEANUP = "x" ]; then + rm -f $FILEOUT + fi +} +############################################################################## +### T H E T E S T S ### +############################################################################## +SIMPLETEST a "" "" if test $nerrors -eq 0 ; then |