summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-08-23 22:28:52 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-08-23 22:28:52 (GMT)
commit23da86c0dc6503b1effe1b935ae68e59a9c063c3 (patch)
treef4b6a81e0a7fe640d7eb809afbd1c0782f6678c2 /tools
parent9d68049cc6a6062a95a57d7f2b01ae21ef6ac1eb (diff)
downloadhdf5-23da86c0dc6503b1effe1b935ae68e59a9c063c3.zip
hdf5-23da86c0dc6503b1effe1b935ae68e59a9c063c3.tar.gz
hdf5-23da86c0dc6503b1effe1b935ae68e59a9c063c3.tar.bz2
[svn-r19280] Fix test scripts (Cmake needs to capture output yet)
linux script needed -R and double compare: Tested: local linux
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/CMakeLists.txt12
-rw-r--r--tools/h5dump/testh5dump.sh.in28
-rw-r--r--tools/testfiles/tbinregR.ddl21
-rw-r--r--tools/testfiles/tbinregR.txt15
4 files changed, 54 insertions, 22 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index fee9b8a..dfa42f2 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -70,6 +70,7 @@ IF (BUILD_TESTING)
tattr-3.ddl
tattrreg.ddl
tattrregR.ddl
+ tbinregR.ddl
tbigdims.ddl
tboot1.ddl
tboot2.ddl
@@ -350,6 +351,17 @@ IF (BUILD_TESTING)
ENDMACRO (ADD_H5_TEST file)
MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode)
+# ADD_TEST (
+# NAME H5DUMP-${resultfile}
+# COMMAND "${CMAKE_COMMAND}"
+# -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+# -D "TEST_ARGS:STRING=-d /Dataset1 -s 0 -R -y -o ${resultfile}.txt ${targetfile}"
+# -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+# -D "TEST_OUTPUT=${resultfile}.out"
+# -D "TEST_EXPECT=${resultcode}"
+# -D "TEST_REFERENCE=${resultfile}.ddl"
+# -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+# )
ADD_TEST (
NAME H5DUMP-output-${resultfile}
COMMAND $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/${resultfile}.txt ${PROJECT_BINARY_DIR}/${targetfile}
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 2f271b1..d4d8944 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -147,11 +147,14 @@ TOOLTEST1() {
}
-# same as TOOLTEST1 but compares generated file to Expected output
+# same as TOOLTEST1 but compares generated file to expected output
+# and compares the generated data file to the expected data file
# used for the binary tests that expect a full path in -o without -b
TOOLTEST2() {
- expect="$srcdir/../testfiles/`basename $1 .exp`.txt"
+ expectdata="$srcdir/../testfiles/$1"
+ expect="$srcdir/../testfiles/`basename $1 .exp`.ddl"
+ actualdata="../testfiles/`basename $1 .exp`.txt"
actual="../testfiles/`basename $1 .exp`.out"
actual_err="../testfiles/`basename $1 .exp`.err"
shift
@@ -170,17 +173,28 @@ TOOLTEST2() {
echo " CREATED"
cp $actual $expect
elif $CMP $expect $actual; then
- echo " PASSED"
+ if [ ! -f $expectdata ]; then
+ # Create the expect data file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actualdata $expectdata
+ elif $CMP $expectdata $actualdata; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected datafile (*.exp) differs from actual datafile (*.txt)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /'
+ fi
else
echo "*FAILED*"
- echo " Expected result (*.ddl) differs from actual result (*.txt)"
+ echo " Expected result (*.ddl) differs from actual result (*.out)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
-
+
# Clean up output file
if test -z "$HDF5_NOCLEANUP"; then
- rm -f $actual $actual_err
+ rm -f $actual $actualdata $actual_err
fi
}
@@ -538,7 +552,7 @@ TOOLTEST tdataregR.ddl -R tdatareg.h5
TOOLTEST tattrreg.ddl tattrreg.h5
TOOLTEST tattrregR.ddl -R tattrreg.h5
-TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -y -o $TESTDIR/tbinregR.txt tdatareg.h5
+TOOLTEST2 tbinregR.exp -d /Dataset1 -s 0 -R -y -o $TESTDIR/tbinregR.txt tdatareg.h5
# Clean up text output files
if test -z "$HDF5_NOCLEANUP"; then
diff --git a/tools/testfiles/tbinregR.ddl b/tools/testfiles/tbinregR.ddl
new file mode 100644
index 0000000..8afaa5d
--- /dev/null
+++ b/tools/testfiles/tbinregR.ddl
@@ -0,0 +1,21 @@
+HDF5 "testfiles/tdatareg.h5" {
+DATASET "/Dataset1" {
+ DATATYPE H5T_REFERENCE { H5T_STD_REF_DSETREG }
+ DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
+ SUBSET {
+ START ( 0 );
+ STRIDE ( 1 );
+ COUNT ( 1 );
+ BLOCK ( 1 );
+ DATA {
+ DATASET /Dataset2 {
+ REGION_TYPE BLOCK (2,2)-(7,7)
+ DATATYPE H5T_STD_U8BE
+ DATASPACE SIMPLE { ( 10, 10 ) / ( 10, 10 ) }
+ DATA {
+ }
+ }
+ }
+ }
+}
+}
diff --git a/tools/testfiles/tbinregR.txt b/tools/testfiles/tbinregR.txt
deleted file mode 100644
index f4c38a1..0000000
--- a/tools/testfiles/tbinregR.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-HDF5 "tdatareg.h5" {
-DATASET "/Dataset1" {
- DATATYPE H5T_REFERENCE
- DATASPACE SIMPLE { ( 4 ) / ( 4 ) }
- SUBSET {
- START ( 0 );
- STRIDE ( 1 );
- COUNT ( 1 );
- BLOCK ( 1 );
- DATA {
-
- }
- }
-}
-}