summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-02-13 23:21:07 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-02-13 23:21:07 (GMT)
commitc6b3059a92b61a119da49c04fbdcd54545d95242 (patch)
tree573c34c87c767ce9a1659a7c24b0e9f95ac3b3a6
parentd3c5ab50fc8fba8ff72417b125feaac8a3faed68 (diff)
downloadhdf5-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)
-rw-r--r--tools/h5copy/testh5copy.sh53
-rw-r--r--tools/testfiles/h5copytst.a.out.ls (renamed from tools/testfiles/h5copytst.out.ls)4
2 files changed, 37 insertions, 20 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
diff --git a/tools/testfiles/h5copytst.out.ls b/tools/testfiles/h5copytst.a.out.ls
index 81cc181..90b5dba 100644
--- a/tools/testfiles/h5copytst.out.ls
+++ b/tools/testfiles/h5copytst.a.out.ls
@@ -1,7 +1,7 @@
#############################
-Expected output for 'h5ls h5copytst.out.h5'
+Expected output for 'h5ls ../testfiles/h5copytst.a.out.h5'
#############################
-Opened "h5copytst.out.h5" with sec2 driver.
+Opened "../testfiles/h5copytst.a.out.h5" with sec2 driver.
/chunk Dataset {6/6}
Location: 1:6216
Links: 1