summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2010-08-09 18:15:37 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2010-08-09 18:15:37 (GMT)
commiteee9ca47a186a06a8a2072d7dca2316918ca1103 (patch)
treefa89bfa2392d2877c2fc8b1864b547da3f91a35a /tools/h5dump
parentc1aa958992fb7eb73ef48a6e91f63ae2140cc422 (diff)
downloadhdf5-eee9ca47a186a06a8a2072d7dca2316918ca1103.zip
hdf5-eee9ca47a186a06a8a2072d7dca2316918ca1103.tar.gz
hdf5-eee9ca47a186a06a8a2072d7dca2316918ca1103.tar.bz2
[svn-r19202] [BZ1953]implementation for the proposed changes suggested by the "h5dump_output_option" RFC. This required that the region reference code be duplicated and reduced to allow the do_bin_output() function to understand region references. The container type-id also needed to be propagated into the do_bin_output() function and functions referenced (render_bin_output*).
Existing tests tested the binary function, so only one test was added to test the region reference generated file. Tested: local linux
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/CMakeLists.txt16
-rw-r--r--tools/h5dump/testh5dump.sh.in44
2 files changed, 57 insertions, 3 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index eb54e00..6426986 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -267,6 +267,13 @@ IF (BUILD_TESTING)
ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/tbin1LE.ddl
)
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/tbinregR.exp
+ )
+
MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype)
IF (${testtype} STREQUAL "SKIP")
MESSAGE (STATUS "SKIP ${skipresultfile} ${ARGN}")
@@ -584,6 +591,15 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tattrreg 0 tattrreg.h5)
ADD_H5_TEST (tattrregR 0 -R tattrreg.h5)
+ ADD_TEST (
+ NAME H5DUMP-output-tdatreg
+ COMMAND $<TARGET_FILE:h5dump> -d /Dataset1 -s 0 -R -y -o ${PROJECT_BINARY_DIR}/tbinregR.txt ${PROJECT_BINARY_DIR}/tdatareg.h5)
+
+ ADD_TEST (
+ NAME H5DUMP-output-cmp-tdatreg
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${PROJECT_BINARY_DIR}/tbinregR.txt ${PROJECT_BINARY_DIR}/tbinregR.exp)
+
# tests for group creation order
# "1" tracked, "2" name, root tracked
ADD_H5_TEST (tordergr1 0 --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5)
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 82d09fc..78b7757 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -144,6 +144,44 @@ TOOLTEST1() {
}
+# same as TOOLTEST1 but compares generated file to Expected output
+# used for the binary tests that expect a full path in -o without -b
+TOOLTEST2() {
+
+ expect="$srcdir/../testfiles/`basename $1 .exp`.txt"
+ actual="../testfiles/`basename $1 .exp`.out"
+ actual_err="../testfiles/`basename $1 .exp`.err"
+ shift
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+
+ cd $srcdir/../testfiles
+ $RUNSERIAL $DUMPER_BIN $@
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ if [ ! -f $expect ]; then
+ # Create the expect file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actual $expect
+ elif $CMP $expect $actual; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.ddl) differs from actual result (*.txt)"
+ 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
+ fi
+
+}
+
# Print a "SKIP" message
SKIP() {
@@ -482,14 +520,14 @@ if test -z "$HDF5_NOCLEANUP"; then
rm -f $TESTDIR/out3.h5
fi
-
-
# test for dataset region references
TOOLTEST tdatareg.ddl tdatareg.h5
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
+
# tests for group creation order
# "1" tracked, "2" name, root tracked
TOOLTEST tordergr1.ddl --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5
@@ -504,7 +542,6 @@ TOOLTEST torderattr2.ddl -H --sort_by=name --sort_order=descending torderattr.h5
TOOLTEST torderattr3.ddl -H --sort_by=creation_order --sort_order=ascending torderattr.h5
TOOLTEST torderattr4.ddl -H --sort_by=creation_order --sort_order=descending torderattr.h5
-
# tests for floating point user defined printf format
TOOLTEST tfpformat.ddl -m %.7f tfpformat.h5
@@ -513,6 +550,7 @@ TOOLTEST textlinksrc.ddl textlinksrc.h5
TOOLTEST textlinkfar.ddl textlinkfar.h5
+# Report test results and exit
if test $nerrors -eq 0 ; then
echo "All $TESTNAME tests passed."
exit $EXIT_SUCCESS