summaryrefslogtreecommitdiffstats
path: root/tools/h5dump
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2013-04-19 15:23:01 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2013-04-19 15:23:01 (GMT)
commit14d8e1c2b5ecaf2e298984f269094dd5f2bd735f (patch)
treecc250461294a2c9118b10a95d0459d7314fa5e50 /tools/h5dump
parent6ee0e05fb94445551840fcb80b9b1c254c736799 (diff)
downloadhdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.zip
hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.gz
hdf5-14d8e1c2b5ecaf2e298984f269094dd5f2bd735f.tar.bz2
[svn-r23600] Bring revisions #23085 - #23341 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'tools/h5dump')
-rw-r--r--tools/h5dump/CMakeLists.txt644
-rw-r--r--tools/h5dump/Makefile.in2
-rw-r--r--tools/h5dump/h5dump.c382
-rw-r--r--tools/h5dump/h5dump_ddl.c99
-rw-r--r--tools/h5dump/h5dump_defines.h10
-rw-r--r--tools/h5dump/testh5dump.sh.in169
-rw-r--r--tools/h5dump/testh5dumppbits.sh.in4
-rw-r--r--tools/h5dump/testh5dumpxml.sh.in30
8 files changed, 871 insertions, 469 deletions
diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt
index e1ade89..f5837d4 100644
--- a/tools/h5dump/CMakeLists.txt
+++ b/tools/h5dump/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.8.6)
+cmake_minimum_required (VERSION 2.8.10)
PROJECT (HDF5_TOOLS_H5DUMP)
#-----------------------------------------------------------------------------
@@ -139,8 +139,14 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcmpddt.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tnbit.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnoattrdata.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnoattrddl.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnoddl.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnoddlfile.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/trawdatafile.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl
@@ -184,9 +190,19 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/twidedisplay.ddl
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/twithddlfile.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/h5dump-help.txt
${HDF5_TOOLS_SRC_DIR}/testfiles/out3.h5import
)
+ SET (HDF5_REFERENCE_EXP_FILES
+ tall-6.exp
+ tnoddlfile.exp
+ trawdatafile.exp
+ tstr2bin2.exp
+ tstr2bin6.exp
+ twithddl.exp
+ twithddlfile.exp
+ )
SET (HDF5_REFERENCE_TEST_FILES
${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.h5
@@ -313,7 +329,7 @@ IF (BUILD_TESTING)
#
FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES})
GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME)
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#MESSAGE (STATUS " Copying ${tst_h5_file}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -322,10 +338,24 @@ IF (BUILD_TESTING)
ARGS -E copy_if_different ${tst_h5_file} ${dest}
)
ENDFOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES})
+
+ FOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
+ IF (WIN32 AND NOT CYGWIN)
+ FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} TEST_STREAM)
+ FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}")
+ ELSE (WIN32 AND NOT CYGWIN)
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${tst_exp_file} ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}
+ )
+ ENDIF (WIN32 AND NOT CYGWIN)
+ ENDFOREACH (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
FOREACH (tst_other_file ${HDF5_REFERENCE_FILES})
GET_FILENAME_COMPONENT(fname "${tst_other_file}" NAME)
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#MESSAGE (STATUS " Copying ${tst_other_file}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -337,7 +367,7 @@ IF (BUILD_TESTING)
FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES})
GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME)
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}")
#MESSAGE (STATUS " Copying ${tst_error_file}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -347,15 +377,53 @@ IF (BUILD_TESTING)
)
ENDFOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES})
+ # --------------------------------------------------------------------
+ # Special file handling
+ # --------------------------------------------------------------------
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl
+ )
+
+ IF (WIN32 AND NOT CYGWIN)
+ FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM)
+ FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
+ ELSE (WIN32 AND NOT CYGWIN)
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp
+ )
+ ENDIF (WIN32 AND NOT CYGWIN)
+
#
# copy XML test files from source dir to test dir
#
SET (HDF5_XML_REFERENCE_TEST_FILES
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tbitfields.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tdset2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tenum.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tloop2.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tmany.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tname-amp.h5
@@ -364,14 +432,28 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tname-lt.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tref.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes-at.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.h5
${HDF5_TOOLS_SRC_DIR}/testfiles/tstring-at.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5
)
SET (HDF5_XML_REFERENCE_FILES
${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5.xml
@@ -441,7 +523,7 @@ IF (BUILD_TESTING)
FOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES})
GET_FILENAME_COMPONENT(fname "${tst_xml_h5_file}" NAME)
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}")
#MESSAGE (STATUS " Copying ${tst_xml_h5_file}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -453,7 +535,7 @@ IF (BUILD_TESTING)
FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES})
GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME)
- SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}")
#MESSAGE (STATUS " Copying ${tst_xml_other_file}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -462,28 +544,6 @@ IF (BUILD_TESTING)
ARGS -E copy_if_different ${tst_xml_other_file} ${dest}
)
ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES})
-
- # --------------------------------------------------------------------
- # Special file handling
- # --------------------------------------------------------------------
- ADD_CUSTOM_COMMAND (
- TARGET h5dump
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SOURCE_DIR}/testfiles/tbin1.ddl ${PROJECT_BINARY_DIR}/testfiles/tbin1LE.ddl
- )
-
- IF (WIN32 AND NOT CYGWIN)
- FILE (READ ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp TEST_STREAM)
- FILE (WRITE ${PROJECT_BINARY_DIR}/testfiles/tbinregR.exp "${TEST_STREAM}")
- ELSE (WIN32 AND NOT CYGWIN)
- ADD_CUSTOM_COMMAND (
- TARGET h5dump
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/tbinregR.exp
- )
- ENDIF (WIN32 AND NOT CYGWIN)
# --------------------------------------------------------------------
# Packed Bits
@@ -544,6 +604,11 @@ IF (BUILD_TESTING)
${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong16.ddl
${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong16.ddl
)
+ SET (HDF5_REFERENCE_TEST_PBITS
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5
+ ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5
+ )
SET (HDF5_ERROR_REFERENCE_PBITS
${PROJECT_SOURCE_DIR}/errfiles/tnofilename-with-packed-bits.err
${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharLengthExceeded.err
@@ -560,9 +625,22 @@ IF (BUILD_TESTING)
${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetNegative.err
)
+ FOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS})
+ GET_FILENAME_COMPONENT(fname "${pbits_h5_file}" NAME)
+ SET (dest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}")
+ #MESSAGE (STATUS " Copying ${pbits_h5_file}")
+ ADD_CUSTOM_COMMAND (
+ TARGET h5dump
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different ${pbits_h5_file} ${dest}
+ )
+ ENDFOREACH (pbits_h5_file ${HDF5_REFERENCE_TEST_PBITS})
+
+
FOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS})
GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME)
- SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}")
#MESSAGE (STATUS " Copying ${ddl_pbits}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -574,7 +652,7 @@ IF (BUILD_TESTING)
FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS})
GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME)
- SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
+ SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}")
#MESSAGE (STATUS " Copying ${ddl_pbits}")
ADD_CUSTOM_COMMAND (
TARGET h5dump
@@ -594,30 +672,30 @@ IF (BUILD_TESTING)
# If using memchecker add tests without using scripts
IF (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
- SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
ENDIF (NOT "${last_test}" STREQUAL "")
SET (last_test "H5DUMP-${testname}")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5DUMP-clear-h5dump-${testname}-objects
+ NAME H5DUMP-h5dump-${testname}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove h5dump-${testname}.out h5dump-${testname}.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-clear-h5dump-${testname}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
ADD_TEST (
NAME H5DUMP-h5dump-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=h5dump-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=h5dump-${testname}.txt"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-clear-h5dump-${testname}-objects")
+ SET_TESTS_PROPERTIES (H5DUMP-h5dump-${testname} PROPERTIES DEPENDS "H5DUMP-h5dump-${testname}-clear-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_HELP_TEST)
@@ -638,97 +716,184 @@ IF (BUILD_TESTING)
# If using memchecker add tests without using scripts
IF (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
- SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
IF (NOT ${resultcode} STREQUAL "0")
SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
ENDIF (NOT ${resultcode} STREQUAL "0")
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-${resultfile}")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5DUMP-clear-${resultfile}-objects
+ NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.out ${resultfile}.out.err
+ -E remove ${resultfile}.bin ${resultfile}.out ${resultfile}.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
ADD_TEST (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5_TEST file)
+ MACRO (ADD_H5_TEST_EXPORT resultfile targetfile resultcode)
+ # If using memchecker add tests without using scripts
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile})
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ IF (NOT ${resultcode} STREQUAL "0")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
+ ENDIF (NOT ${resultcode} STREQUAL "0")
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${resultfile}.txt ${resultfile}.exp
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_TEST_EXPORT file)
+
+ MACRO (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile)
+ # If using memchecker add tests without using scripts
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile})
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ IF (NOT ${resultcode} STREQUAL "0")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
+ ENDIF (NOT ${resultcode} STREQUAL "0")
+ IF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
+ ENDIF (NOT "${last_test}" STREQUAL "")
+ ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${ddlfile}.txt ${resultfile}.txt ${resultfile}.out ${resultfile}.out.err
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${resultfile}.txt ${resultfile}.exp
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile})
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-output-cmp-ddl
+ COMMAND ${CMAKE_COMMAND}
+ -E compare_files ${ddlfile}.txt ${ddlfile}.exp
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp)
+ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_TEST_EXPORT_DDL file)
+
MACRO (ADD_H5_EXPORT_TEST resultfile targetfile resultcode)
- ADD_TEST (
- NAME H5DUMP-output-${resultfile}
- COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.txt ${PROJECT_BINARY_DIR}/testfiles/${targetfile}
- )
- SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-output-${resultfile}")
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
+ NAME H5DUMP-output-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${resultfile}.txt
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_TEST (
+ NAME H5DUMP-output-${resultfile}
+ COMMAND $<TARGET_FILE:h5dump> ${ARGN} ${resultfile}.txt ${targetfile}
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects)
+ ADD_TEST (
NAME H5DUMP-output-cmp-${resultfile}
COMMAND ${CMAKE_COMMAND}
- -E compare_files ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.txt ${PROJECT_BINARY_DIR}/testfiles/${resultfile}.exp
+ -E compare_files ${resultfile}.txt ${resultfile}.exp
)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-output-cmp-${resultfile}")
+ SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile})
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5_EXPORT_TEST file)
MACRO (ADD_H5_MASK_TEST resultfile resultcode)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5DUMP-clear-${resultfile}-objects
+ NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove ${resultfile}.out ${resultfile}.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
ADD_TEST (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
-D "TEST_MASK_ERROR=true"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5_MASK_TEST file)
MACRO (ADD_H5ERR_MASK_TEST resultfile resultcode)
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5DUMP-clear-${resultfile}-objects
+ NAME H5DUMP-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove ${resultfile}.out ${resultfile}.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
ADD_TEST (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.ddl"
@@ -736,10 +901,73 @@ IF (BUILD_TESTING)
-D "TEST_MASK_ERROR=true"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-clear-${resultfile}-objects")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_H5ERR_MASK_TEST file)
+ MACRO (ADD_H5_TEST_IMPORT conffile resultfile testfile resultcode)
+ # If using memchecker add tests without using scripts
+ IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5DUMP-IMPORT-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${conffile}.out ${conffile}.out.err ${resultfile}.bin ${resultfile}.h5
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_TEST (
+ NAME H5DUMP-IMPORT-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
+ -D "TEST_OUTPUT=${conffile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${conffile}.ddl"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects")
+ ADD_TEST (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND h5import ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5)
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile})
+ ADD_TEST (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND h5diff ${testfile} ${resultfile}.h5 /integer /integer)
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ SET_TESTS_PROPERTIES (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile})
+ ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_TEST_IMPORT file)
+
+ MACRO (ADD_H5_PBITS_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ IF (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
+ IF (NOT ${resultcode} STREQUAL "0")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
+ ENDIF (NOT ${resultcode} STREQUAL "0")
+ IF (NOT "${last_pbits_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test})
+ ENDIF (NOT "${last_pbits_test}" STREQUAL "")
+ ELSE (HDF5_ENABLE_USING_MEMCHECKER)
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND}
+ -E remove ${resultfile}.out ${resultfile}.out.err
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
+ ADD_TEST (
+ NAME H5DUMP-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF5_RESOURCES_DIR}/runTest.cmake"
+ )
+ SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
+ ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
+ ENDMACRO (ADD_H5_PBITS_TEST file)
+
MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype)
IF (${testtype} STREQUAL "SKIP")
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -756,33 +984,32 @@ IF (BUILD_TESTING)
MACRO (ADD_XML_H5_TEST resultfile resultcode)
IF (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (NAME H5DUMP-XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN})
- SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
IF (NOT ${resultcode} STREQUAL "0")
SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true")
ENDIF (NOT ${resultcode} STREQUAL "0")
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-XML-${resultfile}")
+ IF (NOT "${last_xml_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test})
+ ENDIF (NOT "${last_xml_test}" STREQUAL "")
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
ADD_TEST (
- NAME H5DUMP-XML-clear-${resultfile}-objects
+ NAME H5DUMP-XML-${resultfile}-clear-objects
COMMAND ${CMAKE_COMMAND}
-E remove ${resultfile}.out ${resultfile}.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-XML-clear-${resultfile}-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
ADD_TEST (
NAME H5DUMP-XML-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
-D "TEST_ARGS:STRING=--xml;${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}.xml"
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
)
- SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-clear-${resultfile}-objects")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES DEPENDS "H5DUMP-XML-${resultfile}-clear-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
ENDMACRO (ADD_XML_H5_TEST file)
@@ -821,6 +1048,7 @@ IF (BUILD_TESTING)
tall-4s.out.err
tall-5s.out
tall-5s.out.err
+ tall-6.txt
tall-6.out
tall-6.out.err
tallfilters.out
@@ -861,6 +1089,8 @@ IF (BUILD_TESTING)
tattrreg.out.err
tattrregR.out
tattrregR.out.err
+ tbin1LE.bin
+ tbinregR.txt
tbinregR.out
tbinregR.out.err
tbigdims.out
@@ -983,6 +1213,19 @@ IF (BUILD_TESTING)
tnestedcmpddt.out.err
tnbit.out
tnbit.out.err
+ tnoattrdata.out
+ tnoattrdata.out.err
+ tnoattrddl.out
+ tnoattrddl.out.err
+ tnodata.out
+ tnodata.out.err
+ tnoddl.out
+ tnoddl.out.err
+ tnoddlfile.out
+ tnoddlfile.out.err
+ trawdatafile.out
+ trawdatafile.out.err
+ trawdatafile.txt
tno-subset.out
tno-subset.out.err
tnullspace.out
@@ -1043,6 +1286,8 @@ IF (BUILD_TESTING)
tstr-1.out.err
tstr-2.out
tstr-2.out.err
+ tstr2bin2.txt
+ tstr2bin6.txt
tstring.out
tstring.out.err
tstring2.out
@@ -1073,8 +1318,12 @@ IF (BUILD_TESTING)
tvms.out.err
twidedisplay.out
twidedisplay.out.err
+ twithddl.txt
+ twithddlfile.out
+ twithddlfile.out.err
+ twithddlfile.txt
)
- SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
IF (NOT "${last_test}" STREQUAL "")
SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test})
ENDIF (NOT "${last_test}" STREQUAL "")
@@ -1083,6 +1332,18 @@ IF (BUILD_TESTING)
ADD_HELP_TEST(help 0 -h)
+ # test data output redirection
+ #ADD_H5_TEST (tnoddl 0 --enable-error-stack -O -y packedbits.h5)
+ ADD_H5_TEST (tnoddl 0 --enable-error-stack --ddl -y packedbits.h5)
+ #ADD_H5_TEST (tnodata 0 --enable-error-stack -o packedbits.h5)
+ ADD_H5_TEST (tnodata 0 --enable-error-stack --output packedbits.h5)
+ ADD_H5_TEST (tnoattrddl 0 --enable-error-stack -O -y tattr.h5)
+ ADD_H5_TEST (tnoattrdata 0 --enable-error-stack -A -o tattr.h5)
+ ADD_H5_TEST_EXPORT (trawdatafile packedbits.h5 0 --enable-error-stack -y -o)
+ ADD_H5_TEST_EXPORT (tnoddlfile packedbits.h5 0 --enable-error-stack -O -y -o)
+
+ ADD_H5_TEST_EXPORT_DDL (twithddlfile packedbits.h5 0 twithddl --enable-error-stack --ddl=twithddl.txt -y -o)
+
# test for maximum display datasets
ADD_H5_TEST (twidedisplay 0 --enable-error-stack -w0 packedbits.h5)
@@ -1332,106 +1593,31 @@ IF (BUILD_TESTING)
ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5)
# test for binary output
- ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o out1LE.bin -b LE tbinary.h5)
+ ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o tbin1LE.bin -b LE tbinary.h5)
+
+ # test for string binary output
+ ADD_H5_EXPORT_TEST (tstr2bin2 tstr2.h5 0 --enable-error-stack -d /g2/dset2 -b -o)
+ ADD_H5_EXPORT_TEST (tstr2bin6 tstr2.h5 0 --enable-error-stack -d /g6/dset6 -b -o)
# NATIVE default. the NATIVE test can be validated with h5import/h5diff
- ADD_H5_TEST (tbin1 0 --enable-error-stack -d integer -o out1.bin -b tbinary.h5)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-tbin1 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-tbin1")
-
+ ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b)
+
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5DUMP-clear-out1D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out1D.h5)
- SET_TESTS_PROPERTIES (H5DUMP-clear-out1D PROPERTIES DEPENDS H5DUMP-tbin1)
- ADD_TEST (NAME H5DUMP-h5import-out1D COMMAND h5import out1.bin -c tbin1.out -o out1D.h5)
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out1D PROPERTIES DEPENDS H5DUMP-clear-out1D)
- ADD_TEST (NAME H5DUMP-h5diff-out1D COMMAND h5diff tbinary.h5 out1D.h5 /integer /integer)
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1D PROPERTIES DEPENDS H5DUMP-h5import-out1D)
- SET (last_test "H5DUMP-h5diff-out1D")
- ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
-
- ADD_TEST (NAME H5DUMP-clear-out1 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out1.h5)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-clear-out1 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- ADD_TEST (NAME H5DUMP-h5import-out1 COMMAND h5import out1.bin -c out3.h5import -o out1.h5)
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out1 PROPERTIES DEPENDS H5DUMP-clear-out1)
- ADD_TEST (NAME H5DUMP-h5diff-out1 COMMAND h5diff tbinary.h5 out1.h5 /integer /integer)
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out1 PROPERTIES DEPENDS H5DUMP-h5import-out1)
- SET (last_test "H5DUMP-h5diff-out1")
-
- ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5)
- IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-tbin2")
+ ADD_TEST (NAME H5DUMP-tbin2-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out2.bin)
+ SET_TESTS_PROPERTIES (H5DUMP-tbin2-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o out2.bin tbinary.h5)
+ SET_TESTS_PROPERTIES (H5DUMP-tbin2 PROPERTIES DEPENDS H5DUMP-tbin2-bin-clear-objects)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
# the NATIVE test can be validated with h5import/h5diff
- ADD_H5_TEST (tbin3 0 --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-tbin3 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-tbin3")
-
- IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- ADD_TEST (NAME H5DUMP-clear-out3D COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out3D.h5)
- SET_TESTS_PROPERTIES (H5DUMP-clear-out3D PROPERTIES DEPENDS H5DUMP-tbin3)
- ADD_TEST (NAME H5DUMP-h5import-out3D COMMAND h5import out3.bin -c tbin3.out -o out3D.h5)
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out3D PROPERTIES DEPENDS H5DUMP-clear-out3D)
- ADD_TEST (NAME H5DUMP-h5diff-out3D COMMAND h5diff tbinary.h5 out3D.h5 /integer /integer -q)
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3D PROPERTIES DEPENDS H5DUMP-h5import-out3D)
- SET (last_test "H5DUMP-h5diff-out3D")
- ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
-
- ADD_TEST (NAME H5DUMP-clear-out3 COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/out3.h5)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-clear-out3 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- ADD_TEST (NAME H5DUMP-h5import-out3 COMMAND h5import out3.bin -c out3.h5import -o out3.h5)
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5import-out3 PROPERTIES DEPENDS H5DUMP-clear-out3)
- ADD_TEST (NAME H5DUMP-h5diff-out3 COMMAND h5diff tbinary.h5 out3.h5 /integer /integer -q)
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- SET_TESTS_PROPERTIES (H5DUMP-h5diff-out3 PROPERTIES DEPENDS H5DUMP-h5import-out3)
- SET (last_test "H5DUMP-h5diff-out3")
-
- ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5)
+ ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE)
+
IF (NOT HDF5_ENABLE_USING_MEMCHECKER)
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-tbin4")
+ ADD_TEST (NAME H5DUMP-tbin4-bin-clear-objects COMMAND ${CMAKE_COMMAND} -E remove out4.bin)
+ SET_TESTS_PROPERTIES (H5DUMP-tbin4-bin-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o out4.bin tbinary.h5)
+ SET_TESTS_PROPERTIES (H5DUMP-tbin4 PROPERTIES DEPENDS H5DUMP-tbin4-bin-clear-objects)
ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER)
-
- # Clean up binary output files
- IF (NOT HDF5_NOCLEANUP)
- ADD_TEST (
- NAME H5DUMP-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- out1.bin
- out1LE.bin
- out2.bin
- out3.bin
- out4.bin
- out1.h5
- out3.h5
- )
- SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-clear-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP-clear-objects")
- ENDIF (NOT HDF5_NOCLEANUP)
# test for dataset region references
ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5)
@@ -1471,7 +1657,7 @@ IF (BUILD_TESTING)
ADD_H5ERR_MASK_TEST (filter_fail 1 --enable-error-stack filter_fail.h5)
# test for -o -y for dataset with attributes
- ADD_H5_TEST (tall-6 0 --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5)
+ ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o)
####### test for dataset packed bits ######
IF (HDF5_ENABLE_USING_MEMCHECKER)
@@ -1587,16 +1773,16 @@ IF (BUILD_TESTING)
tpbitsUnsignedLongLong16.out
tpbitsUnsignedLongLong16.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
- SET (last_test "H5DUMP_PACKED_BITS-clearall-objects")
+ SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
+ IF (NOT "${last_pbits_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test})
+ ENDIF (NOT "${last_pbits_test}" STREQUAL "")
+ SET (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
# test failure handling
# Missing file name
- ADD_H5_TEST (tnofilename-with-packed-bits 1 --enable-error-stack)
+ ADD_H5_PBITS_TEST (tnofilename-with-packed-bits 1 --enable-error-stack)
# Limits:
# Maximum number of packed bits is 8 (for now).
# Maximum integer size is 8*sizeof(long long).
@@ -1606,72 +1792,72 @@ IF (BUILD_TESTING)
# Normal operation on both signed and unsigned int datasets.
# Sanity check
# Their rawdata output should be the same.
- ADD_H5_TEST (tpbitsSignedWhole 0 --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedWhole 0 --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedIntWhole 0 --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedIntWhole 0 --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongWhole 0 --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongWhole 0 --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLongWhole 0 --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLongWhole 0 --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLongWhole63 0 --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLongWhole63 0 --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLongWhole1 0 --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLongWhole1 0 --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedWhole 0 --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedWhole 0 --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedIntWhole 0 --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedIntWhole 0 --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongWhole 0 --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongWhole 0 --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLongWhole 0 --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLongWhole 0 --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLongWhole63 0 --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLongWhole63 0 --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLongWhole1 0 --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLongWhole1 0 --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5)
# Half sections
- ADD_H5_TEST (tpbitsSigned4 0 --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsigned4 0 --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedInt8 0 --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedInt8 0 --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLong16 0 --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLong16 0 --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLong32 0 --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLong32 0 --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSigned4 0 --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsigned4 0 --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedInt8 0 --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedInt8 0 --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLong16 0 --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLong16 0 --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLong32 0 --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLong32 0 --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5)
# Quarter sections
- ADD_H5_TEST (tpbitsSigned2 0 --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsigned2 0 --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedInt4 0 --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedInt4 0 --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLong8 0 --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLong8 0 --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLong16 0 --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLong16 0 --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSigned2 0 --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsigned2 0 --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedInt4 0 --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedInt4 0 --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLong8 0 --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLong8 0 --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLong16 0 --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLong16 0 --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5)
# Begin and End
- ADD_H5_TEST (tpbitsSigned 0 --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsigned 0 --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedInt 0 --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedInt 0 --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLong 0 --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLong 0 --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5)
- ADD_H5_TEST (tpbitsSignedLongLong 0 --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5)
- ADD_H5_TEST (tpbitsUnsignedLongLong 0 --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSigned 0 --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsigned 0 --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedInt 0 --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedInt 0 --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLong 0 --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLong 0 --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsSignedLongLong 0 --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsUnsignedLongLong 0 --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5)
# Overlapped packed bits.
- ADD_H5_TEST (tpbitsOverlapped 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsOverlapped 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5)
# Maximum number of packed bits.
- ADD_H5_TEST (tpbitsMax 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsMax 0 --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
# Compound type.
- ADD_H5_TEST (tpbitsCompound 0 --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5)
+ ADD_H5_PBITS_TEST (tpbitsCompound 0 --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5)
# Array type.
- ADD_H5_TEST (tpbitsArray 0 --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5)
+ ADD_H5_PBITS_TEST (tpbitsArray 0 --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5)
# Test Error handling.
# Too many packed bits requested. Max is 8 for now.
- ADD_H5_TEST (tpbitsMaxExceeded 1 --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsMaxExceeded 1 --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5)
# Offset too large. Max is 8*sizeof(long long.
- ADD_H5_TEST (tpbitsOffsetExceeded 1 --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5)
- ADD_H5_TEST (tpbitsCharOffsetExceeded 0 --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5)
- ADD_H5_TEST (tpbitsIntOffsetExceeded 0 --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5)
- ADD_H5_TEST (tpbitsLongOffsetExceeded 0 --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsOffsetExceeded 1 --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsCharOffsetExceeded 0 --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsIntOffsetExceeded 0 --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsLongOffsetExceeded 0 --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5)
# Bad offset, must not be negative.
- ADD_H5_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5)
# Bad length, must not be positive.
- ADD_H5_TEST (tpbitsLengthPositive 1 --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsLengthPositive 1 --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5)
# Offset+Length is too large. Max is 8*sizeof(long long).
- ADD_H5_TEST (tpbitsLengthExceeded 1 --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5)
- ADD_H5_TEST (tpbitsCharLengthExceeded 0 --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5)
- ADD_H5_TEST (tpbitsIntLengthExceeded 0 --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5)
- ADD_H5_TEST (tpbitsLongLengthExceeded 0 --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsLengthExceeded 1 --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsCharLengthExceeded 0 --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsIntLengthExceeded 0 --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsLongLengthExceeded 0 --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5)
# Incomplete pair of packed bits request.
- ADD_H5_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5)
+ ADD_H5_PBITS_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5)
IF (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
@@ -1808,10 +1994,10 @@ IF (BUILD_TESTING)
tvlstr.h5.out
tvlstr.h5.out.err
)
- SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- IF (NOT "${last_test}" STREQUAL "")
- SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_test})
- ENDIF (NOT "${last_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
+ IF (NOT "${last_xml_test}" STREQUAL "")
+ SET_TESTS_PROPERTIES (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test})
+ ENDIF (NOT "${last_xml_test}" STREQUAL "")
SET (last_test "H5DUMP-XML-clearall-objects")
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in
index 6b4a6e6..4741683 100644
--- a/tools/h5dump/Makefile.in
+++ b/tools/h5dump/Makefile.in
@@ -240,6 +240,7 @@ H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
HAVE_FORTRAN_2003 = @HAVE_FORTRAN_2003@
+HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
HDF_CXX = @HDF_CXX@
@@ -291,7 +292,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PARALLEL = @PARALLEL@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
-PTHREAD = @PTHREAD@
RANLIB = @RANLIB@
ROOT = @ROOT@
RUNPARALLEL = @RUNPARALLEL@
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index 34b8bc4..d89202c 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -71,7 +71,7 @@ struct handler_t {
*/
/* The following initialization makes use of C language cancatenating */
/* "xxx" "yyy" into "xxxyyy". */
-static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o:b*F:s:S:Aq:z:m:RECM:";
+static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:Aq:z:m:RECM:O*";
static struct long_options l_opts[] = {
{ "help", no_arg, 'h' },
{ "hel", no_arg, 'h' },
@@ -139,11 +139,11 @@ static struct long_options l_opts[] = {
{ "grou", require_arg, 'g' },
{ "gro", require_arg, 'g' },
{ "gr", require_arg, 'g' },
- { "output", require_arg, 'o' },
- { "outpu", require_arg, 'o' },
- { "outp", require_arg, 'o' },
- { "out", require_arg, 'o' },
- { "ou", require_arg, 'o' },
+ { "output", optional_arg, 'o' },
+ { "outpu", optional_arg, 'o' },
+ { "outp", optional_arg, 'o' },
+ { "out", optional_arg, 'o' },
+ { "ou", optional_arg, 'o' },
{ "soft-link", require_arg, 'l' },
{ "soft-lin", require_arg, 'l' },
{ "soft-li", require_arg, 'l' },
@@ -187,6 +187,7 @@ static struct long_options l_opts[] = {
{ "enable-error-stack", no_arg, 'E' },
{ "packed-bits", require_arg, 'M' },
{ "no-compact-subset", no_arg, 'C' },
+ { "ddl", optional_arg, 'O' },
{ NULL, 0, '\0' }
};
@@ -230,39 +231,39 @@ leave(int ret)
static void
usage(const char *prog)
{
- HDfflush(rawoutstream);
- HDfprintf(rawoutstream, "usage: %s [OPTIONS] files\n", prog);
- HDfprintf(rawoutstream, " OPTIONS\n");
- HDfprintf(rawoutstream, " -h, --help Print a usage message and exit\n");
- HDfprintf(rawoutstream, " -n, --contents Print a list of the file contents and exit\n");
- HDfprintf(rawoutstream, " Optional value 1 also prints attributes.\n");
- HDfprintf(rawoutstream, " -B, --superblock Print the content of the super block\n");
- HDfprintf(rawoutstream, " -H, --header Print the header only; no data is displayed\n");
- HDfprintf(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
- HDfprintf(rawoutstream, " -i, --object-ids Print the object ids\n");
- HDfprintf(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n");
- HDfprintf(rawoutstream, " -e, --escape Escape non printing characters\n");
- HDfprintf(rawoutstream, " -V, --version Print version number and exit\n");
- HDfprintf(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
- HDfprintf(rawoutstream, " If an attribute name contains a slash (/), escape the\n");
- HDfprintf(rawoutstream, " slash with a preceding backslash (\\).\n");
- HDfprintf(rawoutstream, " (See example section below.)\n");
- HDfprintf(rawoutstream, " -d P, --dataset=P Print the specified dataset\n");
- HDfprintf(rawoutstream, " -y, --noindex Do not print array indices with the data\n");
- HDfprintf(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n");
- HDfprintf(rawoutstream, " -f D, --filedriver=D Specify which driver to open the file with\n");
- HDfprintf(rawoutstream, " -g P, --group=P Print the specified group and all members\n");
- HDfprintf(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
- HDfprintf(rawoutstream, " -o F, --output=F Output raw data into file F\n");
- HDfprintf(rawoutstream, " -b B, --binary=B Binary file output, of form B\n");
- HDfprintf(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n");
- HDfprintf(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
- HDfprintf(rawoutstream, " sets the number of columns to the maximum (65535).\n");
- HDfprintf(rawoutstream, " Default width is 80 columns.\n");
- HDfprintf(rawoutstream, " -m T, --format=T Set the floating point output format\n");
- HDfprintf(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
- HDfprintf(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
- HDfprintf(rawoutstream,
+ FLUSHSTREAM(rawoutstream);
+ PRINTSTREAM(rawoutstream, "usage: %s [OPTIONS] files\n", prog);
+ PRINTVALSTREAM(rawoutstream, " OPTIONS\n");
+ PRINTVALSTREAM(rawoutstream, " -h, --help Print a usage message and exit\n");
+ PRINTVALSTREAM(rawoutstream, " -n, --contents Print a list of the file contents and exit\n");
+ PRINTVALSTREAM(rawoutstream, " Optional value 1 also prints attributes.\n");
+ PRINTVALSTREAM(rawoutstream, " -B, --superblock Print the content of the super block\n");
+ PRINTVALSTREAM(rawoutstream, " -H, --header Print the header only; no data is displayed\n");
+ PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n");
+ PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n");
+ PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n");
+ PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n");
+ PRINTVALSTREAM(rawoutstream, " -V, --version Print version number and exit\n");
+ PRINTVALSTREAM(rawoutstream, " -a P, --attribute=P Print the specified attribute\n");
+ PRINTVALSTREAM(rawoutstream, " If an attribute name contains a slash (/), escape the\n");
+ PRINTVALSTREAM(rawoutstream, " slash with a preceding backslash (\\).\n");
+ PRINTVALSTREAM(rawoutstream, " (See example section below.)\n");
+ PRINTVALSTREAM(rawoutstream, " -d P, --dataset=P Print the specified dataset\n");
+ PRINTVALSTREAM(rawoutstream, " -y, --noindex Do not print array indices with the data\n");
+ PRINTVALSTREAM(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n");
+ PRINTVALSTREAM(rawoutstream, " -f D, --filedriver=D Specify which driver to open the file with\n");
+ PRINTVALSTREAM(rawoutstream, " -g P, --group=P Print the specified group and all members\n");
+ PRINTVALSTREAM(rawoutstream, " -l P, --soft-link=P Print the value(s) of the specified soft link\n");
+ PRINTVALSTREAM(rawoutstream, " -o F, --output=F Output raw data into file F\n");
+ PRINTVALSTREAM(rawoutstream, " -b B, --binary=B Binary file output, of form B\n");
+ PRINTVALSTREAM(rawoutstream, " -t P, --datatype=P Print the specified named datatype\n");
+ PRINTVALSTREAM(rawoutstream, " -w N, --width=N Set the number of columns of output. A value of 0 (zero)\n");
+ PRINTVALSTREAM(rawoutstream, " sets the number of columns to the maximum (65535).\n");
+ PRINTVALSTREAM(rawoutstream, " Default width is 80 columns.\n");
+ PRINTVALSTREAM(rawoutstream, " -m T, --format=T Set the floating point output format\n");
+ PRINTVALSTREAM(rawoutstream, " -q Q, --sort_by=Q Sort groups and attributes by index Q\n");
+ PRINTVALSTREAM(rawoutstream, " -z Z, --sort_order=Z Sort groups and attributes by order Z\n");
+ PRINTVALSTREAM(rawoutstream,
" -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"
" format L for an integer dataset specified with\n"
" option -d. L is a list of offset,length values,\n"
@@ -270,92 +271,94 @@ usage(const char *prog)
" the data value and length is the number of bits of\n"
" the mask.\n"
);
- HDfprintf(rawoutstream, " -R, --region Print dataset pointed by region references\n");
- HDfprintf(rawoutstream, " -x, --xml Output in XML using Schema\n");
- HDfprintf(rawoutstream, " -u, --use-dtd Output in XML using DTD\n");
- HDfprintf(rawoutstream, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
- HDfprintf(rawoutstream, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
- HDfprintf(rawoutstream, " \":\": no namespace, default: \"hdf5:\"\n");
- HDfprintf(rawoutstream, " E.g., to dump a file called `-f', use h5dump -- -f\n");
- HDfprintf(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
- HDfprintf(rawoutstream, " occur.\n");
- HDfprintf(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
- HDfprintf(rawoutstream, " of \"[\" in dataset names.\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " Subsetting is available by using the following options with a dataset\n");
- HDfprintf(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
- HDfprintf(rawoutstream, " Thus, the options mirror those for performing a hyperslab selection.\n");
- HDfprintf(rawoutstream, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
- HDfprintf(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
- HDfprintf(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " -s START, --start=START Offset of start of subsetting selection\n");
- HDfprintf(rawoutstream, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
- HDfprintf(rawoutstream, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
- HDfprintf(rawoutstream, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
- HDfprintf(rawoutstream, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
- HDfprintf(rawoutstream, " number of dimensions in the dataspace being queried\n");
- HDfprintf(rawoutstream, " (Alternate compact form of subsetting is described in the Reference Manual)\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n");
- HDfprintf(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
- HDfprintf(rawoutstream, " the file driver flag, the file will be opened with each driver in\n");
- HDfprintf(rawoutstream, " turn and in the order specified above until one driver succeeds\n");
- HDfprintf(rawoutstream, " in opening the file.\n");
- HDfprintf(rawoutstream, " These are the letters that are appended to the file name(without .h5) when opening\n");
- HDfprintf(rawoutstream, " names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are:\n");
- HDfprintf(rawoutstream, " m: All meta data when using the split driver.\n");
- HDfprintf(rawoutstream, " s: The userblock, superblock, and driver info block\n");
- HDfprintf(rawoutstream, " b: B-tree nodes\n");
- HDfprintf(rawoutstream, " r: Dataset raw data\n");
- HDfprintf(rawoutstream, " g: Global heap\n");
- HDfprintf(rawoutstream, " l: local heap (object names)\n");
- HDfprintf(rawoutstream, " o: object headers\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " F - is a filename.\n");
- HDfprintf(rawoutstream, " P - is the full path from the root group to the object.\n");
- HDfprintf(rawoutstream, " N - is an integer greater than 1.\n");
- HDfprintf(rawoutstream, " T - is a string containing the floating point format, e.g '%%.3f'\n");
- HDfprintf(rawoutstream, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
- HDfprintf(rawoutstream, " updated by [IETF RFC 2732])\n");
- HDfprintf(rawoutstream, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
- HDfprintf(rawoutstream, " file type, LE or BE for pre-existing little or big endian types.\n");
- HDfprintf(rawoutstream, " Must be used with -o (output file) and it is recommended that\n");
- HDfprintf(rawoutstream, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
- HDfprintf(rawoutstream, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
- HDfprintf(rawoutstream, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " Examples:\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " Attribute \"high/low\" of the group /bar_none in the file quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -a \"/bar_none/high\\/low\" quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
- HDfprintf(rawoutstream, " using a little-endian type\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 5) Dataset foo in files file1.h5 file2.h5 file3.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -d /foo file1.h5 file2.h5 file3.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5\n");
- HDfprintf(rawoutstream, "\n");
- HDfprintf(rawoutstream, " h5dump -d /foo -f split splitfile\n");
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " -R, --region Print dataset pointed by region references\n");
+ PRINTVALSTREAM(rawoutstream, " -x, --xml Output in XML using Schema\n");
+ PRINTVALSTREAM(rawoutstream, " -u, --use-dtd Output in XML using DTD\n");
+ PRINTVALSTREAM(rawoutstream, " -D U, --xml-dtd=U Use the DTD or schema at U\n");
+ PRINTVALSTREAM(rawoutstream, " -X S, --xml-ns=S (XML Schema) Use qualified names n the XML\n");
+ PRINTVALSTREAM(rawoutstream, " \":\": no namespace, default: \"hdf5:\"\n");
+ PRINTVALSTREAM(rawoutstream, " E.g., to dump a file called `-f', use h5dump -- -f\n");
+ PRINTVALSTREAM(rawoutstream, " --enable-error-stack Prints messages from the HDF5 error stack as they\n");
+ PRINTVALSTREAM(rawoutstream, " occur.\n");
+ PRINTVALSTREAM(rawoutstream, " --no-compact-subset Disable compact form of subsetting and allow the use\n");
+ PRINTVALSTREAM(rawoutstream, " of \"[\" in dataset names.\n");
+ PRINTVALSTREAM(rawoutstream, " -O F, --ddl=F Output ddl text into file F\n");
+ PRINTVALSTREAM(rawoutstream, " Do not use filename F to suppress ddl display\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Subsetting is available by using the following options with a dataset\n");
+ PRINTVALSTREAM(rawoutstream, " attribute. Subsetting is done by selecting a hyperslab from the data.\n");
+ PRINTVALSTREAM(rawoutstream, " Thus, the options mirror those for performing a hyperslab selection.\n");
+ PRINTVALSTREAM(rawoutstream, " One of the START, COUNT, STRIDE, or BLOCK parameters are mandatory if you do subsetting.\n");
+ PRINTVALSTREAM(rawoutstream, " The STRIDE, COUNT, and BLOCK parameters are optional and will default to 1 in\n");
+ PRINTVALSTREAM(rawoutstream, " each dimension. START is optional and will default to 0 in each dimension.\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " -s START, --start=START Offset of start of subsetting selection\n");
+ PRINTVALSTREAM(rawoutstream, " -S STRIDE, --stride=STRIDE Hyperslab stride\n");
+ PRINTVALSTREAM(rawoutstream, " -c COUNT, --count=COUNT Number of blocks to include in selection\n");
+ PRINTVALSTREAM(rawoutstream, " -k BLOCK, --block=BLOCK Size of block in hyperslab\n");
+ PRINTVALSTREAM(rawoutstream, " START, COUNT, STRIDE, and BLOCK - is a list of integers the number of which are equal to the\n");
+ PRINTVALSTREAM(rawoutstream, " number of dimensions in the dataspace being queried\n");
+ PRINTVALSTREAM(rawoutstream, " (Alternate compact form of subsetting is described in the Reference Manual)\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " D - is the file driver to use in opening the file. Acceptable values\n");
+ PRINTVALSTREAM(rawoutstream, " are \"sec2\", \"family\", \"split\", \"multi\", \"direct\", and \"stream\". Without\n");
+ PRINTVALSTREAM(rawoutstream, " the file driver flag, the file will be opened with each driver in\n");
+ PRINTVALSTREAM(rawoutstream, " turn and in the order specified above until one driver succeeds\n");
+ PRINTVALSTREAM(rawoutstream, " in opening the file.\n");
+ PRINTVALSTREAM(rawoutstream, " These are the letters that are appended to the file name(without .h5) when opening\n");
+ PRINTVALSTREAM(rawoutstream, " names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are:\n");
+ PRINTVALSTREAM(rawoutstream, " m: All meta data when using the split driver.\n");
+ PRINTVALSTREAM(rawoutstream, " s: The userblock, superblock, and driver info block\n");
+ PRINTVALSTREAM(rawoutstream, " b: B-tree nodes\n");
+ PRINTVALSTREAM(rawoutstream, " r: Dataset raw data\n");
+ PRINTVALSTREAM(rawoutstream, " g: Global heap\n");
+ PRINTVALSTREAM(rawoutstream, " l: local heap (object names)\n");
+ PRINTVALSTREAM(rawoutstream, " o: object headers\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " F - is a filename.\n");
+ PRINTVALSTREAM(rawoutstream, " P - is the full path from the root group to the object.\n");
+ PRINTVALSTREAM(rawoutstream, " N - is an integer greater than 1.\n");
+ PRINTVALSTREAM(rawoutstream, " T - is a string containing the floating point format, e.g '%%.3f'\n");
+ PRINTVALSTREAM(rawoutstream, " U - is a URI reference (as defined in [IETF RFC 2396],\n");
+ PRINTVALSTREAM(rawoutstream, " updated by [IETF RFC 2732])\n");
+ PRINTVALSTREAM(rawoutstream, " B - is the form of binary output: NATIVE for a memory type, FILE for the\n");
+ PRINTVALSTREAM(rawoutstream, " file type, LE or BE for pre-existing little or big endian types.\n");
+ PRINTVALSTREAM(rawoutstream, " Must be used with -o (output file) and it is recommended that\n");
+ PRINTVALSTREAM(rawoutstream, " -d (dataset) is used. B is an optional argument, defaults to NATIVE\n");
+ PRINTVALSTREAM(rawoutstream, " Q - is the sort index type. It can be \"creation_order\" or \"name\" (default)\n");
+ PRINTVALSTREAM(rawoutstream, " Z - is the sort order type. It can be \"descending\" or \"ascending\" (default)\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Examples:\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -a /bar_none/foo quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " Attribute \"high/low\" of the group /bar_none in the file quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -a \"/bar_none/high\\/low\" quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 2) Selecting a subset from dataset /foo in file quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -d /foo -s \"0,1\" -S \"1,1\" -c \"2,3\" -k \"2,2\" quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 3) Saving dataset 'dset' in file quux.h5 to binary file 'out.bin'\n");
+ PRINTVALSTREAM(rawoutstream, " using a little-endian type\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -d /dset -b LE -o out.bin quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 4) Display two packed bits (bits 0-1 and bits 4-6) in the dataset /dset\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -d /dset -M 0,1,4,3 quux.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 5) Dataset foo in files file1.h5 file2.h5 file3.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -d /foo file1.h5 file2.h5 file3.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " 6) Dataset foo in split files splitfile-m.h5 splitfile-r.h5\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, " h5dump -d /foo -f split splitfile\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
@@ -500,6 +503,7 @@ table_list_free(void)
static int
set_data_output_file(const char *fname, int is_bin)
{
+ int retvalue = FAIL;
FILE *f; /* temporary holding place for the stream pointer
* so that rawdatastream is changed only when succeeded */
@@ -510,21 +514,68 @@ set_data_output_file(const char *fname, int is_bin)
rawdatastream = NULL;
}
- /* binary output */
- if (is_bin) {
- if ((f = HDfopen(fname, "wb")) != NULL) {
- rawdatastream = f;
- return 0;
+ /* First check if filename is string "NULL" */
+ if (fname != NULL) {
+ /* binary output */
+ if (is_bin) {
+ if ((f = HDfopen(fname, "wb")) != NULL) {
+ rawdatastream = f;
+ retvalue = SUCCEED;
+ }
+ }
+ else {
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawdatastream = f;
+ retvalue = SUCCEED;
+ }
}
}
else {
+ rawdatastream = NULL;
+ retvalue = SUCCEED;
+ }
+
+ return retvalue;
+}
+
+/*-------------------------------------------------------------------------
+ * Function: set_attr_output_file
+ *
+ * Purpose: Open fname as the output file for attribute raw data.
+ * Set rawattrstream as its file stream.
+ *
+ * Return: 0 -- succeeded
+ * negative -- failed
+ *
+ *-------------------------------------------------------------------------
+ */
+static int
+set_attr_output_file(const char *fname, int is_bin)
+{
+ int retvalue = FAIL;
+ FILE *f; /* temporary holding place for the stream pointer
+ * so that rawattrstream is changed only when succeeded */
+
+ if (rawattrstream && rawattrstream != stdout) {
+ if (HDfclose(rawattrstream))
+ HDperror("closing rawattrstream");
+ else
+ rawattrstream = NULL;
+ }
+
+ /* First check if filename is string "NULL" */
+ if (fname != NULL) {
if ((f = HDfopen(fname, "w")) != NULL) {
- rawdatastream = f;
- return 0;
+ rawattrstream = f;
+ retvalue = SUCCEED;
}
}
+ else {
+ rawattrstream = NULL;
+ retvalue = SUCCEED;
+ }
- return -1;
+ return retvalue;
}
/*-------------------------------------------------------------------------
@@ -541,6 +592,7 @@ set_data_output_file(const char *fname, int is_bin)
static int
set_output_file(const char *fname)
{
+ int retvalue = FAIL;
FILE *f; /* temporary holding place for the stream pointer
* so that rawoutstream is changed only when succeeded */
@@ -550,13 +602,19 @@ set_output_file(const char *fname)
else
rawoutstream = NULL;
}
-
- if ((f = HDfopen(fname, "w")) != NULL) {
- rawoutstream = f;
- return 0;
+ /* First check if filename is string "NULL" */
+ if (fname != NULL) {
+ if ((f = HDfopen(fname, "w")) != NULL) {
+ rawoutstream = f;
+ retvalue = SUCCEED;
+ }
+ }
+ else {
+ rawoutstream = NULL;
+ retvalue = SUCCEED;
}
- return -1;
+ return retvalue;
}
/*-------------------------------------------------------------------------
@@ -573,6 +631,7 @@ set_output_file(const char *fname)
static int
set_error_file(const char *fname)
{
+ int retvalue = FAIL;
FILE *f; /* temporary holding place for the stream pointer
* so that rawerrorstream is changed only when succeeded */
@@ -585,10 +644,10 @@ set_error_file(const char *fname)
if ((f = HDfopen(fname, "w")) != NULL) {
rawerrorstream = f;
- return 0;
+ retvalue = SUCCEED;
}
- return -1;
+ return retvalue;
}
/*-------------------------------------------------------------------------
@@ -1125,6 +1184,13 @@ parse_start:
last_was_dset = FALSE;
break;
+ case 'O':
+ if (set_output_file(opt_arg) < 0) {
+ usage(h5tools_getprogname());
+ goto error;
+ }
+ break;
+
case 'o':
if ( bin_output ) {
if (set_data_output_file(opt_arg, 1) < 0) {
@@ -1133,9 +1199,17 @@ parse_start:
}
}
else {
- if (set_data_output_file(opt_arg, 0) < 0) {
- usage(h5tools_getprogname());
- goto error;
+ if(display_attr_data && !display_data) {
+ if (set_attr_output_file(opt_arg, 0) < 0) {
+ usage(h5tools_getprogname());
+ goto error;
+ }
+ }
+ if(display_data || display_all) {
+ if (set_data_output_file(opt_arg, 0) < 0) {
+ usage(h5tools_getprogname());
+ goto error;
+ }
}
}
@@ -1558,12 +1632,12 @@ main(int argc, const char *argv[])
begin_obj(h5tools_dump_header_format->filebegin, fname, h5tools_dump_header_format->fileblockbegin);
}
else {
- HDfprintf(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
+ PRINTVALSTREAM(rawoutstream, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
/* alternative first element, depending on schema or DTD. */
if (useschema) {
if (HDstrcmp(xmlnsprefix,"") == 0) {
- HDfprintf(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
+ PRINTSTREAM(rawoutstream, "<HDF5-File xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"%s\">\n",
xml_dtd_uri);
}
else {
@@ -1575,7 +1649,7 @@ main(int argc, const char *argv[])
indx = HDstrrchr(ns,(int)':');
if (indx) *indx = '\0';
- HDfprintf(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
+ PRINTSTREAM(rawoutstream, "<%sHDF5-File xmlns:%s=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File\" "
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" "
"xsi:schemaLocation=\"http://hdfgroup.org/HDF5/XML/schema/HDF5-File "
"http://www.hdfgroup.org/HDF5/XML/schema/HDF5-File.xsd\">\n",xmlnsprefix,ns);
@@ -1583,17 +1657,17 @@ main(int argc, const char *argv[])
}
}
else {
- HDfprintf(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
- HDfprintf(rawoutstream, "<HDF5-File>\n");
+ PRINTSTREAM(rawoutstream, "<!DOCTYPE HDF5-File PUBLIC \"HDF5-File.dtd\" \"%s\">\n", xml_dtd_uri);
+ PRINTVALSTREAM(rawoutstream, "<HDF5-File>\n");
}
}
if (!doxml) {
if (display_fi) {
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
dump_fcontents(fid);
end_obj(h5tools_dump_header_format->fileend,h5tools_dump_header_format->fileblockend);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
goto done;
}
@@ -1612,7 +1686,7 @@ main(int argc, const char *argv[])
dump_function_table->dump_group_function(gid, "/" );
if (!doxml)
dump_indent -= COL;
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
if(H5Gclose(gid) < 0) {
@@ -1634,15 +1708,15 @@ main(int argc, const char *argv[])
hand[i].func(fid, hand[i].obj, hand[i].subset_info, 1, NULL);
}
}
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
if (!doxml) {
end_obj(h5tools_dump_header_format->fileend, h5tools_dump_header_format->fileblockend);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
}
else {
- HDfprintf(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
+ PRINTSTREAM(rawoutstream, "</%sHDF5-File>\n", xmlnsprefix);
}
/* Free tables for objects */
table_list_free();
diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c
index 6f5fd3f..c4a9ecb 100644
--- a/tools/h5dump/h5dump_ddl.c
+++ b/tools/h5dump/h5dump_ddl.c
@@ -1168,23 +1168,23 @@ dump_fcpl(hid_t fid)
* SUPER_BLOCK
*-------------------------------------------------------------------------
*/
- HDfprintf(rawoutstream, "\n%s %s\n",SUPER_BLOCK, BEGIN);
+ PRINTSTREAM(rawoutstream, "\n%s %s\n",SUPER_BLOCK, BEGIN);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version);
+ PRINTSTREAM(rawoutstream, "%s %u\n","SUPERBLOCK_VERSION", finfo.super.version);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","FREELIST_VERSION", finfo.free.version);
+ PRINTSTREAM(rawoutstream, "%s %u\n","FREELIST_VERSION", finfo.free.version);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */
+ PRINTSTREAM(rawoutstream, "%s %u\n","SYMBOLTABLE_VERSION", 0); /* Retain this for backward compatibility, for now (QAK) */
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version);
+ PRINTSTREAM(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size);
+ PRINTSTREAM(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size);
+ PRINTSTREAM(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik);
+ PRINTSTREAM(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %d\n","BTREE_LEAF", sym_lk);
+ PRINTSTREAM(rawoutstream, "%s %d\n","BTREE_LEAF", sym_lk);
#ifdef SHOW_FILE_DRIVER
if (H5FD_CORE==fdriver)
@@ -1215,37 +1215,42 @@ dump_fcpl(hid_t fid)
/* Take out this because the driver used can be different from the
* standard output. */
/*indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %s\n","FILE_DRIVER", dname);*/
+ PRINTSTREAM(rawoutstream, "%s %s\n","FILE_DRIVER", dname);*/
#endif
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %u\n","ISTORE_K", istore_ik);
+ PRINTSTREAM(rawoutstream, "%s %u\n","ISTORE_K", istore_ik);
indentation(dump_indent + COL);
- if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST)
- HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST");
- else if(fs_strategy == H5F_FILE_SPACE_ALL)
- HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL");
- else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD)
- HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD");
- else if(fs_strategy == H5F_FILE_SPACE_VFD)
- HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD");
- else
- HDfprintf(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
+ if(fs_strategy == H5F_FILE_SPACE_ALL_PERSIST) {
+ PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL_PERSIST");
+ }
+ else if(fs_strategy == H5F_FILE_SPACE_ALL) {
+ PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_ALL");
+ }
+ else if(fs_strategy == H5F_FILE_SPACE_AGGR_VFD) {
+ PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_AGGR_VFD");
+ }
+ else if(fs_strategy == H5F_FILE_SPACE_VFD) {
+ PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "H5F_FILE_SPACE_VFD");
+ }
+ else {
+ PRINTSTREAM(rawoutstream, "%s %s\n", "FILE_SPACE_STRATEGY", "Unknown strategy");
+ }
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold);
+ PRINTSTREAM(rawoutstream, "%s %Hu\n","FREE_SPACE_THRESHOLD", fs_threshold);
/*-------------------------------------------------------------------------
* USER_BLOCK
*-------------------------------------------------------------------------
*/
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "USER_BLOCK %s\n",BEGIN);
+ PRINTSTREAM(rawoutstream, "USER_BLOCK %s\n",BEGIN);
indentation(dump_indent + COL + COL);
- HDfprintf(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock);
+ PRINTSTREAM(rawoutstream,"%s %Hu\n","USERBLOCK_SIZE", userblock);
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s\n",END);
+ PRINTSTREAM(rawoutstream, "%s\n",END);
- HDfprintf(rawoutstream, "%s",END);
+ PRINTSTREAM(rawoutstream, "%s",END);
}
/*-------------------------------------------------------------------------
@@ -1264,7 +1269,7 @@ dump_fcpl(hid_t fid)
void
dump_fcontents(hid_t fid)
{
- HDfprintf(rawoutstream, "%s %s\n",FILE_CONTENTS, BEGIN);
+ PRINTSTREAM(rawoutstream, "%s %s\n",FILE_CONTENTS, BEGIN);
/* special case of unamed types in root group */
if (unamedtype) {
@@ -1272,14 +1277,14 @@ dump_fcontents(hid_t fid)
for (u = 0; u < type_table->nobjs; u++) {
if (!type_table->objs[u].recorded)
- HDfprintf(rawoutstream, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno);
+ PRINTSTREAM(rawoutstream, " %-10s /#"H5_PRINTF_HADDR_FMT"\n", "datatype", type_table->objs[u].objno);
}
}
/* print objects in the files */
h5trav_print(fid);
- HDfprintf(rawoutstream, " %s\n",END);
+ PRINTSTREAM(rawoutstream, " %s\n",END);
}
/*-------------------------------------------------------------------------
@@ -1564,12 +1569,12 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis
if(found_obj) {
if (found_obj->displayed) {
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(dump_indent);
begin_obj(h5tools_dump_header_format->datasetbegin, real_name, h5tools_dump_header_format->datasetblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(dump_indent + COL);
- HDfprintf(rawoutstream, "%s \"%s\"\n", HARDLINK, found_obj->objname);
+ PRINTSTREAM(rawoutstream, "%s \"%s\"\n", HARDLINK, found_obj->objname);
indentation(dump_indent);
end_obj(h5tools_dump_header_format->datasetend, h5tools_dump_header_format->datasetblockend);
}
@@ -1621,9 +1626,9 @@ handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const cha
if((gid = H5Gopen2(fid, group, H5P_DEFAULT)) < 0) {
if (pe) {
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
begin_obj(h5tools_dump_header_format->groupbegin, real_name, h5tools_dump_header_format->groupblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
error_msg("unable to open group \"%s\"\n", real_name);
end_obj(h5tools_dump_header_format->groupend, h5tools_dump_header_format->groupblockend);
@@ -1678,15 +1683,15 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
}
else {
char *buf = (char *)HDmalloc(linfo.u.val_size);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
switch(linfo.type) {
case H5L_TYPE_SOFT: /* Soft link */
begin_obj(h5tools_dump_header_format->softlinkbegin, links, h5tools_dump_header_format->softlinkblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0)
- HDfprintf(rawoutstream, "LINKTARGET \"%s\"\n", buf);
+ PRINTSTREAM(rawoutstream, "LINKTARGET \"%s\"\n", buf);
else {
error_msg("h5dump error: unable to get link value for \"%s\"\n", links);
h5tools_setstatus(EXIT_FAILURE);
@@ -1696,21 +1701,21 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
case H5L_TYPE_EXTERNAL:
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
begin_obj(h5tools_dump_header_format->extlinkbegin, links, h5tools_dump_header_format->extlinkblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
if(H5Lget_val(fid, links, buf, linfo.u.val_size, H5P_DEFAULT) >= 0) {
const char *elink_file;
const char *elink_path;
if(H5Lunpack_elink_val(buf, linfo.u.val_size, NULL, &elink_file, &elink_path)>=0) {
indentation(COL);
- HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type);
+ PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type);
indentation(COL);
- HDfprintf(rawoutstream, "TARGETFILE \"%s\"\n", elink_file);
+ PRINTSTREAM(rawoutstream, "TARGETFILE \"%s\"\n", elink_file);
indentation(COL);
- HDfprintf(rawoutstream, "TARGETPATH \"%s\"\n", elink_path);
+ PRINTSTREAM(rawoutstream, "TARGETPATH \"%s\"\n", elink_path);
}
else {
error_msg("h5dump error: unable to unpack external link value for \"%s\"\n", links);
@@ -1726,12 +1731,12 @@ handle_links(hid_t fid, const char *links, void UNUSED * data, int UNUSED pe, co
default:
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
begin_obj(h5tools_dump_header_format->udlinkbegin, links, h5tools_dump_header_format->udlinkblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
- HDfprintf(rawoutstream, "LINKCLASS %d\n", linfo.type);
+ PRINTSTREAM(rawoutstream, "LINKCLASS %d\n", linfo.type);
end_obj(h5tools_dump_header_format->udlinkend, h5tools_dump_header_format->udlinkblockend);
break;
} /* end switch */
@@ -1785,9 +1790,9 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const
if(idx == type_table->nobjs) {
if (pe) {
/* unknown type */
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
begin_obj(h5tools_dump_header_format->datatypebegin, real_name, h5tools_dump_header_format->datatypeblockbegin);
- HDfprintf(rawoutstream, "\n");
+ PRINTVALSTREAM(rawoutstream, "\n");
indentation(COL);
error_msg("unable to open datatype \"%s\"\n", real_name);
end_obj(h5tools_dump_header_format->datatypeend, h5tools_dump_header_format->datatypeblockend);
diff --git a/tools/h5dump/h5dump_defines.h b/tools/h5dump/h5dump_defines.h
index 4af5360..66d73e3 100644
--- a/tools/h5dump/h5dump_defines.h
+++ b/tools/h5dump/h5dump_defines.h
@@ -26,20 +26,20 @@
#define begin_obj(obj,name,begin) \
do { \
if (name) \
- HDfprintf(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \
+ PRINTSTREAM(rawoutstream, "%s \"%s\" %s", (obj), (name), (begin)); \
else \
- HDfprintf(rawoutstream, "%s %s", (obj), (begin)); \
+ PRINTSTREAM(rawoutstream, "%s %s", (obj), (begin)); \
} while(0);
#define end_obj(obj,end) \
do { \
if(HDstrlen(end)) { \
- HDfprintf(rawoutstream, "%s", end); \
+ PRINTSTREAM(rawoutstream, "%s", end); \
if(HDstrlen(obj)) \
- HDfprintf(rawoutstream, " "); \
+ PRINTVALSTREAM(rawoutstream, " "); \
} \
if(HDstrlen(obj)) \
- HDfprintf(rawoutstream, "%s", obj); \
+ PRINTSTREAM(rawoutstream, "%s", obj); \
} while(0);
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 8a2483b..238eee9 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -31,7 +31,7 @@ H5IMPORT=../h5import/h5import # The h5import tool name
H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
-CMP='cmp -s'
+CMP='cmp'
DIFF='diff -c'
CP='cp'
DIRNAME='dirname'
@@ -56,8 +56,8 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
-TESTDIR=./testfiles
-test -d $TESTDIR || mkdir $TESTDIR
+TESTDIR=./testfiles/std
+test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
# test files
@@ -160,7 +160,6 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.h5
$SRC_H5DUMP_TESTFILES/tvldtypes5.h5
$SRC_H5DUMP_TESTFILES/tvlstr.h5
$SRC_H5DUMP_TESTFILES/tvms.h5
-$SRC_H5DUMP_TESTFILES/twidedisplay.ddl
"
LIST_OTHER_TEST_FILES="
@@ -176,6 +175,7 @@ $SRC_H5DUMP_TESTFILES/tall-3.ddl
$SRC_H5DUMP_TESTFILES/tall-4s.ddl
$SRC_H5DUMP_TESTFILES/tall-5s.ddl
$SRC_H5DUMP_TESTFILES/tall-6.ddl
+$SRC_H5DUMP_TESTFILES/tall-6.exp
$SRC_H5DUMP_TESTFILES/tallfilters.ddl
$SRC_H5DUMP_TESTFILES/tarray1.ddl
$SRC_H5DUMP_TESTFILES/tarray1_big.ddl
@@ -261,8 +261,16 @@ $SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.ddl
$SRC_H5DUMP_TESTFILES/tnestcomp-1.ddl
$SRC_H5DUMP_TESTFILES/tnestedcmpddt.ddl
$SRC_H5DUMP_TESTFILES/tnbit.ddl
+$SRC_H5DUMP_TESTFILES/tnoattrdata.ddl
+$SRC_H5DUMP_TESTFILES/tnoattrddl.ddl
+$SRC_H5DUMP_TESTFILES/tnodata.ddl
+$SRC_H5DUMP_TESTFILES/tnoddl.ddl
+$SRC_H5DUMP_TESTFILES/tnoddlfile.ddl
+$SRC_H5DUMP_TESTFILES/tnoddlfile.exp
$SRC_H5DUMP_TESTFILES/tno-subset.ddl
$SRC_H5DUMP_TESTFILES/tnullspace.ddl
+$SRC_H5DUMP_TESTFILES/trawdatafile.ddl
+$SRC_H5DUMP_TESTFILES/trawdatafile.exp
$SRC_H5DUMP_TESTFILES/zerodim.ddl
$SRC_H5DUMP_TESTFILES/tordergr1.ddl
$SRC_H5DUMP_TESTFILES/tordergr2.ddl
@@ -291,6 +299,8 @@ $SRC_H5DUMP_TESTFILES/tslink-D.ddl
$SRC_H5DUMP_TESTFILES/tsplit_file.ddl
$SRC_H5DUMP_TESTFILES/tstr-1.ddl
$SRC_H5DUMP_TESTFILES/tstr-2.ddl
+$SRC_H5DUMP_TESTFILES/tstr2bin2.exp
+$SRC_H5DUMP_TESTFILES/tstr2bin6.exp
$SRC_H5DUMP_TESTFILES/tstring.ddl
$SRC_H5DUMP_TESTFILES/tstring2.ddl
$SRC_H5DUMP_TESTFILES/tstringe.ddl
@@ -305,6 +315,10 @@ $SRC_H5DUMP_TESTFILES/tvldtypes4.ddl
$SRC_H5DUMP_TESTFILES/tvldtypes5.ddl
$SRC_H5DUMP_TESTFILES/tvlstr.ddl
$SRC_H5DUMP_TESTFILES/tvms.ddl
+$SRC_H5DUMP_TESTFILES/twidedisplay.ddl
+$SRC_H5DUMP_TESTFILES/twithddl.exp
+$SRC_H5DUMP_TESTFILES/twithddlfile.ddl
+$SRC_H5DUMP_TESTFILES/twithddlfile.exp
$SRC_H5DUMP_TESTFILES/h5dump-help.txt
$SRC_H5DUMP_TESTFILES/out3.h5import
$SRC_H5DUMP_TESTFILES/tbinregR.exp
@@ -387,7 +401,7 @@ TESTING() {
# the actual output file is calculated by replacing the `.ddl' with
# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a
# non-zero value.
-#
+# ADD_H5_TEST
TOOLTEST() {
expect="$TESTDIR/$1"
actual="$TESTDIR/`basename $1 .ddl`.out"
@@ -419,13 +433,13 @@ TOOLTEST() {
else
echo "*FAILED*"
echo " Expected result (*.ddl) differs from actual result (*.out)"
- nerrors="`expr $nerrors + 1`"
- test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
+ 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 $actual_sav $actual_err_sav $actual_ext
+ rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext
fi
}
@@ -434,6 +448,7 @@ TOOLTEST() {
# 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
+# ADD_H5_EXPORT_TEST
TOOLTEST2() {
expectdata="$TESTDIR/$1"
@@ -482,6 +497,111 @@ TOOLTEST2() {
}
+# same as TOOLTEST2 but compares generated file to expected ddl file
+# 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
+# ADD_H5_TEST_EXPORT
+TOOLTEST2A() {
+
+ expectdata="$TESTDIR/$1"
+ expect="$TESTDIR/`basename $1 .exp`.ddl"
+ actualdata="$TESTDIR/`basename $1 .exp`.txt"
+ actual="$TESTDIR/`basename $1 .exp`.out"
+ actual_err="$TESTDIR/`basename $1 .exp`.err"
+ shift
+ expectmeta="$TESTDIR/$1"
+ actualmeta="$TESTDIR/`basename $1 .exp`.txt"
+ shift
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+ cd $TESTDIR
+ $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
+ if [ ! -f $expectdata ]; then
+ # Create the expect data file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actualdata $expectdata
+ elif $DIFF $expectdata $actualdata; then
+ if [ ! -f $expectmeta ]; then
+ # Create the expect meta file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actualmeta $expectmeta
+ elif $CMP $expectmeta $actualmeta; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected metafile (*.ddl) differs from actual metafile (*.txt)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expectmeta $actualmeta |sed 's/^/ /'
+ fi
+ 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 (*.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 $actualdata $actual_err $actualmeta
+ fi
+
+}
+
+# same as TOOLTEST2 but only compares the generated data file to the expected data file
+# used for the binary tests that expect a full path in -o with -b
+# ADD_H5_EXPORT_TEST
+TOOLTEST2B() {
+
+ expectdata="$TESTDIR/$1"
+ actualdata="$TESTDIR/`basename $1 .exp`.txt"
+ actual="$TESTDIR/`basename $1 .exp`.out"
+ actual_err="$TESTDIR/`basename $1 .exp`.err"
+ shift
+
+ # Run test.
+ TESTING $DUMPER $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $DUMPER_BIN "$@"
+ ) >$actual 2>$actual_err
+ cat $actual_err >> $actual
+
+ 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
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actualdata $actual_err
+ fi
+
+}
+
# same as TOOLTEST but filters error stack outp
# Extract file name, line number, version and thread IDs because they may be different
TOOLTEST3() {
@@ -539,6 +659,7 @@ TOOLTEST3() {
# same as TOOLTEST3 but filters error stack output and compares to an error file
# Extract file name, line number, version and thread IDs because they may be different
+# ADD_H5ERR_MASK_TEST
TOOLTEST4() {
expect="$TESTDIR/$1"
@@ -669,7 +790,7 @@ IMPORTTEST()
##############################################################################
##############################################################################
-### T H E T E S T S ###
+### T H E T E S T S ###
##############################################################################
##############################################################################
# prepare for test
@@ -677,6 +798,15 @@ COPY_TESTFILES_TO_TESTDIR
#TOOLTEST h5dump-help.txt -h
+# test data output redirection
+TOOLTEST tnoddl.ddl --enable-error-stack --ddl -y packedbits.h5
+TOOLTEST tnodata.ddl --enable-error-stack --output packedbits.h5
+TOOLTEST tnoattrddl.ddl --enable-error-stack -O -y tattr.h5
+TOOLTEST tnoattrdata.ddl --enable-error-stack -A -o tattr.h5
+TOOLTEST2 trawdatafile.exp --enable-error-stack -y -o trawdatafile.txt packedbits.h5
+TOOLTEST2 tnoddlfile.exp --enable-error-stack -O -y -o tnoddlfile.txt packedbits.h5
+TOOLTEST2A twithddlfile.exp twithddl.exp --enable-error-stack --ddl=twithddl.txt -y -o twithddlfile.txt packedbits.h5
+
# test for maximum display datasets
TOOLTEST twidedisplay.ddl --enable-error-stack -w0 packedbits.h5
@@ -783,7 +913,7 @@ TOOLTEST tarray8.ddl --enable-error-stack tarray8.h5
# test for wildcards in filename (does not work with cmake)
# inconsistent across platforms TOOLTEST3 tstarfile.ddl --enable-error-stack -H -d Dataset1 tarr*.h5
-TOOLTEST4 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
+#TOOLTEST4 tqmarkfile.ddl --enable-error-stack -H -d Dataset1 tarray?.h5
TOOLTEST tmultifile.ddl --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5
# test for files with empty data
@@ -924,17 +1054,21 @@ TOOLTEST zerodim.ddl --enable-error-stack zerodim.h5
TOOLTEST tvms.ddl --enable-error-stack tvms.h5
# test for binary output
-TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinary.h5
+TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b LE tbinary.h5
+
+# test for string binary output
+TOOLTEST2B tstr2bin2.exp --enable-error-stack -d /g2/dset2 -b -o tstr2bin2.txt tstr2.h5
+TOOLTEST2B tstr2bin6.exp --enable-error-stack -d /g6/dset6 -b -o tstr2bin6.txt tstr2.h5
# NATIVE default. the NATIVE test can be validated with h5import/h5diff
-TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5
+TOOLTEST tbin1.ddl --enable-error-stack -d integer -o out1.bin -b tbinary.h5
IMPORTTEST out1.bin -c out3.h5import -o out1.h5
DIFFTEST tbinary.h5 out1.h5 /integer /integer
# Same but use h5dump as input to h5import
IMPORTTEST out1.bin -c tbin1.ddl -o out1D.h5
DIFFTEST tbinary.h5 out1D.h5 /integer /integer
-TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5
+TOOLTEST tbin2.ddl --enable-error-stack -b BE -d float -o out2.bin tbinary.h5
# the NATIVE test can be validated with h5import/h5diff
TOOLTEST tbin3.ddl --enable-error-stack -d integer -o out3.bin -b NATIVE tbinary.h5
@@ -954,12 +1088,11 @@ if test -z "$HDF5_NOCLEANUP"; then
fi
# test for dataset region references
-TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5
+TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5
TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5
-TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5
+TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5
TOOLTEST4 tattrregR.ddl --enable-error-stack -R tattrreg.h5
-
-TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5
+TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5
# Clean up text output files
if test -z "$HDF5_NOCLEANUP"; then
@@ -998,7 +1131,7 @@ TOOLTEST4 textlink.ddl --enable-error-stack textlink.h5
TOOLTEST4 filter_fail.ddl --enable-error-stack filter_fail.h5
# test for -o -y for dataset with attributes
-TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5
+TOOLTEST2 tall-6.exp --enable-error-stack -y -o tall-6.txt -d /g1/g1.1/dset1.1.1 tall.h5
# Report test results and exit
diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in
index a390766..8e8e0c0 100644
--- a/tools/h5dump/testh5dumppbits.sh.in
+++ b/tools/h5dump/testh5dumppbits.sh.in
@@ -64,8 +64,8 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
-TESTDIR=./testfiles
-test -d $TESTDIR || mkdir $TESTDIR
+TESTDIR=./testfiles/pbits
+test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
# test files
diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in
index 374f504..a70d31c 100644
--- a/tools/h5dump/testh5dumpxml.sh.in
+++ b/tools/h5dump/testh5dumpxml.sh.in
@@ -50,8 +50,8 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
-TESTDIR=./testfiles
-test -d $TESTDIR || mkdir $TESTDIR
+TESTDIR=./testfiles/xml
+test -d $TESTDIR || mkdir -p $TESTDIR
######################################################################
# test files
@@ -223,6 +223,9 @@ TESTING() {
echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012'
}
+# Source in the output filter function definitions.
+. $srcdir/../../bin/output_filter.sh
+
# Run a test and print PASS or *FAIL*. If a test fails then increment
# the `nerrors' global variable and (if $verbose is set) display the
# difference between the actual output and the expected output. The
@@ -232,18 +235,17 @@ TESTING() {
# non-zero value.
#
TOOLTEST() {
- expect="$srcdir/../testfiles/$1"
- actual="../testfiles/`basename $1 .ddl`.out"
- actual_err="../testfiles/`basename $1 .ddl`.err"
+ expect="$TESTDIR/$1"
+ actual="$TESTDIR/`basename $1 .xml`.out"
+ actual_err="$TESTDIR/`basename $1 .xml`.err"
shift
- # Run test.
- TESTING $DUMPER $@
- (
- cd $srcdir/../testfiles
- $RUNSERIAL $DUMPER_BIN $@
- ) >$actual 2>$actual_err
- cat $actual_err >> $actual
+ # Run test.
+ TESTING $DUMPER $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $DUMPER_BIN "$@"
+ ) >$actual 2>$actual_err
if [ ! -f $expect ]; then
@@ -254,7 +256,7 @@ TOOLTEST() {
echo " PASSED"
else
echo "*FAILED*"
- echo " Expected result (*.ddl) differs from actual result (*.out)"
+ echo " Expected result (*.xml) differs from actual result (*.out)"
nerrors="`expr $nerrors + 1`"
test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /'
fi
@@ -277,6 +279,8 @@ SKIP() {
### T H E T E S T S ###
##############################################################################
##############################################################################
+# prepare for test
+COPY_TESTFILES_TO_TESTDIR
# test XML
TOOLTEST tall.h5.xml --xml tall.h5