diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-21 15:44:35 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2013-08-21 15:44:35 (GMT) |
commit | 78d8f8d7d12e779f640cf037bc52fd7e8a07061c (patch) | |
tree | f6a2bb20a4a34804b0253c18c205c5f77103d843 /tools | |
parent | ff14409081fe6a5826b25658577aaf59f8fbb78f (diff) | |
parent | 482a9c28e71b0c1b3767bcf30be3c534bbc65ed9 (diff) | |
download | hdf5-78d8f8d7d12e779f640cf037bc52fd7e8a07061c.zip hdf5-78d8f8d7d12e779f640cf037bc52fd7e8a07061c.tar.gz hdf5-78d8f8d7d12e779f640cf037bc52fd7e8a07061c.tar.bz2 |
[svn-r24044] Merging r23833 through r24043 from trunk.
Diffstat (limited to 'tools')
83 files changed, 8891 insertions, 7405 deletions
diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index 137edb0..6faf332 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -17,12 +17,6 @@ SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5copy) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c) @@ -33,381 +27,8 @@ IF (BUILD_TESTING) #ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the source directory into the test directory - # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 - ) - - SET (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out - ) - - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles}") - ADD_CUSTOM_COMMAND ( - TARGET h5copy - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${listfiles} ${dest} - ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - # - # Perform h5copy according to passing parmeters - # - MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY_F-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY_F-${testname} - COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} - ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( - NAME H5COPY_F-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} - ) - SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_F_TEST) - - MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY-${testname} - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} - ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( - NAME H5COPY-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} - ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST) - - MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY-${testname}-prefill - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} - ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY-${testname} - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} - ) - SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) - # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( - NAME H5COPY-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} - ) - SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST2) - - MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY_SAME-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY_SAME-${testname}-prefill - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} - ) - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5COPY_SAME-${testname} - COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} - ) - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) - # resultcode=2 will cause the test to skip the diff test - IF (NOT ${resultcode} STREQUAL "2") - ADD_TEST ( - NAME H5COPY_SAME-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} - ) - SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - ENDIF (NOT ${resultcode} STREQUAL "2") - ENDMACRO (ADD_H5_TEST_SAME) - - # - # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target - # files instead of checking with h5ls. - # - MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ./testfiles/${testname}.out.out - ./testfiles/${testname}.out.out.err - ) - ADD_TEST ( - NAME H5COPY-CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>" - -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testname}.out.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=./testfiles/${testname}.out" - -D "TEST_MASK=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP_TEST) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # -------------------------------------------------------------------- - # test file names - # -------------------------------------------------------------------- - SET (HDF_FILE1 h5copytst) - SET (HDF_FILE2 h5copy_ref) - SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) - SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5COPY-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - simple.out.h5 - chunk.out.h5 - compact.out.h5 - compound.out.h5 - compressed.out.h5 - named_vl.out.h5 - nested_vl.out.h5 - simple_top.out.h5 - dsrename.out.h5 - grp_empty.out.h5 - grp_dsets.out.h5 - grp_nested.out.h5 - simple_group.out.h5 - grp_rename.out.h5 - grp_dsets_rename.out.h5 - A_B1_simple.out.h5 - A_B2_simple2.out.h5 - C_D_simple.out.h5 - E_F_grp_dsets.out.h5 - G_H_grp_nested.out.h5 - region_ref.out.h5 - ext_link.out.h5 - ext_link_f.out.h5 - ext_dangle_noobj.out.h5 - ext_dangle_noobj_f.out.h5 - ext_dangle_nofile.out.h5 - ext_dangle_nofile_f.out.h5 - ext_link_group.out.h5 - ext_link_group_f.out.h5 - samefile1.out.h5 - samefile2.out.h5 - h5copy_misc1.out.h5 - h5copy_misc1.out.out - h5copy_misc1.out.out.err - ) - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5COPY-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - # "Test copying various forms of datasets" - ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) - ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) - ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) - ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) - ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) - ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) - - # "Test copying dataset within group in source file to root of destination" - ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) - - # "Test copying & renaming dataset" - ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename) - - # "Test copying empty, 'full' & 'nested' groups" - ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) - - # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) - - # "Test copying objects into group hier. that doesn't exist yet in destination file" - ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) - ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) - ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - -############# COPY REFERENCES ############## - - # "Test copying object and region references" - ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) - -############# COPY EXT LINKS ############## - - # "Test copying external link directly without -f ext" - ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) - - # "Test copying external link directly with -f ext" - ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) - - # "Test copying dangling external link (no obj) directly without -f ext" - ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) - - # "Test copying dangling external link (no obj) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) - - # "Test copying dangling external link (no file) directly without -f ext" - ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) - - # "Test copying dangling external link (no file) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) - - # "Test copying a group contains external links without -f ext" - ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) - - # "Test copying a group contains external links with -f ext" - ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) - -############# Test misc. ############## - - #----------------------------------------------------------------- - # "Test copying object into group which doesn't exist, without -p" - # - ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) - - #------------------------------------------- - # "Test copying objects to the same file " - # - # - dataset - ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) - # - group with some datasets - ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/h5copy/CMakeTests.cmake b/tools/h5copy/CMakeTests.cmake new file mode 100644 index 0000000..a4cce03 --- /dev/null +++ b/tools/h5copy/CMakeTests.cmake @@ -0,0 +1,381 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the source directory into the test directory + # -------------------------------------------------------------------- + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5 + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5 + ) + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${listfiles}") + ADD_CUSTOM_COMMAND ( + TARGET h5copy + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${listfiles} ${dest} + ) + ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + # + # Perform h5copy according to passing parmeters + # + MACRO (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_F-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY_F-${testname} + COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY_F-${testname}-DIFF + COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_F_TEST) + + MACRO (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-${testname}-DIFF + COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST) + + MACRO (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY-${testname}-prefill + COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY-${testname} + COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY-${testname}-DIFF + COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST2) + + MACRO (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY_SAME-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY_SAME-${testname}-prefill + COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + ) + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5COPY_SAME-${testname} + COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + ) + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) + # resultcode=2 will cause the test to skip the diff test + IF (NOT ${resultcode} STREQUAL "2") + ADD_TEST ( + NAME H5COPY_SAME-${testname}-DIFF + COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + ) + SET_TESTS_PROPERTIES(H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + ENDIF (NOT ${resultcode} STREQUAL "2") + ENDMACRO (ADD_H5_TEST_SAME) + + # + # Similiar to ADD_H5_TEST macro. Compare to outputs from source & target + # files instead of checking with h5ls. + # + MACRO (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/${testname}.out.h5 + ./testfiles/${testname}.out.out + ./testfiles/${testname}.out.out.err + ) + ADD_TEST ( + NAME H5COPY-CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>" + -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testname}.out.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=./testfiles/${testname}.out" + -D "TEST_MASK=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_CMP_TEST) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # test file names + # -------------------------------------------------------------------- + SET (HDF_FILE1 h5copytst) + SET (HDF_FILE2 h5copy_ref) + SET (HDF_EXT_SRC_FILE h5copy_extlinks_src) + SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg) + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5COPY-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + simple.out.h5 + chunk.out.h5 + compact.out.h5 + compound.out.h5 + compressed.out.h5 + named_vl.out.h5 + nested_vl.out.h5 + simple_top.out.h5 + dsrename.out.h5 + grp_empty.out.h5 + grp_dsets.out.h5 + grp_nested.out.h5 + simple_group.out.h5 + grp_rename.out.h5 + grp_dsets_rename.out.h5 + A_B1_simple.out.h5 + A_B2_simple2.out.h5 + C_D_simple.out.h5 + E_F_grp_dsets.out.h5 + G_H_grp_nested.out.h5 + region_ref.out.h5 + ext_link.out.h5 + ext_link_f.out.h5 + ext_dangle_noobj.out.h5 + ext_dangle_noobj_f.out.h5 + ext_dangle_nofile.out.h5 + ext_dangle_nofile_f.out.h5 + ext_link_group.out.h5 + ext_link_group_f.out.h5 + samefile1.out.h5 + samefile2.out.h5 + h5copy_misc1.out.h5 + h5copy_misc1.out.out + h5copy_misc1.out.out.err + ) + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5COPY-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # "Test copying various forms of datasets" + ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) + ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) + ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) + ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) + ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) + ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) + + # "Test copying dataset within group in source file to root of destination" + ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) + + # "Test copying & renaming dataset" + ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename) + + # "Test copying empty, 'full' & 'nested' groups" + ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) + ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + + # "Test copying dataset within group in source file to group in destination" + ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) + + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + + # "Test copying objects into group hier. that doesn't exist yet in destination file" + ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) + ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) + ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + +############# COPY REFERENCES ############## + + # "Test copying object and region references" + ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) + +############# COPY EXT LINKS ############## + + # "Test copying external link directly without -f ext" + ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) + + # "Test copying external link directly with -f ext" + ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) + + # "Test copying dangling external link (no obj) directly without -f ext" + ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) + + # "Test copying dangling external link (no obj) directly with -f ext" + ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) + + # "Test copying dangling external link (no file) directly without -f ext" + ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) + + # "Test copying dangling external link (no file) directly with -f ext" + ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) + + # "Test copying a group contains external links without -f ext" + ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) + + # "Test copying a group contains external links with -f ext" + ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) + +############# Test misc. ############## + + #----------------------------------------------------------------- + # "Test copying object into group which doesn't exist, without -p" + # + ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) + + #------------------------------------------- + # "Test copying objects to the same file " + # + # - dataset + ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) + # - group with some datasets + ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c index 3fb5701..b5965ba 100644 --- a/tools/h5copy/h5copy.c +++ b/tools/h5copy/h5copy.c @@ -157,35 +157,35 @@ usage: h5copy [OPTIONS] [OBJECTS...]\n\ */ -static int parse_flag(const char* str_flag, unsigned *flag) +static int parse_flag(const char* s_flag, unsigned *flag) { unsigned fla=0; - if (HDstrcmp(str_flag,"shallow")==0) + if (HDstrcmp(s_flag,"shallow")==0) { fla = H5O_COPY_SHALLOW_HIERARCHY_FLAG; } - else if (HDstrcmp(str_flag,"soft")==0) + else if (HDstrcmp(s_flag,"soft")==0) { fla = H5O_COPY_EXPAND_SOFT_LINK_FLAG; } - else if (HDstrcmp(str_flag,"ext")==0) + else if (HDstrcmp(s_flag,"ext")==0) { fla = H5O_COPY_EXPAND_EXT_LINK_FLAG; } - else if (HDstrcmp(str_flag,"ref")==0) + else if (HDstrcmp(s_flag,"ref")==0) { fla = H5O_COPY_EXPAND_REFERENCE_FLAG; } - else if (HDstrcmp(str_flag,"noattr")==0) + else if (HDstrcmp(s_flag,"noattr")==0) { fla = H5O_COPY_WITHOUT_ATTR_FLAG; } - else if (HDstrcmp(str_flag,"allflags")==0) + else if (HDstrcmp(s_flag,"allflags")==0) { fla = H5O_COPY_ALL; } - else if (HDstrcmp(str_flag,"nullmsg")==0) + else if (HDstrcmp(s_flag,"nullmsg")==0) { fla = H5O_COPY_PRESERVE_NULL_FLAG; } diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index e4e722a..d79c290 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -31,12 +31,6 @@ IF (H5_HAVE_PARALLEL) SET_TARGET_PROPERTIES (ph5diff PROPERTIES FOLDER tools) ENDIF (H5_HAVE_PARALLEL) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5diff and test executables @@ -50,1382 +44,8 @@ IF (BUILD_TESTING) #ADD_TEST (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory - # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dtypes.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_links.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_softlinks.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_linked_softlink.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_src.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_trg.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_src.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_trg.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-3.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_comp_vl_strs.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 - ) - - SET (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_11.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_12.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_13.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_14.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_15.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_1.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_2.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_3.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_17.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_171.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_172.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18_1.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_20.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_200.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_201.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_202.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_203.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_204.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_205.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_206.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_207.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_208.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_220.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_221.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_222.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_223.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_224.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_21.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_22.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_23.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_24.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_25.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_26.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_27.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_28.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_300.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_400.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_401.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_402.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_403.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_404.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_405.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_406.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_407.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_408.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_409.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_410.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_411.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_412.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_413.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_414.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_415.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_416.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_417.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_418.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_419.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_420.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_421.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_422.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_423.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_424.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_425.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_450.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_451.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_468.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_469.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_471.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_472.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_473.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_474.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_475.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_480.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_481.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_482.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_483.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_484.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_485.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_486.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_487.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_50.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_51.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_52.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_53.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_54.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_55.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_56.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_57.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_59.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_500.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_501.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_502.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_503.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_504.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_505.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_506.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_507.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_508.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_509.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_510.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_511.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_512.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_513.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_514.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_515.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_516.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_517.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_605.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_606.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_607.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_608.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_609.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_610.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_612.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_613.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_614.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_615.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_616.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_617.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_618.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_619.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_621.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_622.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_623.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_624.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_625.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_626.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_627.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_628.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_629.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_630.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_631.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_640.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_641.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_642.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_643.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_644.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_645.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_646.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_70.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_700.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_701.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_702.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_703.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_704.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_705.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_706.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_707.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_708.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt - ) - - # Make testfiles dir under build dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - - # - # copy test files from source to build dir - # - FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${fname}") - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${h5_tstfiles} ${dest} - ) - ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - - - # - # Overwrite system dependent files (Windows) - # - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt - ) - - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt - ) - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt - ) - - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt - ) - ENDIF (WIN32 AND NOT CYGWIN) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_H5_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err - ) - ADD_TEST ( - NAME H5DIFF-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -D "TEST_APPEND=EXIT CODE:" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (H5_HAVE_PARALLEL) - ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) - ENDIF (H5_HAVE_PARALLEL) - ENDMACRO (ADD_H5_TEST file) - - MACRO (ADD_PH5_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME PH5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err - ) - ADD_TEST ( - NAME PH5DIFF-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$<TARGET_FILE:ph5diff>" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=P_${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" -# -D "TEST_APPEND=EXIT CODE: [0-9]" -# -D "TEST_REF_FILTER=EXIT CODE: 0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" - ) - SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_PH5_TEST file) - - # ADD_H5_NO_OUTPUT_TEST - # Purpose to verify only exitcode without output comparison - # Don't use this if possible; this may be removed. - MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) - # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5DIFF-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err - ) - # if there was a previous test - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_NO_OUTPUT_TEST) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # -------------------------------------------------------------------- - # test file names - # -------------------------------------------------------------------- - SET (FILE1 h5diff_basic1.h5) - SET (FILE2 h5diff_basic2.h5) - SET (FILE3 h5diff_types.h5) - SET (FILE4 h5diff_dtypes.h5) - SET (FILE5 h5diff_attr1.h5) - SET (FILE6 h5diff_attr2.h5) - SET (FILE7 h5diff_dset1.h5) - SET (FILE8 h5diff_dset2.h5) - SET (FILE9 h5diff_hyper1.h5) - SET (FILE10 h5diff_hyper2.h5) - SET (FILE11 h5diff_empty.h5) - SET (FILE12 h5diff_links.h5) - SET (FILE13 h5diff_softlinks.h5) - SET (FILE14 h5diff_linked_softlink.h5) - SET (FILE15 h5diff_extlink_src.h5) - SET (FILE16 h5diff_extlink_trg.h5) - SET (FILE17 h5diff_ext2softlink_src.h5) - SET (FILE18 h5diff_ext2softlink_trg.h5) - SET (FILE19 h5diff_dset_zero_dim_size1.h5) - SET (FILE20 h5diff_dset_zero_dim_size2.h5) - SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) - SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) - SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) - SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) - # group recursive - same structure via external links through files - SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) - SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) - SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) - SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) - # same structure, same obj name with different value - SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) - SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) - # different structure and obj names - SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) - SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) - # Only one file contains unique objs. Common objs are same. - SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) - SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) - # compound type with multiple vlen string types - SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) - # container types (array,vlen) with multiple nested compound types - SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) - SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) - # attrs with verbose option level - SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) - SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5DIFF-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5diff_10.out - h5diff_10.out.err - h5diff_100.out - h5diff_100.out.err - h5diff_101.out - h5diff_101.out.err - h5diff_102.out - h5diff_102.out.err - h5diff_103.out - h5diff_103.out.err - h5diff_104.out - h5diff_104.out.err - h5diff_11.out - h5diff_11.out.err - h5diff_12.out - h5diff_12.out.err - h5diff_13.out - h5diff_13.out.err - h5diff_14.out - h5diff_14.out.err - h5diff_15.out - h5diff_15.out.err - h5diff_16_1.out - h5diff_16_1.out.err - h5diff_16_2.out - h5diff_16_2.out.err - h5diff_16_3.out - h5diff_16_3.out.err - h5diff_17.out - h5diff_17.out.err - h5diff_171.out - h5diff_171.out.err - h5diff_172.out - h5diff_172.out.err - h5diff_18_1.out - h5diff_18_1.out.err - h5diff_18.out - h5diff_18.out.err - h5diff_20.out - h5diff_20.out.err - h5diff_200.out - h5diff_200.out.err - h5diff_201.out - h5diff_201.out.err - h5diff_202.out - h5diff_202.out.err - h5diff_203.out - h5diff_203.out.err - h5diff_204.out - h5diff_204.out.err - h5diff_205.out - h5diff_205.out.err - h5diff_206.out - h5diff_206.out.err - h5diff_207.out - h5diff_207.out.err - h5diff_208.out - h5diff_208.out.err - h5diff_220.out - h5diff_220.out.err - h5diff_221.out - h5diff_221.out.err - h5diff_222.out - h5diff_222.out.err - h5diff_223.out - h5diff_223.out.err - h5diff_224.out - h5diff_224.out.err - h5diff_21.out - h5diff_21.out.err - h5diff_22.out - h5diff_22.out.err - h5diff_23.out - h5diff_23.out.err - h5diff_24.out - h5diff_24.out.err - h5diff_25.out - h5diff_25.out.err - h5diff_26.out - h5diff_26.out.err - h5diff_27.out - h5diff_27.out.err - h5diff_28.out - h5diff_28.out.err - h5diff_300.out - h5diff_300.out.err - h5diff_400.out - h5diff_400.out.err - h5diff_401.out - h5diff_401.out.err - h5diff_402.out - h5diff_402.out.err - h5diff_403.out - h5diff_403.out.err - h5diff_404.out - h5diff_404.out.err - h5diff_405.out - h5diff_405.out.err - h5diff_406.out - h5diff_406.out.err - h5diff_407.out - h5diff_407.out.err - h5diff_408.out - h5diff_408.out.err - h5diff_409.out - h5diff_409.out.err - h5diff_410.out - h5diff_410.out.err - h5diff_411.out - h5diff_411.out.err - h5diff_412.out - h5diff_412.out.err - h5diff_413.out - h5diff_413.out.err - h5diff_414.out - h5diff_414.out.err - h5diff_415.out - h5diff_415.out.err - h5diff_416.out - h5diff_416.out.err - h5diff_417.out - h5diff_417.out.err - h5diff_418.out - h5diff_418.out.err - h5diff_419.out - h5diff_419.out.err - h5diff_420.out - h5diff_420.out.err - h5diff_421.out - h5diff_421.out.err - h5diff_422.out - h5diff_422.out.err - h5diff_423.out - h5diff_423.out.err - h5diff_424.out - h5diff_424.out.err - h5diff_425.out - h5diff_425.out.err - h5diff_450.out - h5diff_450.out.err - h5diff_451.out - h5diff_451.out.err - h5diff_452.out - h5diff_452.out.err - h5diff_453.out - h5diff_453.out.err - h5diff_454.out - h5diff_454.out.err - h5diff_455.out - h5diff_455.out.err - h5diff_456.out - h5diff_456.out.err - h5diff_457.out - h5diff_457.out.err - h5diff_458.out - h5diff_458.out.err - h5diff_459.out - h5diff_459.out.err - h5diff_465.out - h5diff_465.out.err - h5diff_466.out - h5diff_466.out.err - h5diff_467.out - h5diff_467.out.err - h5diff_468.out - h5diff_468.out.err - h5diff_469.out - h5diff_469.out.err - h5diff_471.out - h5diff_471.out.err - h5diff_472.out - h5diff_472.out.err - h5diff_473.out - h5diff_473.out.err - h5diff_474.out - h5diff_474.out.err - h5diff_475.out - h5diff_475.out.err - h5diff_480.out - h5diff_480.out.err - h5diff_481.out - h5diff_481.out.err - h5diff_482.out - h5diff_482.out.err - h5diff_483.out - h5diff_483.out.err - h5diff_484.out - h5diff_484.out.err - h5diff_50.out - h5diff_50.out.err - h5diff_51.out - h5diff_51.out.err - h5diff_52.out - h5diff_52.out.err - h5diff_53.out - h5diff_53.out.err - h5diff_54.out - h5diff_54.out.err - h5diff_55.out - h5diff_55.out.err - h5diff_56.out - h5diff_56.out.err - h5diff_57.out - h5diff_57.out.err - h5diff_58.out - h5diff_58.out.err - h5diff_59.out - h5diff_59.out.err - h5diff_500.out - h5diff_500.out.err - h5diff_501.out - h5diff_501.out.err - h5diff_502.out - h5diff_502.out.err - h5diff_503.out - h5diff_503.out.err - h5diff_504.out - h5diff_504.out.err - h5diff_505.out - h5diff_505.out.err - h5diff_506.out - h5diff_506.out.err - h5diff_507.out - h5diff_507.out.err - h5diff_508.out - h5diff_508.out.err - h5diff_509.out - h5diff_509.out.err - h5diff_510.out - h5diff_510.out.err - h5diff_511.out - h5diff_511.out.err - h5diff_512.out - h5diff_512.out.err - h5diff_513.out - h5diff_513.out.err - h5diff_514.out - h5diff_514.out.err - h5diff_515.out - h5diff_515.out.err - h5diff_516.out - h5diff_516.out.err - h5diff_517.out - h5diff_517.out.err - h5diff_518.out - h5diff_518.out.err - h5diff_530.out - h5diff_530.out.err - h5diff_540.out - h5diff_540.out.err - h5diff_600.out - h5diff_600.out.err - h5diff_601.out - h5diff_601.out.err - h5diff_603.out - h5diff_603.out.err - h5diff_604.out - h5diff_604.out.err - h5diff_605.out - h5diff_605.out.err - h5diff_606.out - h5diff_606.out.err - h5diff_607.out - h5diff_607.out.err - h5diff_608.out - h5diff_608.out.err - h5diff_609.out - h5diff_609.out.err - h5diff_610.out - h5diff_610.out.err - h5diff_612.out - h5diff_612.out.err - h5diff_613.out - h5diff_613.out.err - h5diff_614.out - h5diff_614.out.err - h5diff_615.out - h5diff_615.out.err - h5diff_616.out - h5diff_616.out.err - h5diff_617.out - h5diff_617.out.err - h5diff_618.out - h5diff_618.out.err - h5diff_619.out - h5diff_619.out.err - h5diff_621.out - h5diff_621.out.err - h5diff_622.out - h5diff_622.out.err - h5diff_623.out - h5diff_623.out.err - h5diff_624.out - h5diff_624.out.err - h5diff_625.out - h5diff_625.out.err - h5diff_626.out - h5diff_626.out.err - h5diff_627.out - h5diff_627.out.err - h5diff_628.out - h5diff_628.out.err - h5diff_629.out - h5diff_629.out.err - h5diff_640.out - h5diff_640.out.err - h5diff_641.out - h5diff_641.out.err - h5diff_642.out - h5diff_642.out.err - h5diff_643.out - h5diff_643.out.err - h5diff_644.out - h5diff_644.out.err - h5diff_645.out - h5diff_645.out.err - h5diff_646.out - h5diff_646.out.err - h5diff_70.out - h5diff_70.out.err - h5diff_700.out - h5diff_700.out.err - h5diff_701.out - h5diff_701.out.err - h5diff_702.out - h5diff_702.out.err - h5diff_703.out - h5diff_703.out.err - h5diff_704.out - h5diff_704.out.err - h5diff_705.out - h5diff_705.out.err - h5diff_706.out - h5diff_706.out.err - h5diff_707.out - h5diff_707.out.err - h5diff_708.out - h5diff_708.out.err - h5diff_709.out - h5diff_709.out.err - h5diff_710.out - h5diff_710.out.err - h5diff_80.out - h5diff_80.out.err - h5diff_90.out - h5diff_90.out.err - ) - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DIFF-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - -# ############################################################################ -# # Common usage -# ############################################################################ - -# 1.0 -ADD_H5_TEST (h5diff_10 0 -h) - -# 1.1 normal mode -ADD_H5_TEST (h5diff_11 1 ${FILE1} ${FILE2}) - -# 1.2 normal mode with objects -ADD_H5_TEST (h5diff_12 1 ${FILE1} ${FILE2} g1/dset1 g1/dset2) - -# 1.3 report mode -ADD_H5_TEST (h5diff_13 1 -r ${FILE1} ${FILE2}) - -# 1.4 report mode with objects -ADD_H5_TEST (h5diff_14 1 -r ${FILE1} ${FILE2} g1/dset1 g1/dset2) - -# 1.5 with -d -ADD_H5_TEST (h5diff_15 1 --report --delta=5 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 1.6.1 with -p (int) -ADD_H5_TEST (h5diff_16_1 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset5 g1/dset6) - -# 1.6.2 with -p (unsigned long_long) -ADD_H5_TEST (h5diff_16_2 1 --verbose --relative=0.02 ${FILE1} ${FILE1} g1/dset7 g1/dset8) - -# 1.6.3 with -p (double) -ADD_H5_TEST (h5diff_16_3 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset9 g1/dset10) - -# 1.7 verbose mode -ADD_H5_TEST (h5diff_17 1 -v ${FILE1} ${FILE2}) - -# 1.7 test 32-bit INFINITY -ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19 /g1/fp19_COPY) - -# 1.7 test 64-bit INFINITY -ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20 /g1/fp20_COPY) - -# 1.8 quiet mode -ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) - -# 1.8 -v and -q -ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2}) - -# ############################################################################## -# # not comparable types -# ############################################################################## - -# 2.0 -ADD_H5_TEST (h5diff_20 0 -v ${FILE3} ${FILE3} dset g1) - -# 2.1 -ADD_H5_TEST (h5diff_21 0 -v ${FILE3} ${FILE3} dset l1) - -# 2.2 -ADD_H5_TEST (h5diff_22 0 -v ${FILE3} ${FILE3} dset t1) - -# ############################################################################## -# # compare groups, types, links (no differences and differences) -# ############################################################################## - -# 2.3 -ADD_H5_TEST (h5diff_23 0 -v ${FILE3} ${FILE3} g1 g1) - -# 2.4 -ADD_H5_TEST (h5diff_24 0 -v ${FILE3} ${FILE3} t1 t1) - -# 2.5 -ADD_H5_TEST (h5diff_25 0 -v ${FILE3} ${FILE3} l1 l1) - -# 2.6 -ADD_H5_TEST (h5diff_26 0 -v ${FILE3} ${FILE3} g1 g2) - -# 2.7 -ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) - -# 2.8 -ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) - -# ############################################################################## -# # Dataset datatypes -# ############################################################################## - -# 5.0 -ADD_H5_TEST (h5diff_50 1 -v ${FILE4} ${FILE4} dset0a dset0b) - -# 5.1 -ADD_H5_TEST (h5diff_51 1 -v ${FILE4} ${FILE4} dset1a dset1b) - -# 5.2 -ADD_H5_TEST (h5diff_52 1 -v ${FILE4} ${FILE4} dset2a dset2b) - -# 5.3 -ADD_H5_TEST (h5diff_53 1 -v ${FILE4} ${FILE4} dset3a dset4b) - -# 5.4 -ADD_H5_TEST (h5diff_54 1 -v ${FILE4} ${FILE4} dset4a dset4b) - -# 5.5 -ADD_H5_TEST (h5diff_55 1 -v ${FILE4} ${FILE4} dset5a dset5b) - -# 5.6 -ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b) - -# 5.7 -ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b) - -# 5.8 (region reference) -ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) - -# test for both dset and attr with same type but with different size -# ( HDDFV-7942 ) -ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b) - -# ############################################################################## -# # Error messages -# ############################################################################## - -# 6.0: Check if the command line number of arguments is less than 3 -ADD_H5_TEST (h5diff_600 1 ${FILE1}) - -# 6.1: Check if non-exist object name is specified -ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) - -# ############################################################################## -# # -d -# ############################################################################## - -# 6.3: negative value -ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.4: zero -ADD_H5_TEST (h5diff_604 1 -d 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.5: non number -ADD_H5_TEST (h5diff_605 1 -d u ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.6: hexadecimal -ADD_H5_TEST (h5diff_606 1 -d 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.7: string -ADD_H5_TEST (h5diff_607 1 -d "1" ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.8: use system epsilon -ADD_H5_TEST (h5diff_608 1 --use-system-epsilon ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.9: number larger than biggest difference -ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.10: number smaller than smallest difference -ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# ############################################################################## -# # -p -# ############################################################################## - -# 6.12: negative value -ADD_H5_TEST (h5diff_612 1 -p -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.13: zero -ADD_H5_TEST (h5diff_613 1 -p 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.14: non number -ADD_H5_TEST (h5diff_614 1 -p u ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.15: hexadecimal -ADD_H5_TEST (h5diff_615 1 -p 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.16: string -ADD_H5_TEST (h5diff_616 1 -p "0.21" ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.17: repeated option -ADD_H5_TEST (h5diff_617 1 -p 0.21 -p 0.22 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.18: number larger than biggest difference -ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.19: number smaller than smallest difference -ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# ############################################################################## -# # -n -# ############################################################################## - -# 6.21: negative value -ADD_H5_TEST (h5diff_621 1 -n -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.22: zero -ADD_H5_TEST (h5diff_622 1 -n 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.23: non number -ADD_H5_TEST (h5diff_623 1 -n u ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.24: hexadecimal -ADD_H5_TEST (h5diff_624 1 -n 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.25: string -ADD_H5_TEST (h5diff_625 1 -n "2" ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.26: repeated option -ADD_H5_TEST (h5diff_626 1 -n 2 -n 3 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.27: number larger than biggest difference -ADD_H5_TEST (h5diff_627 1 --count=200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# 6.28: number smaller than smallest difference -ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) - -# Disabling this test as it hangs - LRK 20090618 -# 6.29 non valid files -#ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) - -# ############################################################################## -# # NaN -# ############################################################################## -# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO -ADD_H5_TEST (h5diff_630 0 -v -d "0.0001" ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) -ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) - -# ############################################################################## -# 7. attributes -# ############################################################################## -ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) - -# ################################################## -# attrs with verbose option level -# ################################################## -ADD_H5_TEST (h5diff_700 1 -v1 ${FILE5} ${FILE6}) -ADD_H5_TEST (h5diff_701 1 -v2 ${FILE5} ${FILE6}) -ADD_H5_TEST (h5diff_702 1 --verbose=1 ${FILE5} ${FILE6}) -ADD_H5_TEST (h5diff_703 1 --verbose=2 ${FILE5} ${FILE6}) - -# same attr number , all same attr name -ADD_H5_TEST (h5diff_704 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g) - -# same attr number , some same attr name -ADD_H5_TEST (h5diff_705 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /dset) - -# same attr number , all different attr name -ADD_H5_TEST (h5diff_706 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) - -# different attr number , same attr name (intersected) -ADD_H5_TEST (h5diff_707 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g2) - -# different attr number , all different attr name -ADD_H5_TEST (h5diff_708 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) - -# when no attributes exist in both objects -ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g4) - -# file vs file -ADD_H5_TEST (h5diff_710 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2}) - -# ############################################################################## -# 8. all dataset datatypes -# ############################################################################## -ADD_H5_TEST (h5diff_80 1 -v ${FILE7} ${FILE8}) - -# 9. compare a file with itself -ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) - -# 10. read by hyperslab, print indexes -#if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then -# # skip this test which sometimes hangs in some THG machines -# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) -#else -# ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) -#fi - -# 11. floating point comparison -ADD_H5_TEST (h5diff_101 1 -v ${FILE1} ${FILE1} g1/d1 g1/d2) - -ADD_H5_TEST (h5diff_102 1 -v ${FILE1} ${FILE1} g1/fp1 g1/fp2) - -# with --use-system-epsilon for double value. expect less differences -ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1 -g1/d2) - -# with --use-system-epsilon for float value. expect less differences -ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 -g1/fp2) - -# not comparable -c flag -ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) - -ADD_H5_TEST (h5diff_201 0 -c ${FILE2} ${FILE2} g2/dset1 g2/dset2) - -ADD_H5_TEST (h5diff_202 0 -c ${FILE2} ${FILE2} g2/dset2 g2/dset3) - -ADD_H5_TEST (h5diff_203 0 -c ${FILE2} ${FILE2} g2/dset3 g2/dset4) - -ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5) - -ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6) - -# not comparable in compound -ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8) - -ADD_H5_TEST (h5diff_207 0 -c ${FILE2} ${FILE2} g2/dset8 g2/dset9) - -# not comparable in dataspace of zero dimension size -ADD_H5_TEST (h5diff_208 0 -c ${FILE19} ${FILE20}) - -# non-comparable dataset with comparable attribute, and other comparable datasets. -# All the rest comparables should display differences. -ADD_H5_TEST (h5diff_220 1 -c non_comparables1.h5 non_comparables2.h5 /g1) - -# comparable dataset with non-comparable attribute and other comparable attributes. -# Also test non-compatible attributes with different type, dimention, rank. -# All the rest comparables should display differences. -ADD_H5_TEST (h5diff_221 1 -c non_comparables1.h5 non_comparables2.h5 /g2) - -# entire file -# All the rest comparables should display differences -ADD_H5_TEST (h5diff_222 1 -c non_comparables1.h5 non_comparables2.h5) - -# non-comparable test for common objects (same name) with different object types -# (HDFFV-7644) -ADD_H5_TEST (h5diff_223 0 -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes) -# swap files -ADD_H5_TEST (h5diff_224 0 -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes) - -# ############################################################################## -# # Links compare without --follow-symlinks nor --no-dangling-links -# ############################################################################## -# test for bug1749 -ADD_H5_TEST (h5diff_300 1 -v ${FILE12} ${FILE12} /link_g1 /link_g2) - -# ############################################################################## -# # Links compare with --follow-symlinks Only -# ############################################################################## -# soft links file to file -ADD_H5_TEST (h5diff_400 0 --follow-symlinks -v ${FILE13} ${FILE13}) - -# softlink vs dset" -ADD_H5_TEST (h5diff_401 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /target_dset2) - -# dset vs softlink" -ADD_H5_TEST (h5diff_402 1 --follow-symlinks -v ${FILE13} ${FILE13} /target_dset2 /softlink_dset1_1) - -# softlink vs softlink" -ADD_H5_TEST (h5diff_403 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /softlink_dset2) - -# extlink vs extlink (FILE)" -ADD_H5_TEST (h5diff_404 0 --follow-symlinks -v ${FILE15} ${FILE15}) - -# extlink vs dset" -ADD_H5_TEST (h5diff_405 1 --follow-symlinks -v ${FILE15} ${FILE16} /ext_link_dset1 /target_group2/x_dset) - -# dset vs extlink" -ADD_H5_TEST (h5diff_406 1 --follow-symlinks -v ${FILE16} ${FILE15} /target_group2/x_dset /ext_link_dset1) - -# extlink vs extlink" -ADD_H5_TEST (h5diff_407 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_dset2) - -# softlink vs extlink" -ADD_H5_TEST (h5diff_408 1 --follow-symlinks -v ${FILE13} ${FILE15} /softlink_dset1_1 /ext_link_dset2) - -# extlink vs softlink " -ADD_H5_TEST (h5diff_409 1 --follow-symlinks -v ${FILE15} ${FILE13} /ext_link_dset2 /softlink_dset1_1) - -# linked_softlink vs linked_softlink (FILE)" -ADD_H5_TEST (h5diff_410 0 --follow-symlinks -v ${FILE14} ${FILE14}) - -# dset2 vs linked_softlink_dset1" -ADD_H5_TEST (h5diff_411 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_dset2 /softlink1_to_slink2) - -# linked_softlink_dset1 vs dset2" -ADD_H5_TEST (h5diff_412 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /target_dset2) - -# linked_softlink_to_dset1 vs linked_softlink_to_dset2" -ADD_H5_TEST (h5diff_413 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /softlink2_to_slink2) - -# group vs linked_softlink_group1" -ADD_H5_TEST (h5diff_414 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_group /softlink3_to_slink2) - -# linked_softlink_group1 vs group" -ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /target_group) - -# linked_softlink_to_group1 vs linked_softlink_to_group2" -ADD_H5_TEST (h5diff_416 0 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) - -# non-exist-softlink vs softlink" -ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) - -# softlink vs non-exist-softlink" -ADD_H5_TEST (h5diff_418 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) - -# non-exist-extlink_file vs extlink" -ADD_H5_TEST (h5diff_419 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) - -# exlink vs non-exist-extlink_file" -ADD_H5_TEST (h5diff_420 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) - -# extlink vs non-exist-extlink_obj" -ADD_H5_TEST (h5diff_421 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) - -# non-exist-extlink_obj vs extlink" -ADD_H5_TEST (h5diff_422 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) - -# extlink_to_softlink_to_dset1 vs dset2" -ADD_H5_TEST (h5diff_423 1 --follow-symlinks -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) - -# dset2 vs extlink_to_softlink_to_dset1" -ADD_H5_TEST (h5diff_424 1 --follow-symlinks -v ${FILE18} ${FILE17} /dset2 /ext_link_to_slink1) - -# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" -ADD_H5_TEST (h5diff_425 1 --follow-symlinks -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2) - -# ############################################################################## -# # Dangling links compare (--follow-symlinks and --no-dangling-links) -# ############################################################################## -# dangling links --follow-symlinks (FILE to FILE) -ADD_H5_TEST (h5diff_450 1 --follow-symlinks -v ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) - -# dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) -ADD_H5_TEST (h5diff_451 2 --follow-symlinks -v --no-dangling-links ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) - -# try --no-dangling-links without --follow-symlinks options -ADD_H5_TEST (h5diff_452 2 --no-dangling-links ${FILE13} ${FILE13}) - -# dangling link found for soft links (FILE to FILE) -ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13}) - -# dangling link found for soft links (obj to obj) -ADD_H5_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) - -# dangling link found for soft links (obj to obj) Both dangle links -ADD_H5_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) - -# dangling link found for ext links (FILE to FILE) -ADD_H5_TEST (h5diff_456 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15}) - -# dangling link found for ext links (obj to obj). target file exist -ADD_H5_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) - -# dangling link found for ext links (obj to obj). target file NOT exist -ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) - -# dangling link found for ext links (obj to obj). Both dangle links -ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) - -# dangling link --follow-symlinks (obj vs obj) -# (HDFFV-7836) -ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) -# (HDFFV-7835) -# soft dangling vs. soft dangling -ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) -# soft link vs. soft dangling -ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) -# ext dangling vs. ext dangling -ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) -# ext link vs. ext dangling -ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) - -#--------------------------------------------------- -# dangling links without follow symlink -# (HDFFV-7998) -# test - soft dangle links (same and different paths), -# - external dangle links (same and different paths) -ADD_H5_TEST (h5diff_471 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5) -ADD_H5_TEST (h5diff_472 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) -ADD_H5_TEST (h5diff_473 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4) -ADD_H5_TEST (h5diff_474 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) -ADD_H5_TEST (h5diff_475 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1) - - -# ############################################################################## -# # test for group diff recursivly -# ############################################################################## -# root -ADD_H5_TEST (h5diff_500 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) -ADD_H5_TEST (h5diff_501 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) - -# root vs group -ADD_H5_TEST (h5diff_502 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /grp1/grp2/grp3) - -# group vs group (same name and structure) -ADD_H5_TEST (h5diff_503 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /grp1) - -# group vs group (different name and structure) -ADD_H5_TEST (h5diff_504 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /grp1/grp2/grp3) - -# groups vs soft-link -ADD_H5_TEST (h5diff_505 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /slink_grp1) -ADD_H5_TEST (h5diff_506 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /slink_grp2) - -# groups vs ext-link -ADD_H5_TEST (h5diff_507 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) -ADD_H5_TEST (h5diff_508 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) - -# soft-link vs ext-link -ADD_H5_TEST (h5diff_509 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) -ADD_H5_TEST (h5diff_510 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) - -# circled ext links -ADD_H5_TEST (h5diff_511 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) -ADD_H5_TEST (h5diff_512 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) - -# circled soft2ext-link vs soft2ext-link -ADD_H5_TEST (h5diff_513 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) -ADD_H5_TEST (h5diff_514 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) - -############################################################################### -# Test for group recursive diff via multi-linked external links -# With follow-symlinks, file $GRP_RECURSE1_EXT and $GRP_RECURSE2_EXT1 should -# be same with the external links. -############################################################################### -# file vs file -ADD_H5_TEST (h5diff_515 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) -ADD_H5_TEST (h5diff_516 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) -# group vs group -ADD_H5_TEST (h5diff_517 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) -ADD_H5_TEST (h5diff_518 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) - -# ############################################################################## -# # Exclude path (--exclude-path) -# ############################################################################## -# -# Same structure, same names and different value. -# -# Exclude the object with different value. Expect return - same -ADD_H5_TEST (h5diff_480 0 -v --exclude-path /group1/dset3 ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2}) -# Verify different by not excluding. Expect return - diff -ADD_H5_TEST (h5diff_481 1 -v ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2}) - -# -# Different structure, different names. -# -# Exclude all the different objects. Expect return - same -ADD_H5_TEST (h5diff_482 0 -v --exclude-path "/group1" --exclude-path "/dset1" ${EXCLUDE_FILE2_1} ${EXCLUDE_FILE2_2}) -# Exclude only some different objects. Expect return - diff -ADD_H5_TEST (h5diff_483 1 -v --exclude-path "/group1" ${EXCLUDE_FILE2_1} ${EXCLUDE_FILE2_2}) - -# Exclude from group compare -ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2} /group1) - -# -# Only one file contains unique objs. Common objs are same. -# (HDFFV-7837) -# -ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) -ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5) -ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) - - - -# ############################################################################## -# # diff various multiple vlen and fixed strings in a compound type dataset -# ############################################################################## -ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) - -# ############################################################################## -# # Test container types (array,vlen) with multiple nested compound types -# # Complex compound types in dataset and attribute -# ############################################################################## -ADD_H5_TEST (h5diff_540 1 -v ${COMPS_ARRAY_VLEN_FILE1} ${COMPS_ARRAY_VLEN_FILE2}) -# ############################################################################## -# # Test mutually exclusive options -# ############################################################################## -# -# Test with -d , -p and --use-system-epsilon. -ADD_H5_TEST (h5diff_640 1 -v -d 5 -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_641 1 -v -d 5 -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_642 1 -v -p 0.05 -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_643 1 -v -d 5 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) -ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) diff --git a/tools/h5diff/CMakeTests.cmake b/tools/h5diff/CMakeTests.cmake new file mode 100644 index 0000000..cac4f84 --- /dev/null +++ b/tools/h5diff/CMakeTests.cmake @@ -0,0 +1,1382 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the test directory into the source directory + # -------------------------------------------------------------------- + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dtypes.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_links.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_softlinks.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_linked_softlink.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_src.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_trg.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_src.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_trg.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-3.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_comp_vl_strs.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 + ) + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_11.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_12.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_13.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_14.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_15.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_1.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_2.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_3.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_17.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_171.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_172.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18_1.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_20.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_200.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_201.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_202.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_203.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_204.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_205.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_206.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_207.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_208.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_220.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_221.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_222.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_223.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_224.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_21.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_22.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_23.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_24.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_25.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_26.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_27.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_28.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_300.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_400.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_401.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_402.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_403.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_404.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_405.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_406.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_407.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_408.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_409.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_410.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_411.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_412.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_413.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_414.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_415.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_416.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_417.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_418.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_419.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_420.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_421.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_422.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_423.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_424.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_425.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_450.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_451.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_468.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_469.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_471.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_472.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_473.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_474.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_475.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_480.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_481.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_482.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_483.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_484.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_485.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_486.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_487.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_50.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_51.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_52.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_53.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_54.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_55.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_56.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_57.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_59.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_500.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_501.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_502.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_503.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_504.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_505.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_506.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_507.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_508.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_509.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_510.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_511.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_512.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_513.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_514.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_515.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_516.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_517.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_605.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_606.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_607.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_608.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_609.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_610.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_612.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_613.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_614.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_615.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_616.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_617.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_618.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_619.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_621.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_622.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_623.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_624.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_625.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_626.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_627.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_628.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_629.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_630.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_631.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_640.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_641.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_642.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_643.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_644.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_645.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_646.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_70.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_700.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_701.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_702.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_703.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_704.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_705.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_706.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_707.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_708.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt + ) + + # Make testfiles dir under build dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + # + # copy test files from source to build dir + # + FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${fname}") + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${h5_tstfiles} ${dest} + ) + ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + + + # + # Overwrite system dependent files (Windows) + # + IF (WIN32 AND NOT CYGWIN) + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt + ) + + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt + ) + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt + ) + + ADD_CUSTOM_COMMAND ( + TARGET h5diff + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt + ) + ENDIF (WIN32 AND NOT CYGWIN) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_H5_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err + ) + ADD_TEST ( + NAME H5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -D "TEST_APPEND=EXIT CODE:" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES DEPENDS "H5DIFF-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + IF (H5_HAVE_PARALLEL) + ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) + ENDIF (H5_HAVE_PARALLEL) + ENDMACRO (ADD_H5_TEST file) + + MACRO (ADD_PH5_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $<TARGET_FILE:ph5diff> ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME PH5DIFF-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err + ) + ADD_TEST ( + NAME PH5DIFF-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$<TARGET_FILE:ph5diff>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=P_${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" +# -D "TEST_APPEND=EXIT CODE: [0-9]" +# -D "TEST_REF_FILTER=EXIT CODE: 0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/prunTest.cmake" + ) + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES DEPENDS "PH5DIFF-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_PH5_TEST file) + + # ADD_H5_NO_OUTPUT_TEST + # Purpose to verify only exitcode without output comparison + # Don't use this if possible; this may be removed. + MACRO (ADD_H5_NO_OUTPUT_TEST testname resultcode) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DIFF-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err + ) + # if there was a previous test + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5DIFF-${testname} COMMAND $<TARGET_FILE:h5diff> ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5DIFF-${testname} PROPERTIES DEPENDS H5DIFF-${testname}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_NO_OUTPUT_TEST) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # test file names + # -------------------------------------------------------------------- + SET (FILE1 h5diff_basic1.h5) + SET (FILE2 h5diff_basic2.h5) + SET (FILE3 h5diff_types.h5) + SET (FILE4 h5diff_dtypes.h5) + SET (FILE5 h5diff_attr1.h5) + SET (FILE6 h5diff_attr2.h5) + SET (FILE7 h5diff_dset1.h5) + SET (FILE8 h5diff_dset2.h5) + SET (FILE9 h5diff_hyper1.h5) + SET (FILE10 h5diff_hyper2.h5) + SET (FILE11 h5diff_empty.h5) + SET (FILE12 h5diff_links.h5) + SET (FILE13 h5diff_softlinks.h5) + SET (FILE14 h5diff_linked_softlink.h5) + SET (FILE15 h5diff_extlink_src.h5) + SET (FILE16 h5diff_extlink_trg.h5) + SET (FILE17 h5diff_ext2softlink_src.h5) + SET (FILE18 h5diff_ext2softlink_trg.h5) + SET (FILE19 h5diff_dset_zero_dim_size1.h5) + SET (FILE20 h5diff_dset_zero_dim_size2.h5) + SET (DANGLE_LINK_FILE1 h5diff_danglelinks1.h5) + SET (DANGLE_LINK_FILE2 h5diff_danglelinks2.h5) + SET (GRP_RECURSE_FILE1 h5diff_grp_recurse1.h5) + SET (GRP_RECURSE_FILE2 h5diff_grp_recurse2.h5) + # group recursive - same structure via external links through files + SET (GRP_RECURSE1_EXT h5diff_grp_recurse_ext1.h5) + SET (GRP_RECURSE2_EXT1 h5diff_grp_recurse_ext2-1.h5) + SET (GRP_RECURSE2_EXT2 h5diff_grp_recurse_ext2-2.h5) + SET (GRP_RECURSE2_EXT3 h5diff_grp_recurse_ext2-3.h5) + # same structure, same obj name with different value + SET (EXCLUDE_FILE1_1 h5diff_exclude1-1.h5) + SET (EXCLUDE_FILE1_2 h5diff_exclude1-2.h5) + # different structure and obj names + SET (EXCLUDE_FILE2_1 h5diff_exclude2-1.h5) + SET (EXCLUDE_FILE2_2 h5diff_exclude2-2.h5) + # Only one file contains unique objs. Common objs are same. + SET (EXCLUDE_FILE3_1 h5diff_exclude3-1.h5) + SET (EXCLUDE_FILE3_2 h5diff_exclude3-2.h5) + # compound type with multiple vlen string types + SET (COMP_VL_STRS_FILE h5diff_comp_vl_strs.h5) + # container types (array,vlen) with multiple nested compound types + SET (COMPS_ARRAY_VLEN_FILE1 compounds_array_vlen1.h5) + SET (COMPS_ARRAY_VLEN_FILE2 compounds_array_vlen2.h5) + # attrs with verbose option level + SET (ATTR_VERBOSE_LEVEL_FILE1 h5diff_attr_v_level1.h5) + SET (ATTR_VERBOSE_LEVEL_FILE2 h5diff_attr_v_level2.h5) + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DIFF-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5diff_10.out + h5diff_10.out.err + h5diff_100.out + h5diff_100.out.err + h5diff_101.out + h5diff_101.out.err + h5diff_102.out + h5diff_102.out.err + h5diff_103.out + h5diff_103.out.err + h5diff_104.out + h5diff_104.out.err + h5diff_11.out + h5diff_11.out.err + h5diff_12.out + h5diff_12.out.err + h5diff_13.out + h5diff_13.out.err + h5diff_14.out + h5diff_14.out.err + h5diff_15.out + h5diff_15.out.err + h5diff_16_1.out + h5diff_16_1.out.err + h5diff_16_2.out + h5diff_16_2.out.err + h5diff_16_3.out + h5diff_16_3.out.err + h5diff_17.out + h5diff_17.out.err + h5diff_171.out + h5diff_171.out.err + h5diff_172.out + h5diff_172.out.err + h5diff_18_1.out + h5diff_18_1.out.err + h5diff_18.out + h5diff_18.out.err + h5diff_20.out + h5diff_20.out.err + h5diff_200.out + h5diff_200.out.err + h5diff_201.out + h5diff_201.out.err + h5diff_202.out + h5diff_202.out.err + h5diff_203.out + h5diff_203.out.err + h5diff_204.out + h5diff_204.out.err + h5diff_205.out + h5diff_205.out.err + h5diff_206.out + h5diff_206.out.err + h5diff_207.out + h5diff_207.out.err + h5diff_208.out + h5diff_208.out.err + h5diff_220.out + h5diff_220.out.err + h5diff_221.out + h5diff_221.out.err + h5diff_222.out + h5diff_222.out.err + h5diff_223.out + h5diff_223.out.err + h5diff_224.out + h5diff_224.out.err + h5diff_21.out + h5diff_21.out.err + h5diff_22.out + h5diff_22.out.err + h5diff_23.out + h5diff_23.out.err + h5diff_24.out + h5diff_24.out.err + h5diff_25.out + h5diff_25.out.err + h5diff_26.out + h5diff_26.out.err + h5diff_27.out + h5diff_27.out.err + h5diff_28.out + h5diff_28.out.err + h5diff_300.out + h5diff_300.out.err + h5diff_400.out + h5diff_400.out.err + h5diff_401.out + h5diff_401.out.err + h5diff_402.out + h5diff_402.out.err + h5diff_403.out + h5diff_403.out.err + h5diff_404.out + h5diff_404.out.err + h5diff_405.out + h5diff_405.out.err + h5diff_406.out + h5diff_406.out.err + h5diff_407.out + h5diff_407.out.err + h5diff_408.out + h5diff_408.out.err + h5diff_409.out + h5diff_409.out.err + h5diff_410.out + h5diff_410.out.err + h5diff_411.out + h5diff_411.out.err + h5diff_412.out + h5diff_412.out.err + h5diff_413.out + h5diff_413.out.err + h5diff_414.out + h5diff_414.out.err + h5diff_415.out + h5diff_415.out.err + h5diff_416.out + h5diff_416.out.err + h5diff_417.out + h5diff_417.out.err + h5diff_418.out + h5diff_418.out.err + h5diff_419.out + h5diff_419.out.err + h5diff_420.out + h5diff_420.out.err + h5diff_421.out + h5diff_421.out.err + h5diff_422.out + h5diff_422.out.err + h5diff_423.out + h5diff_423.out.err + h5diff_424.out + h5diff_424.out.err + h5diff_425.out + h5diff_425.out.err + h5diff_450.out + h5diff_450.out.err + h5diff_451.out + h5diff_451.out.err + h5diff_452.out + h5diff_452.out.err + h5diff_453.out + h5diff_453.out.err + h5diff_454.out + h5diff_454.out.err + h5diff_455.out + h5diff_455.out.err + h5diff_456.out + h5diff_456.out.err + h5diff_457.out + h5diff_457.out.err + h5diff_458.out + h5diff_458.out.err + h5diff_459.out + h5diff_459.out.err + h5diff_465.out + h5diff_465.out.err + h5diff_466.out + h5diff_466.out.err + h5diff_467.out + h5diff_467.out.err + h5diff_468.out + h5diff_468.out.err + h5diff_469.out + h5diff_469.out.err + h5diff_471.out + h5diff_471.out.err + h5diff_472.out + h5diff_472.out.err + h5diff_473.out + h5diff_473.out.err + h5diff_474.out + h5diff_474.out.err + h5diff_475.out + h5diff_475.out.err + h5diff_480.out + h5diff_480.out.err + h5diff_481.out + h5diff_481.out.err + h5diff_482.out + h5diff_482.out.err + h5diff_483.out + h5diff_483.out.err + h5diff_484.out + h5diff_484.out.err + h5diff_50.out + h5diff_50.out.err + h5diff_51.out + h5diff_51.out.err + h5diff_52.out + h5diff_52.out.err + h5diff_53.out + h5diff_53.out.err + h5diff_54.out + h5diff_54.out.err + h5diff_55.out + h5diff_55.out.err + h5diff_56.out + h5diff_56.out.err + h5diff_57.out + h5diff_57.out.err + h5diff_58.out + h5diff_58.out.err + h5diff_59.out + h5diff_59.out.err + h5diff_500.out + h5diff_500.out.err + h5diff_501.out + h5diff_501.out.err + h5diff_502.out + h5diff_502.out.err + h5diff_503.out + h5diff_503.out.err + h5diff_504.out + h5diff_504.out.err + h5diff_505.out + h5diff_505.out.err + h5diff_506.out + h5diff_506.out.err + h5diff_507.out + h5diff_507.out.err + h5diff_508.out + h5diff_508.out.err + h5diff_509.out + h5diff_509.out.err + h5diff_510.out + h5diff_510.out.err + h5diff_511.out + h5diff_511.out.err + h5diff_512.out + h5diff_512.out.err + h5diff_513.out + h5diff_513.out.err + h5diff_514.out + h5diff_514.out.err + h5diff_515.out + h5diff_515.out.err + h5diff_516.out + h5diff_516.out.err + h5diff_517.out + h5diff_517.out.err + h5diff_518.out + h5diff_518.out.err + h5diff_530.out + h5diff_530.out.err + h5diff_540.out + h5diff_540.out.err + h5diff_600.out + h5diff_600.out.err + h5diff_601.out + h5diff_601.out.err + h5diff_603.out + h5diff_603.out.err + h5diff_604.out + h5diff_604.out.err + h5diff_605.out + h5diff_605.out.err + h5diff_606.out + h5diff_606.out.err + h5diff_607.out + h5diff_607.out.err + h5diff_608.out + h5diff_608.out.err + h5diff_609.out + h5diff_609.out.err + h5diff_610.out + h5diff_610.out.err + h5diff_612.out + h5diff_612.out.err + h5diff_613.out + h5diff_613.out.err + h5diff_614.out + h5diff_614.out.err + h5diff_615.out + h5diff_615.out.err + h5diff_616.out + h5diff_616.out.err + h5diff_617.out + h5diff_617.out.err + h5diff_618.out + h5diff_618.out.err + h5diff_619.out + h5diff_619.out.err + h5diff_621.out + h5diff_621.out.err + h5diff_622.out + h5diff_622.out.err + h5diff_623.out + h5diff_623.out.err + h5diff_624.out + h5diff_624.out.err + h5diff_625.out + h5diff_625.out.err + h5diff_626.out + h5diff_626.out.err + h5diff_627.out + h5diff_627.out.err + h5diff_628.out + h5diff_628.out.err + h5diff_629.out + h5diff_629.out.err + h5diff_640.out + h5diff_640.out.err + h5diff_641.out + h5diff_641.out.err + h5diff_642.out + h5diff_642.out.err + h5diff_643.out + h5diff_643.out.err + h5diff_644.out + h5diff_644.out.err + h5diff_645.out + h5diff_645.out.err + h5diff_646.out + h5diff_646.out.err + h5diff_70.out + h5diff_70.out.err + h5diff_700.out + h5diff_700.out.err + h5diff_701.out + h5diff_701.out.err + h5diff_702.out + h5diff_702.out.err + h5diff_703.out + h5diff_703.out.err + h5diff_704.out + h5diff_704.out.err + h5diff_705.out + h5diff_705.out.err + h5diff_706.out + h5diff_706.out.err + h5diff_707.out + h5diff_707.out.err + h5diff_708.out + h5diff_708.out.err + h5diff_709.out + h5diff_709.out.err + h5diff_710.out + h5diff_710.out.err + h5diff_80.out + h5diff_80.out.err + h5diff_90.out + h5diff_90.out.err + ) + SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DIFF-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + +# ############################################################################ +# # Common usage +# ############################################################################ + +# 1.0 +ADD_H5_TEST (h5diff_10 0 -h) + +# 1.1 normal mode +ADD_H5_TEST (h5diff_11 1 ${FILE1} ${FILE2}) + +# 1.2 normal mode with objects +ADD_H5_TEST (h5diff_12 1 ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.3 report mode +ADD_H5_TEST (h5diff_13 1 -r ${FILE1} ${FILE2}) + +# 1.4 report mode with objects +ADD_H5_TEST (h5diff_14 1 -r ${FILE1} ${FILE2} g1/dset1 g1/dset2) + +# 1.5 with -d +ADD_H5_TEST (h5diff_15 1 --report --delta=5 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 1.6.1 with -p (int) +ADD_H5_TEST (h5diff_16_1 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset5 g1/dset6) + +# 1.6.2 with -p (unsigned long_long) +ADD_H5_TEST (h5diff_16_2 1 --verbose --relative=0.02 ${FILE1} ${FILE1} g1/dset7 g1/dset8) + +# 1.6.3 with -p (double) +ADD_H5_TEST (h5diff_16_3 1 -v -p 0.02 ${FILE1} ${FILE1} g1/dset9 g1/dset10) + +# 1.7 verbose mode +ADD_H5_TEST (h5diff_17 1 -v ${FILE1} ${FILE2}) + +# 1.7 test 32-bit INFINITY +ADD_H5_TEST (h5diff_171 0 -v ${FILE1} ${FILE1} /g1/fp19 /g1/fp19_COPY) + +# 1.7 test 64-bit INFINITY +ADD_H5_TEST (h5diff_172 0 -v ${FILE1} ${FILE1} /g1/fp20 /g1/fp20_COPY) + +# 1.8 quiet mode +ADD_H5_TEST (h5diff_18 1 -q ${FILE1} ${FILE2}) + +# 1.8 -v and -q +ADD_H5_TEST (h5diff_18_1 2 -v -q ${FILE1} ${FILE2}) + +# ############################################################################## +# # not comparable types +# ############################################################################## + +# 2.0 +ADD_H5_TEST (h5diff_20 0 -v ${FILE3} ${FILE3} dset g1) + +# 2.1 +ADD_H5_TEST (h5diff_21 0 -v ${FILE3} ${FILE3} dset l1) + +# 2.2 +ADD_H5_TEST (h5diff_22 0 -v ${FILE3} ${FILE3} dset t1) + +# ############################################################################## +# # compare groups, types, links (no differences and differences) +# ############################################################################## + +# 2.3 +ADD_H5_TEST (h5diff_23 0 -v ${FILE3} ${FILE3} g1 g1) + +# 2.4 +ADD_H5_TEST (h5diff_24 0 -v ${FILE3} ${FILE3} t1 t1) + +# 2.5 +ADD_H5_TEST (h5diff_25 0 -v ${FILE3} ${FILE3} l1 l1) + +# 2.6 +ADD_H5_TEST (h5diff_26 0 -v ${FILE3} ${FILE3} g1 g2) + +# 2.7 +ADD_H5_TEST (h5diff_27 1 -v ${FILE3} ${FILE3} t1 t2) + +# 2.8 +ADD_H5_TEST (h5diff_28 1 -v ${FILE3} ${FILE3} l1 l2) + +# ############################################################################## +# # Dataset datatypes +# ############################################################################## + +# 5.0 +ADD_H5_TEST (h5diff_50 1 -v ${FILE4} ${FILE4} dset0a dset0b) + +# 5.1 +ADD_H5_TEST (h5diff_51 1 -v ${FILE4} ${FILE4} dset1a dset1b) + +# 5.2 +ADD_H5_TEST (h5diff_52 1 -v ${FILE4} ${FILE4} dset2a dset2b) + +# 5.3 +ADD_H5_TEST (h5diff_53 1 -v ${FILE4} ${FILE4} dset3a dset4b) + +# 5.4 +ADD_H5_TEST (h5diff_54 1 -v ${FILE4} ${FILE4} dset4a dset4b) + +# 5.5 +ADD_H5_TEST (h5diff_55 1 -v ${FILE4} ${FILE4} dset5a dset5b) + +# 5.6 +ADD_H5_TEST (h5diff_56 1 -v ${FILE4} ${FILE4} dset6a dset6b) + +# 5.7 +ADD_H5_TEST (h5diff_57 0 -v ${FILE4} ${FILE4} dset7a dset7b) + +# 5.8 (region reference) +ADD_H5_TEST (h5diff_58 1 -v ${FILE7} ${FILE8} refreg) + +# test for both dset and attr with same type but with different size +# ( HDDFV-7942 ) +ADD_H5_TEST (h5diff_59 0 -v ${FILE4} ${FILE4} dset11a dset11b) + +# ############################################################################## +# # Error messages +# ############################################################################## + +# 6.0: Check if the command line number of arguments is less than 3 +ADD_H5_TEST (h5diff_600 1 ${FILE1}) + +# 6.1: Check if non-exist object name is specified +ADD_H5_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj) + +# ############################################################################## +# # -d +# ############################################################################## + +# 6.3: negative value +ADD_H5_TEST (h5diff_603 1 -d -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.4: zero +ADD_H5_TEST (h5diff_604 1 -d 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.5: non number +ADD_H5_TEST (h5diff_605 1 -d u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.6: hexadecimal +ADD_H5_TEST (h5diff_606 1 -d 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.7: string +ADD_H5_TEST (h5diff_607 1 -d "1" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.8: use system epsilon +ADD_H5_TEST (h5diff_608 1 --use-system-epsilon ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.9: number larger than biggest difference +ADD_H5_TEST (h5diff_609 0 -d 200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.10: number smaller than smallest difference +ADD_H5_TEST (h5diff_610 1 -d 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# ############################################################################## +# # -p +# ############################################################################## + +# 6.12: negative value +ADD_H5_TEST (h5diff_612 1 -p -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.13: zero +ADD_H5_TEST (h5diff_613 1 -p 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.14: non number +ADD_H5_TEST (h5diff_614 1 -p u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.15: hexadecimal +ADD_H5_TEST (h5diff_615 1 -p 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.16: string +ADD_H5_TEST (h5diff_616 1 -p "0.21" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.17: repeated option +ADD_H5_TEST (h5diff_617 1 -p 0.21 -p 0.22 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.18: number larger than biggest difference +ADD_H5_TEST (h5diff_618 0 -p 2 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.19: number smaller than smallest difference +ADD_H5_TEST (h5diff_619 1 -p 0.005 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# ############################################################################## +# # -n +# ############################################################################## + +# 6.21: negative value +ADD_H5_TEST (h5diff_621 1 -n -4 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.22: zero +ADD_H5_TEST (h5diff_622 1 -n 0 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.23: non number +ADD_H5_TEST (h5diff_623 1 -n u ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.24: hexadecimal +ADD_H5_TEST (h5diff_624 1 -n 0x1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.25: string +ADD_H5_TEST (h5diff_625 1 -n "2" ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.26: repeated option +ADD_H5_TEST (h5diff_626 1 -n 2 -n 3 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.27: number larger than biggest difference +ADD_H5_TEST (h5diff_627 1 --count=200 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# 6.28: number smaller than smallest difference +ADD_H5_TEST (h5diff_628 1 -n 1 ${FILE1} ${FILE2} g1/dset3 g1/dset4) + +# Disabling this test as it hangs - LRK 20090618 +# 6.29 non valid files +#ADD_H5_TEST (h5diff_629 2 file1.h6 file2.h6) + +# ############################################################################## +# # NaN +# ############################################################################## +# 6.30: test (NaN == NaN) must be true based on our documentation -- XCAO +ADD_H5_TEST (h5diff_630 0 -v -d "0.0001" ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) +ADD_H5_TEST (h5diff_631 0 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp18 g1/fp18_COPY) + +# ############################################################################## +# 7. attributes +# ############################################################################## +ADD_H5_TEST (h5diff_70 1 -v ${FILE5} ${FILE6}) + +# ################################################## +# attrs with verbose option level +# ################################################## +ADD_H5_TEST (h5diff_700 1 -v1 ${FILE5} ${FILE6}) +ADD_H5_TEST (h5diff_701 1 -v2 ${FILE5} ${FILE6}) +ADD_H5_TEST (h5diff_702 1 --verbose=1 ${FILE5} ${FILE6}) +ADD_H5_TEST (h5diff_703 1 --verbose=2 ${FILE5} ${FILE6}) + +# same attr number , all same attr name +ADD_H5_TEST (h5diff_704 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g) + +# same attr number , some same attr name +ADD_H5_TEST (h5diff_705 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /dset) + +# same attr number , all different attr name +ADD_H5_TEST (h5diff_706 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /ntype) + +# different attr number , same attr name (intersected) +ADD_H5_TEST (h5diff_707 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g2) + +# different attr number , all different attr name +ADD_H5_TEST (h5diff_708 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g3) + +# when no attributes exist in both objects +ADD_H5_TEST (h5diff_709 0 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2} /g4) + +# file vs file +ADD_H5_TEST (h5diff_710 1 -v2 ${ATTR_VERBOSE_LEVEL_FILE1} ${ATTR_VERBOSE_LEVEL_FILE2}) + +# ############################################################################## +# 8. all dataset datatypes +# ############################################################################## +ADD_H5_TEST (h5diff_80 1 -v ${FILE7} ${FILE8}) + +# 9. compare a file with itself +ADD_H5_TEST (h5diff_90 0 -v ${FILE2} ${FILE2}) + +# 10. read by hyperslab, print indexes +#if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then +# # skip this test which sometimes hangs in some THG machines +# MESSAGE (STATUS "SKIP -v ${FILE9} ${FILE10}) +#else +# ADD_H5_TEST (h5diff_100 1 -v ${FILE9} ${FILE10}) +#fi + +# 11. floating point comparison +ADD_H5_TEST (h5diff_101 1 -v ${FILE1} ${FILE1} g1/d1 g1/d2) + +ADD_H5_TEST (h5diff_102 1 -v ${FILE1} ${FILE1} g1/fp1 g1/fp2) + +# with --use-system-epsilon for double value. expect less differences +ADD_H5_TEST (h5diff_103 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/d1 +g1/d2) + +# with --use-system-epsilon for float value. expect less differences +ADD_H5_TEST (h5diff_104 1 -v --use-system-epsilon ${FILE1} ${FILE1} g1/fp1 +g1/fp2) + +# not comparable -c flag +ADD_H5_TEST (h5diff_200 0 ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_201 0 -c ${FILE2} ${FILE2} g2/dset1 g2/dset2) + +ADD_H5_TEST (h5diff_202 0 -c ${FILE2} ${FILE2} g2/dset2 g2/dset3) + +ADD_H5_TEST (h5diff_203 0 -c ${FILE2} ${FILE2} g2/dset3 g2/dset4) + +ADD_H5_TEST (h5diff_204 0 -c ${FILE2} ${FILE2} g2/dset4 g2/dset5) + +ADD_H5_TEST (h5diff_205 0 -c ${FILE2} ${FILE2} g2/dset5 g2/dset6) + +# not comparable in compound +ADD_H5_TEST (h5diff_206 0 -c ${FILE2} ${FILE2} g2/dset7 g2/dset8) + +ADD_H5_TEST (h5diff_207 0 -c ${FILE2} ${FILE2} g2/dset8 g2/dset9) + +# not comparable in dataspace of zero dimension size +ADD_H5_TEST (h5diff_208 0 -c ${FILE19} ${FILE20}) + +# non-comparable dataset with comparable attribute, and other comparable datasets. +# All the rest comparables should display differences. +ADD_H5_TEST (h5diff_220 1 -c non_comparables1.h5 non_comparables2.h5 /g1) + +# comparable dataset with non-comparable attribute and other comparable attributes. +# Also test non-compatible attributes with different type, dimention, rank. +# All the rest comparables should display differences. +ADD_H5_TEST (h5diff_221 1 -c non_comparables1.h5 non_comparables2.h5 /g2) + +# entire file +# All the rest comparables should display differences +ADD_H5_TEST (h5diff_222 1 -c non_comparables1.h5 non_comparables2.h5) + +# non-comparable test for common objects (same name) with different object types +# (HDFFV-7644) +ADD_H5_TEST (h5diff_223 0 -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes) +# swap files +ADD_H5_TEST (h5diff_224 0 -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes) + +# ############################################################################## +# # Links compare without --follow-symlinks nor --no-dangling-links +# ############################################################################## +# test for bug1749 +ADD_H5_TEST (h5diff_300 1 -v ${FILE12} ${FILE12} /link_g1 /link_g2) + +# ############################################################################## +# # Links compare with --follow-symlinks Only +# ############################################################################## +# soft links file to file +ADD_H5_TEST (h5diff_400 0 --follow-symlinks -v ${FILE13} ${FILE13}) + +# softlink vs dset" +ADD_H5_TEST (h5diff_401 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /target_dset2) + +# dset vs softlink" +ADD_H5_TEST (h5diff_402 1 --follow-symlinks -v ${FILE13} ${FILE13} /target_dset2 /softlink_dset1_1) + +# softlink vs softlink" +ADD_H5_TEST (h5diff_403 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset1_1 /softlink_dset2) + +# extlink vs extlink (FILE)" +ADD_H5_TEST (h5diff_404 0 --follow-symlinks -v ${FILE15} ${FILE15}) + +# extlink vs dset" +ADD_H5_TEST (h5diff_405 1 --follow-symlinks -v ${FILE15} ${FILE16} /ext_link_dset1 /target_group2/x_dset) + +# dset vs extlink" +ADD_H5_TEST (h5diff_406 1 --follow-symlinks -v ${FILE16} ${FILE15} /target_group2/x_dset /ext_link_dset1) + +# extlink vs extlink" +ADD_H5_TEST (h5diff_407 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_dset2) + +# softlink vs extlink" +ADD_H5_TEST (h5diff_408 1 --follow-symlinks -v ${FILE13} ${FILE15} /softlink_dset1_1 /ext_link_dset2) + +# extlink vs softlink " +ADD_H5_TEST (h5diff_409 1 --follow-symlinks -v ${FILE15} ${FILE13} /ext_link_dset2 /softlink_dset1_1) + +# linked_softlink vs linked_softlink (FILE)" +ADD_H5_TEST (h5diff_410 0 --follow-symlinks -v ${FILE14} ${FILE14}) + +# dset2 vs linked_softlink_dset1" +ADD_H5_TEST (h5diff_411 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_dset2 /softlink1_to_slink2) + +# linked_softlink_dset1 vs dset2" +ADD_H5_TEST (h5diff_412 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /target_dset2) + +# linked_softlink_to_dset1 vs linked_softlink_to_dset2" +ADD_H5_TEST (h5diff_413 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink1_to_slink2 /softlink2_to_slink2) + +# group vs linked_softlink_group1" +ADD_H5_TEST (h5diff_414 1 --follow-symlinks -v ${FILE14} ${FILE14} /target_group /softlink3_to_slink2) + +# linked_softlink_group1 vs group" +ADD_H5_TEST (h5diff_415 1 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /target_group) + +# linked_softlink_to_group1 vs linked_softlink_to_group2" +ADD_H5_TEST (h5diff_416 0 --follow-symlinks -v ${FILE14} ${FILE14} /softlink3_to_slink2 /softlink4_to_slink2) + +# non-exist-softlink vs softlink" +ADD_H5_TEST (h5diff_417 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_noexist /softlink_dset2) + +# softlink vs non-exist-softlink" +ADD_H5_TEST (h5diff_418 1 --follow-symlinks -v ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# non-exist-extlink_file vs extlink" +ADD_H5_TEST (h5diff_419 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist2 /ext_link_dset2) + +# exlink vs non-exist-extlink_file" +ADD_H5_TEST (h5diff_420 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist2) + +# extlink vs non-exist-extlink_obj" +ADD_H5_TEST (h5diff_421 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_dset2 /ext_link_noexist1) + +# non-exist-extlink_obj vs extlink" +ADD_H5_TEST (h5diff_422 1 --follow-symlinks -v ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_dset2) + +# extlink_to_softlink_to_dset1 vs dset2" +ADD_H5_TEST (h5diff_423 1 --follow-symlinks -v ${FILE17} ${FILE18} /ext_link_to_slink1 /dset2) + +# dset2 vs extlink_to_softlink_to_dset1" +ADD_H5_TEST (h5diff_424 1 --follow-symlinks -v ${FILE18} ${FILE17} /dset2 /ext_link_to_slink1) + +# extlink_to_softlink_to_dset1 vs extlink_to_softlink_to_dset2" +ADD_H5_TEST (h5diff_425 1 --follow-symlinks -v ${FILE17} ${FILE17} /ext_link_to_slink1 /ext_link_to_slink2) + +# ############################################################################## +# # Dangling links compare (--follow-symlinks and --no-dangling-links) +# ############################################################################## +# dangling links --follow-symlinks (FILE to FILE) +ADD_H5_TEST (h5diff_450 1 --follow-symlinks -v ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# dangling links --follow-symlinks and --no-dangling-links (FILE to FILE) +ADD_H5_TEST (h5diff_451 2 --follow-symlinks -v --no-dangling-links ${DANGLE_LINK_FILE1} ${DANGLE_LINK_FILE2}) + +# try --no-dangling-links without --follow-symlinks options +ADD_H5_TEST (h5diff_452 2 --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (FILE to FILE) +ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13}) + +# dangling link found for soft links (obj to obj) +ADD_H5_TEST (h5diff_454 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_dset2 /softlink_noexist) + +# dangling link found for soft links (obj to obj) Both dangle links +ADD_H5_TEST (h5diff_455 2 --follow-symlinks -v --no-dangling-links ${FILE13} ${FILE13} /softlink_noexist /softlink_noexist) + +# dangling link found for ext links (FILE to FILE) +ADD_H5_TEST (h5diff_456 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15}) + +# dangling link found for ext links (obj to obj). target file exist +ADD_H5_TEST (h5diff_457 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist1) + +# dangling link found for ext links (obj to obj). target file NOT exist +ADD_H5_TEST (h5diff_458 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_dset1 /ext_link_noexist2) + +# dangling link found for ext links (obj to obj). Both dangle links +ADD_H5_TEST (h5diff_459 2 --follow-symlinks -v --no-dangling-links ${FILE15} ${FILE15} /ext_link_noexist1 /ext_link_noexist2) + +# dangling link --follow-symlinks (obj vs obj) +# (HDFFV-7836) +ADD_H5_TEST (h5diff_465 0 --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# (HDFFV-7835) +# soft dangling vs. soft dangling +ADD_H5_TEST (h5diff_466 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +# soft link vs. soft dangling +ADD_H5_TEST (h5diff_467 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link2) +# ext dangling vs. ext dangling +ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +# ext link vs. ext dangling +ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) + +#--------------------------------------------------- +# dangling links without follow symlink +# (HDFFV-7998) +# test - soft dangle links (same and different paths), +# - external dangle links (same and different paths) +ADD_H5_TEST (h5diff_471 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5) +ADD_H5_TEST (h5diff_472 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +ADD_H5_TEST (h5diff_473 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4) +ADD_H5_TEST (h5diff_474 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +ADD_H5_TEST (h5diff_475 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1) + + +# ############################################################################## +# # test for group diff recursivly +# ############################################################################## +# root +ADD_H5_TEST (h5diff_500 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) +ADD_H5_TEST (h5diff_501 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /) + +# root vs group +ADD_H5_TEST (h5diff_502 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} / /grp1/grp2/grp3) + +# group vs group (same name and structure) +ADD_H5_TEST (h5diff_503 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /grp1) + +# group vs group (different name and structure) +ADD_H5_TEST (h5diff_504 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /grp1/grp2/grp3) + +# groups vs soft-link +ADD_H5_TEST (h5diff_505 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /slink_grp1) +ADD_H5_TEST (h5diff_506 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1/grp2 /slink_grp2) + +# groups vs ext-link +ADD_H5_TEST (h5diff_507 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) +ADD_H5_TEST (h5diff_508 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp1 /elink_grp1) + +# soft-link vs ext-link +ADD_H5_TEST (h5diff_509 0 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) +ADD_H5_TEST (h5diff_510 0 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp1 /elink_grp1) + +# circled ext links +ADD_H5_TEST (h5diff_511 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) +ADD_H5_TEST (h5diff_512 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /grp10 /grp11) + +# circled soft2ext-link vs soft2ext-link +ADD_H5_TEST (h5diff_513 1 -v ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) +ADD_H5_TEST (h5diff_514 1 -v --follow-symlinks ${GRP_RECURSE_FILE1} ${GRP_RECURSE_FILE2} /slink_grp10 /slink_grp11) + +############################################################################### +# Test for group recursive diff via multi-linked external links +# With follow-symlinks, file $GRP_RECURSE1_EXT and $GRP_RECURSE2_EXT1 should +# be same with the external links. +############################################################################### +# file vs file +ADD_H5_TEST (h5diff_515 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) +ADD_H5_TEST (h5diff_516 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1}) +# group vs group +ADD_H5_TEST (h5diff_517 1 -v ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) +ADD_H5_TEST (h5diff_518 0 -v --follow-symlinks ${GRP_RECURSE1_EXT} ${GRP_RECURSE2_EXT1} /g1) + +# ############################################################################## +# # Exclude path (--exclude-path) +# ############################################################################## +# +# Same structure, same names and different value. +# +# Exclude the object with different value. Expect return - same +ADD_H5_TEST (h5diff_480 0 -v --exclude-path /group1/dset3 ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2}) +# Verify different by not excluding. Expect return - diff +ADD_H5_TEST (h5diff_481 1 -v ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2}) + +# +# Different structure, different names. +# +# Exclude all the different objects. Expect return - same +ADD_H5_TEST (h5diff_482 0 -v --exclude-path "/group1" --exclude-path "/dset1" ${EXCLUDE_FILE2_1} ${EXCLUDE_FILE2_2}) +# Exclude only some different objects. Expect return - diff +ADD_H5_TEST (h5diff_483 1 -v --exclude-path "/group1" ${EXCLUDE_FILE2_1} ${EXCLUDE_FILE2_2}) + +# Exclude from group compare +ADD_H5_TEST (h5diff_484 0 -v --exclude-path "/dset3" ${EXCLUDE_FILE1_1} ${EXCLUDE_FILE1_2} /group1) + +# +# Only one file contains unique objs. Common objs are same. +# (HDFFV-7837) +# +ADD_H5_TEST (h5diff_485 0 -v --exclude-path "/group1" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) +ADD_H5_TEST (h5diff_486 0 -v --exclude-path "/group1" h5diff_exclude3-2.h5 h5diff_exclude3-1.h5) +ADD_H5_TEST (h5diff_487 1 -v --exclude-path "/group1/dset" h5diff_exclude3-1.h5 h5diff_exclude3-2.h5) + + + +# ############################################################################## +# # diff various multiple vlen and fixed strings in a compound type dataset +# ############################################################################## +ADD_H5_TEST (h5diff_530 0 -v ${COMP_VL_STRS_FILE} ${COMP_VL_STRS_FILE} /group /group_copy) + +# ############################################################################## +# # Test container types (array,vlen) with multiple nested compound types +# # Complex compound types in dataset and attribute +# ############################################################################## +ADD_H5_TEST (h5diff_540 1 -v ${COMPS_ARRAY_VLEN_FILE1} ${COMPS_ARRAY_VLEN_FILE2}) + +# ############################################################################## +# # Test mutually exclusive options +# ############################################################################## +# +# Test with -d , -p and --use-system-epsilon. +ADD_H5_TEST (h5diff_640 1 -v -d 5 -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_641 1 -v -d 5 -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_642 1 -v -p 0.05 -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_643 1 -v -d 5 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_644 1 -v --use-system-epsilon -d 5 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_645 1 -v -p 0.05 --use-system-epsilon ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) +ADD_H5_TEST (h5diff_646 1 -v --use-system-epsilon -p 0.05 ${FILE1} ${FILE2} /g1/dset3 /g1/dset4) diff --git a/tools/h5diff/Makefile.am b/tools/h5diff/Makefile.am index 190c083..05417f5 100644 --- a/tools/h5diff/Makefile.am +++ b/tools/h5diff/Makefile.am @@ -43,7 +43,7 @@ TEST_SCRIPT=testh5diff.sh check_PROGRAMS=$(TEST_PROG) check_SCRIPTS=$(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. -SCRIPT_DEPEND=h5diff$(EXEEXT) $(H5PDIFF) $(srcdir)/testh5diff.sh +SCRIPT_DEPEND=h5diff$(EXEEXT) $(H5PDIFF) testh5diff.sh # Source files for the program h5diff_SOURCES=h5diff_main.c h5diff_common.c diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 5567ceb..9b46f4e 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -456,7 +456,7 @@ TEST_PROG = h5diffgentest TEST_SCRIPT = testh5diff.sh check_SCRIPTS = $(TEST_SCRIPT) $(TEST_SCRIPT_PARA) # The parallel test script testph5diff.sh actually depends on testh5diff.sh. -SCRIPT_DEPEND = h5diff$(EXEEXT) $(H5PDIFF) $(srcdir)/testh5diff.sh +SCRIPT_DEPEND = h5diff$(EXEEXT) $(H5PDIFF) testh5diff.sh # Source files for the program h5diff_SOURCES = h5diff_main.c h5diff_common.c diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 7c69154..2271703 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -560,10 +560,10 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) int data4[3][2] = {{0,0},{0,0},{0,0}}; int data5[2][2] = {{0,0},{0,0}}; unsigned int data6[3][2] = {{0,0},{0,0},{0,0}}; - cmp1_t data7[1] = {1,2}; - cmp2_t data8[1] = {1,2}; - hsize_t dims3[2] = { 2,2 }; - hsize_t dims4[1] = { 1 }; + cmp1_t data7[1] = {{1.0f, 2}}; + cmp2_t data8[1] = {{1, 2.0f}}; + hsize_t dims3[2] = {2, 2}; + hsize_t dims4[1] = {1}; size_t type_size; hid_t tid; @@ -3664,9 +3664,6 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int }; hsize_t dims_fixlen_str_array[] = {FIXLEN_STR_ARRY_DIM}; - /* objref */ - hsize_t objref_dims[1]={1}; - /*------------------------------------------ * compound dataset *------------------------------------------*/ @@ -4261,15 +4258,39 @@ test_enums(const char *fname) tid = H5Tenum_create(H5T_NATIVE_INT); enum_val = 0; status = H5Tenum_insert(tid, "YIN", &enum_val); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + status = FAIL; + goto out; + } enum_val = 1; status = H5Tenum_insert(tid, "YANG", &enum_val); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + status = FAIL; + goto out; + } /*----------------------------------------------------------------------- * Create datasets containing enum data. *---------------------------------------------------------------------*/ status = write_dset(fid, 1, &dims, "dset1", tid, data1); + if (status < 0) + { + fprintf(stderr, "Error: %s> write_dset failed.\n", fname); + status = FAIL; + goto out; + } status = write_dset(fid, 1, &dims, "dset2", tid, data2); + if (status < 0) + { + fprintf(stderr, "Error: %s> write_dset failed.\n", fname); + status = FAIL; + goto out; + } out: /*----------------------------------------------------------------------- @@ -4398,6 +4419,7 @@ static void test_comps_array (const char *fname, const char *dset, const char *a * Create an attribute in root group */ tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); @@ -4440,6 +4462,7 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a hid_t fid; /* HDF5 File ID */ hid_t did_dset; /* dataset ID */ hid_t sid_dset; /* dataset space ID */ + hid_t tid_attr; hid_t tid_cmpd2; /* compound2 type ID */ hid_t tid_cmpd1; /* compound1 type ID */ hid_t tid_cmpd1_vlen; @@ -4504,22 +4527,22 @@ static void test_comps_vlen (const char * fname, const char *dset, const char *a ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); assert(ret >= 0); - /* Reclaim the write VL data */ - ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); - assert(ret >= 0); - /*----------------------------------- * Create an attribute in root group */ - /* TODO: creating vlen with compound type doesn't work for attribute now. - * so add this later when it's fixed tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); - */ + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); /* ---------------- * Close IDs */ + ret = H5Aclose(tid_attr); + assert(ret >= 0); ret = H5Dclose(did_dset); assert(ret >= 0); ret = H5Tclose(tid_cmpd2); @@ -4556,6 +4579,7 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch hid_t fid; /* HDF5 File IDs */ hid_t did_dset; /* Dataset ID */ hid_t sid_dset; /* Dataspace ID */ + hid_t tid_attr; hid_t tid_cmpd1; /* Compound1 Datatype ID */ hid_t tid_arry1; /* Array Datatype ID */ hid_t tid_cmpd2; /* Compound2 Datatype ID */ @@ -4643,22 +4667,22 @@ static void test_comps_array_vlen (const char * fname, const char *dset,const ch ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); assert(ret >= 0); - /* Reclaim the write VL data */ - ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); - assert(ret >= 0); - /*----------------------------------- * Create an attribute in root group */ - /* TODO: creating vlen with compound type doesn't work for attribute now. - * so add this later when it's fixed tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); - */ + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); /*------------------- * Close IDs */ + ret = H5Aclose(tid_attr); + assert(ret >= 0); ret = H5Tclose(tid_arry1); assert(ret >= 0); ret = H5Dclose(did_dset); @@ -4703,6 +4727,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch hid_t fid; /* HDF5 File ID */ hid_t did_dset; /* dataset ID */ hid_t sid_dset; /* dataset space ID */ + hid_t tid_attr; hid_t tid_cmpd3; /* compound3 type ID */ hid_t tid_cmpd2; /* compound2 type ID */ hid_t tid_cmpd2_arry; @@ -4788,22 +4813,22 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch ret = H5Dwrite(did_dset, tid_cmpd1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); assert(ret >= 0); - /* Reclaim the write VL data */ - ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); - assert(ret >= 0); - /*----------------------------------- * Create an attribute in root group */ - /* TODO: creating vlen with compound type doesn't work for attribute now. - * so add this later when it's fixed tid_attr = H5Acreate2(fid, attr, tid_cmpd1, sid_dset, H5P_DEFAULT, H5P_DEFAULT); + assert(tid_attr > 0); ret = H5Awrite(tid_attr, tid_cmpd1, wdata); assert(ret >= 0); - */ + + /* Reclaim the write VL data */ + ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata); + assert(ret >= 0); /* ---------------- * Close IDs */ + ret = H5Aclose(tid_attr); + assert(ret >= 0); ret = H5Dclose(did_dset); assert(ret >= 0); ret = H5Sclose(sid_dset); diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 8d15e2b..30ff215 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -21,12 +21,6 @@ SET_TARGET_PROPERTIES (h5dump PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5dump) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5dump test executable @@ -40,2094 +34,12 @@ IF (BUILD_TESTING) #ADD_TEST (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory - # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES - ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-5s.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-6.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tallfilters.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-4_be.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrregR.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tchunked.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompact.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontents.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontiguos.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregR.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdeflate.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-3s.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstart.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubcount.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstride.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubblock.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/texternal.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfill.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfletcher32.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-5.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesno.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesyes.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.ddl - #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ddl - #${HDF5_TOOLS_SRC_DIR}/testfiles/tqmarkfile.ddl - #${HDF5_TOOLS_SRC_DIR}/testfiles/tstarfile.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.ddl - ${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/trawssetfile.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr5.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tperror.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/treference.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarintsize.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarattrintsize.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarstring.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscaleoffset.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tshuffle.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-D.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstringe.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tszip.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tuserfilter.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.ddl - ${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 - trawssetfile.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 - ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/taindices.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr4_be.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinary.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.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/tempty.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents1.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents2.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfilters.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfvalues.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.h5 - #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-b.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-g.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-l.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-o.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-r.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-s.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcmpddt.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarintsize.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarattrintsize.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarstring.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-m.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-r.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr3.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 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 - ) - SET (HDF5_ERROR_REFERENCE_TEST_FILES - ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err - ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err - ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err - ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err - ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err - ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err - ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err - ${PROJECT_SOURCE_DIR}/errfiles/tattr-3.err - ${PROJECT_SOURCE_DIR}/errfiles/tcomp-3.err - ${PROJECT_SOURCE_DIR}/errfiles/tdataregR.err - ${PROJECT_SOURCE_DIR}/errfiles/tdset-2.err - ${PROJECT_SOURCE_DIR}/errfiles/texceedsubblock.err - ${PROJECT_SOURCE_DIR}/errfiles/texceedsubcount.err - ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstart.err - ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstride.err - ${PROJECT_SOURCE_DIR}/errfiles/textlink.err - ${PROJECT_SOURCE_DIR}/errfiles/textlinkfar.err - ${PROJECT_SOURCE_DIR}/errfiles/textlinksrc.err - ${PROJECT_SOURCE_DIR}/errfiles/torderlinks1.err - ${PROJECT_SOURCE_DIR}/errfiles/torderlinks2.err - ${PROJECT_SOURCE_DIR}/errfiles/tgroup-2.err - ${PROJECT_SOURCE_DIR}/errfiles/tperror.err - ${PROJECT_SOURCE_DIR}/errfiles/tslink-D.err - ) - - # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - - # - # copy test files from source dir to test dir - # - FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - 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/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_other_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_other_file} ${dest} - ) - ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) - - FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") - #MESSAGE (STATUS " Copying ${tst_error_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_error_file} ${dest} - ) - 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 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5 - ${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 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tbitfields.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-uri.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-uri.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns-2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tenum.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmany.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-amp.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-lt.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tref.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes-at.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring-at.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5.xml - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml - ) - - 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/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} - ) - ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) - - FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) - GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") - #MESSAGE (STATUS " Copying ${tst_xml_other_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${tst_xml_other_file} ${dest} - ) - ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) - - # -------------------------------------------------------------------- - # Packed Bits - # -------------------------------------------------------------------- - #-- Copy all the HDF5 files from the test directory into the source directory - SET (HDF5_REFERENCE_PBITS - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIncomplete.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongLengthExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthPositive.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMax.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMaxExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongOffsetExceeded.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetNegative.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOverlapped.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedIntWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedIntWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole1.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole63.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole63.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong16.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong16.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong32.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong32.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned2.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt4.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong8.ddl - ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong8.ddl - ${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 - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIncomplete.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthPositive.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongLengthExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongOffsetExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsMaxExceeded.err - ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetExceeded.err - ${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/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${ddl_pbits} ${ddldest} - ) - ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) - - FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) - GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) - SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") - #MESSAGE (STATUS " Copying ${ddl_pbits}") - ADD_CUSTOM_COMMAND ( - TARGET h5dump - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${ddl_pbits} ${ddldest} - ) - ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_HELP_TEST testname resultcode) - # 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/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-h5dump-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove h5dump-${testname}.out h5dump-${testname}.out.err - ) - 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/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-h5dump-${testname}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_HELP_TEST) - - MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5DUMP-${skipresultfile}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_SKIP_H5_TEST) - - MACRO (ADD_H5_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/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}.bin ${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}" - -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") - 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) - 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 ${resultfile}.txt ${resultfile}.exp - ) - 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-${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/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/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-${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-${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/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/std" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ERRREF=${resultfile}.err" - -D "TEST_MASK_ERROR=true" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - 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_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) - IF (NOT 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/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/std" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -D "TEST_ERRREF=${resultfile}.err" - -D "TEST_MASK_ERROR=true" - -D "TEST_ENV_VAR:STRING=${envvar}" - -D "TEST_ENV_VALUE:STRING=${envval}" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) - - 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) - ADD_TEST ( - NAME H5DUMP-XML-${skipresultfile}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_XML_SKIP_H5_TEST) - - 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/xml") - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - 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-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - 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/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-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_XML_H5_TEST file) - -############################################################################## -############################################################################## -### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### -############################################################################## -############################################################################## - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5DUMP-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5dump-help.out - charsets.out - charsets.out.err - file_space.out - file_space.out.err - filter_fail.out - filter_fail.out.err - packedbits.out - packedbits.out.err - tall-1.out - tall-1.out.err - tall-2.out - tall-2.out.err - tall-2A.out - tall-2A.out.err - tall-2A0.out - tall-2A0.out.err - tall-2B.out - tall-2B.out.err - tall-3.out - tall-3.out.err - tall-4s.out - tall-4s.out.err - tall-5s.out - tall-5s.out.err - tall-6.txt - tall-6.out - tall-6.out.err - tallfilters.out - tallfilters.out.err - tarray1.out - tarray1.out.err - tarray1_big.out - tarray1_big.out.err - tarray2.out - tarray2.out.err - tarray3.out - tarray3.out.err - tarray4.out - tarray4.out.err - tarray5.out - tarray5.out.err - tarray6.out - tarray6.out.err - tarray7.out - tarray7.out.err - tarray8.out - tarray8.out.err - tattr-1.out - tattr-1.out.err - tattr-2.out - tattr-2.out.err - tattr-3.out - tattr-3.out.err - tattr-4_be.out - tattr-4_be.out.err - tattrcontents1.out - tattrcontents1.out.err - tattrcontents2.out - tattrcontents2.out.err - tattrintsize.out - tattrintsize.out.err - tattrreg.out - tattrreg.out.err - tattrregR.out - tattrregR.out.err - tbin1LE.bin - tbinregR.txt - tbinregR.out - tbinregR.out.err - tbigdims.out - tbigdims.out.err - tboot1.out - tboot1.out.err - tboot2.out - tboot2.out.err - tchar1.out - tchar1.out.err - tchunked.out - tchunked.out.err - tcmpdattrintsize.out - tcmpdattrintsize.out.err - tcmpdintsize.out - tcmpdintsize.out.err - tcomp-1.out - tcomp-1.out.err - tcomp-2.out - tcomp-2.out.err - tcomp-3.out - tcomp-3.out.err - tcomp-4.out - tcomp-4.out.err - tcompact.out - tcompact.out.err - tcontents.out - tcontents.out.err - tcontiguos.out - tcontiguos.out.err - tdatareg.out - tdatareg.out.err - tdataregR.out - tdataregR.out.err - tdeflate.out - tdeflate.out.err - tdset-1.out - tdset-1.out.err - tdset-2.out - tdset-2.out.err - tdset-3s.out - tdset-3s.out.err - tempty.out - tempty.out.err - texternal.out - texternal.out.err - textlinksrc.out - textlinksrc.out.err - textlinkfar.out - textlinkfar.out.err - textlink.out - textlink.out.err - tfamily.out - tfamily.out.err - tfill.out - tfill.out.err - tfletcher32.out - tfletcher32.out.err - tfpformat.out - tfpformat.out.err - tgroup-1.out - tgroup-1.out.err - tgroup-2.out - tgroup-2.out.err - tgrp_comments.out - tgrp_comments.out.err - thlink-1.out - thlink-1.out.err - thlink-2.out - thlink-2.out.err - thlink-3.out - thlink-3.out.err - thlink-4.out - thlink-4.out.err - thlink-5.out - thlink-5.out.err - thyperslab.out - thyperslab.out.err - tindicesno.out - tindicesno.out.err - tindicessub1.out - tindicessub1.out.err - tindicessub2.out - tindicessub2.out.err - tindicessub3.out - tindicessub3.out.err - tindicessub4.out - tindicessub4.out.err - texceedsubstart.out - texceedsubstart.out.err - texceedsubcount.out - texceedsubcount.out.err - texceedsubstride.out - texceedsubstride.out.err - texceedsubblock.out - texceedsubblock.out.err - tindicesyes.out - tindicesyes.out.err - tlarge_objname.out - tlarge_objname.out.err - tldouble.out - tldouble.out.err - tlonglinks.out - tlonglinks.out.err - tloop-1.out - tloop-1.out.err - tmulti.out - tmulti.out.err - tmultifile.out - tmultifile.out.err -# tqmarkfile.out -# tqmarkfile.out.err -# tstarfile.out -# tstarfile.out.err - tnamed_dtype_attr.out - tnamed_dtype_attr.out.err - tnestcomp-1.out - tnestcomp-1.out.err - tnestedcmpddt.out - 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 - trawssetfile.out - trawssetfile.out.err - trawssetfile.txt - tno-subset.out - tno-subset.out.err - tnullspace.out - tnullspace.out.err - zerodim.out - zerodim.out.err - tordergr1.out - tordergr1.out.err - tordergr2.out - tordergr2.out.err - tordergr3.out - tordergr3.out.err - tordergr4.out - tordergr4.out.err - tordergr5.out - tordergr5.out.err - torderattr1.out - torderattr1.out.err - torderattr2.out - torderattr2.out.err - torderattr3.out - torderattr3.out.err - torderattr4.out - torderattr4.out.err - tordercontents1.out - tordercontents1.out.err - tordercontents2.out - tordercontents2.out.err - torderlinks1.out - torderlinks1.out.err - torderlinks2.out - torderlinks2.out.err - tperror.out - tperror.out.err - treference.out - treference.out.err - tsaf.out - tsaf.out.err - tscalarintsize.out - tscalarintsize.out.err - tscalarattrintsize.out - tscalarattrintsize.out.err - tscalarstring.out - tscalarstring.out.err - tscaleoffset.out - tscaleoffset.out.err - tshuffle.out - tshuffle.out.err - tslink-1.out - tslink-1.out.err - tslink-2.out - tslink-2.out.err - tslink-D.out - tslink-D.out.err - tsplit_file.out - tsplit_file.out.err - tstr-1.out - tstr-1.out.err - tstr-2.out - tstr-2.out.err - tstr2bin2.txt - tstr2bin6.txt - tstring.out - tstring.out.err - tstring2.out - tstring2.out.err - tstringe.out - tstringe.out.err - tszip.out - tszip.out.err - tudlink-1.out - tudlink-1.out.err - tudlink-2.out - tudlink-2.out.err - tuserfilter.out - tuserfilter.out.err - tvldtypes1.out - tvldtypes1.out.err - tvldtypes2.out - tvldtypes2.out.err - tvldtypes3.out - tvldtypes3.out.err - tvldtypes4.out - tvldtypes4.out.err - tvldtypes5.out - tvldtypes5.out.err - tvlstr.out - tvlstr.out.err - tvms.out - 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/std") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5DUMP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - 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 (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -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) - - # test for signed/unsigned datasets - ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5) - # test for compound signed/unsigned datasets - ADD_H5_TEST (tcmpdintsize 0 --enable-error-stack tcmpdintsize.h5) - # test for signed/unsigned scalar datasets - ADD_H5_TEST (tscalarintsize 0 --enable-error-stack tscalarintsize.h5) - # test for signed/unsigned attributes - ADD_H5_TEST (tattrintsize 0 --enable-error-stack tattrintsize.h5) - # test for compound signed/unsigned attributes - ADD_H5_TEST (tcmpdattrintsize 0 --enable-error-stack tcmpdattrintsize.h5) - # test for signed/unsigned scalar attributes - ADD_H5_TEST (tscalarattrintsize 0 --enable-error-stack tscalarattrintsize.h5) - # test for string scalar dataset and attribute - ADD_H5_TEST (tscalarstring 0 --enable-error-stack tscalarstring.h5) - # test for displaying groups - ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5) - # test for displaying the selected groups - ADD_H5ERR_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) - - # test for displaying simple space datasets - ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) - # test for displaying selected datasets - ADD_H5ERR_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) - - # test for displaying attributes - ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) - # test for displaying the selected attributes of string type and scalar space - ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) - # test for header and error messages - ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) - # test for displaying attributes in shared datatype (also in group and dataset) - ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) - # test for displaying at least 9 attributes on root from a be machine - ADD_H5_TEST (tattr-4_be 0 --enable-error-stack tattr4_be.h5) - - # test for displaying soft links and user-defined links - ADD_H5_TEST (tslink-1 0 --enable-error-stack tslink.h5) - ADD_H5_TEST (tudlink-1 0 --enable-error-stack tudlink.h5) - # test for displaying the selected link - ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) - ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) - # test for displaying dangling soft links - ADD_H5ERR_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) - - # tests for hard links - ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) - ADD_H5_TEST (thlink-2 0 --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) - ADD_H5_TEST (thlink-3 0 --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) - ADD_H5_TEST (thlink-4 0 --enable-error-stack -g /g1 thlink.h5) - ADD_H5_TEST (thlink-5 0 --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) - - # tests for compound data types - ADD_H5_TEST (tcomp-1 0 --enable-error-stack tcompound.h5) - # test for named data types - ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) - # test for unamed type - ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") - # test complicated compound datatype - ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) - - #test for the nested compound type - ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) - ADD_H5_TEST (tnestedcmpddt 0 --enable-error-stack tnestedcmpddt.h5) - - # test for options - ADD_H5ERR_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) - ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5) - ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) - - # test for loop detection - ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5) - - # test for string - ADD_H5_TEST (tstr-1 0 --enable-error-stack tstr.h5) - ADD_H5_TEST (tstr-2 0 --enable-error-stack tstr2.h5) - - # test for file created by Lib SAF team - ADD_H5_TEST (tsaf 0 --enable-error-stack tsaf.h5) - - # test for file with variable length data - ADD_H5_TEST (tvldtypes1 0 --enable-error-stack tvldtypes1.h5) - ADD_H5_TEST (tvldtypes2 0 --enable-error-stack tvldtypes2.h5) - ADD_H5_TEST (tvldtypes3 0 --enable-error-stack tvldtypes3.h5) - ADD_H5_TEST (tvldtypes4 0 --enable-error-stack tvldtypes4.h5) - ADD_H5_TEST (tvldtypes5 0 --enable-error-stack tvldtypes5.h5) - - #test for file with variable length string data - ADD_H5_TEST (tvlstr 0 --enable-error-stack tvlstr.h5) - - # test for files with array data - ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5) - # # added for bug# 2092 - tarray1_big.h5 - ADD_H5ERR_MASK_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5) - ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5) - ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5) - ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5) - ADD_H5_TEST (tarray5 0 --enable-error-stack tarray5.h5) - ADD_H5_TEST (tarray6 0 --enable-error-stack tarray6.h5) - ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5) - ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5) - - # test for wildcards in filename (does not work with cmake) - #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) - #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) - ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5) - - # test for files with empty data - ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) - - # test for files with groups that have comments - ADD_H5_TEST (tgrp_comments 0 --enable-error-stack tgrp_comments.h5) - - # test the --filedriver flag - ADD_H5_TEST (tsplit_file 0 --enable-error-stack --filedriver=split tsplit_file) - ADD_H5_TEST (tfamily 0 --enable-error-stack --filedriver=family tfamily%05d.h5) - ADD_H5_TEST (tmulti 0 --enable-error-stack --filedriver=multi tmulti) - - # test for files with group names which reach > 1024 bytes in size - ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5) - - # test '-A' to suppress data but print attr's - ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) - - # test '-A' to suppress attr's but print data - ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5) - - # test '-r' to print attributes in ASCII instead of decimal - ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) - - # test Subsetting - ADD_H5_TEST (tall-4s 0 --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) - ADD_H5_TEST (tall-5s 0 --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) - ADD_H5_TEST (tdset-3s 0 --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5) - ADD_H5_TEST (tno-subset 0 --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5) - - # test printing characters in ASCII instead of decimal - ADD_H5_TEST (tchar1 0 --enable-error-stack -r tchar.h5) - - # test datatypes in ASCII and UTF8 - ADD_H5_TEST (charsets 0 --enable-error-stack charsets.h5) - - # rev. 2004 - # tests for super block - ADD_H5_TEST (tboot1 0 --enable-error-stack -H -B -d dset tfcontents1.h5) - ADD_H5_TEST (tboot2 0 --enable-error-stack -B tfcontents2.h5) - ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) - - # test -p with a non existing dataset - ADD_H5ERR_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) - - # test for file contents - ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) - ADD_H5_TEST (tordercontents1 0 --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5) - ADD_H5_TEST (tordercontents2 0 --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5) - ADD_H5_TEST (tattrcontents1 0 --enable-error-stack -n 1 --sort_order=ascending tall.h5) - ADD_H5_TEST (tattrcontents2 0 --enable-error-stack -n 1 --sort_order=descending tall.h5) - - # tests for storage layout - # compact - ADD_H5_TEST (tcompact 0 --enable-error-stack -H -p -d compact tfilters.h5) - # contiguous - ADD_H5_TEST (tcontiguos 0 --enable-error-stack -H -p -d contiguous tfilters.h5) - # chunked - ADD_H5_TEST (tchunked 0 --enable-error-stack -H -p -d chunked tfilters.h5) - # external - ADD_H5_TEST (texternal 0 --enable-error-stack -H -p -d external tfilters.h5) - - # fill values - ADD_H5_TEST (tfill 0 --enable-error-stack -p tfvalues.h5) - - # several datatype, with references , print path - ADD_H5_TEST (treference 0 --enable-error-stack tattr2.h5) - - # escape/not escape non printable characters - ADD_H5_TEST (tstringe 0 --enable-error-stack -e tstr3.h5) - ADD_H5_TEST (tstring 0 --enable-error-stack tstr3.h5) - # char data as ASCII with non escape - ADD_H5_TEST (tstring2 0 --enable-error-stack -r -d str4 tstr3.h5) - - # array indices print/not print - ADD_H5_TEST (tindicesyes 0 --enable-error-stack taindices.h5) - ADD_H5_TEST (tindicesno 0 --enable-error-stack -y taindices.h5) - - ########## array indices with subsetting - # 1D case - ADD_H5_TEST (tindicessub1 0 --enable-error-stack -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) - - # 2D case - ADD_H5_TEST (tindicessub2 0 --enable-error-stack -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) - - # 3D case - ADD_H5_TEST (tindicessub3 0 --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) - - # 4D case - ADD_H5_TEST (tindicessub4 0 --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) - - # Exceed the dimensions for subsetting - ADD_H5_TEST (texceedsubstart 1 --enable-error-stack -d 1d -s 1,3 taindices.h5) - ADD_H5_TEST (texceedsubcount 1 --enable-error-stack -d 1d -c 1,3 taindices.h5) - ADD_H5_TEST (texceedsubstride 1 --enable-error-stack -d 1d -S 1,3 taindices.h5) - ADD_H5_TEST (texceedsubblock 1 --enable-error-stack -d 1d -k 1,3 taindices.h5) - - # tests for filters - # SZIP - ADD_H5_TEST (tszip 0 --enable-error-stack -H -p -d szip tfilters.h5) - - # deflate - ADD_H5_TEST (tdeflate 0 --enable-error-stack -H -p -d deflate tfilters.h5) - - # shuffle - ADD_H5_TEST (tshuffle 0 --enable-error-stack -H -p -d shuffle tfilters.h5) - - # fletcher32 - ADD_H5_TEST (tfletcher32 0 --enable-error-stack -H -p -d fletcher32 tfilters.h5) - - # nbit - ADD_H5_TEST (tnbit 0 --enable-error-stack -H -p -d nbit tfilters.h5) - - # scaleoffset - ADD_H5_TEST (tscaleoffset 0 --enable-error-stack -H -p -d scaleoffset tfilters.h5) - - # all - ADD_H5_TEST (tallfilters 0 --enable-error-stack -H -p -d all tfilters.h5) - - # user defined - ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5) - - # test for displaying objects with very long names - ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) - - # dimensions over 4GB, print boundary - ADD_H5_TEST (tbigdims 0 --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5) - - # hyperslab read - ADD_H5_TEST (thyperslab 0 --enable-error-stack thyperslab.h5) - - # test for displaying dataset and attribute of null space - ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) - - # test for displaying dataset and attribute of space with 0 dimension size - ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) - - # test for long double (some systems do not have long double) - #ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5) - - # test for vms - 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 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_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - # the NATIVE test can be validated with h5import/h5diff - ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) - - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - # test for dataset region references - ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) - ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) - ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5) - ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o) - - # tests for group creation order - # "1" tracked, "2" name, root tracked - ADD_H5_TEST (tordergr1 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) - ADD_H5_TEST (tordergr2 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) - ADD_H5_TEST (tordergr3 0 --enable-error-stack -g 2 -q name -z ascending tordergr.h5) - ADD_H5_TEST (tordergr4 0 --enable-error-stack -g 2 -q name -z descending tordergr.h5) - ADD_H5_TEST (tordergr5 0 --enable-error-stack -q creation_order tordergr.h5) - - # tests for attribute order - ADD_H5_TEST (torderattr1 0 --enable-error-stack -H --sort_by=name --sort_order=ascending torderattr.h5) - ADD_H5_TEST (torderattr2 0 --enable-error-stack -H --sort_by=name --sort_order=descending torderattr.h5) - ADD_H5_TEST (torderattr3 0 --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5) - ADD_H5_TEST (torderattr4 0 --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5) - - # tests for link references and order - ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5) - ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5) - - # tests for floating point user defined printf format - ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) - - # tests for traversal of external links - ADD_H5ERR_MASK_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5) - ADD_H5ERR_MASK_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5) - - # test for dangling external links - ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) - - # test for error stack display (BZ2048) - ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5) - - # test for -o -y for dataset with attributes - 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) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5DUMP_PACKED_BITS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tnofilename-with-packed-bits.out - tnofilename-with-packed-bits.out.err - tpbitsArray.out - tpbitsArray.out.err - tpbitsCompound.out - tpbitsCompound.out.err - tpbitsIncomplete.out - tpbitsIncomplete.out.err - tpbitsLengthExceeded.out - tpbitsLengthExceeded.out.err - tpbitsCharLengthExceeded.out - tpbitsCharLengthExceeded.out.err - tpbitsIntLengthExceeded.out - tpbitsIntLengthExceeded.out.err - tpbitsLongLengthExceeded.out - tpbitsLongLengthExceeded.out.err - tpbitsLengthPositive.out - tpbitsLengthPositive.out.err - tpbitsMax.out - tpbitsMax.out.err - tpbitsMaxExceeded.out - tpbitsMaxExceeded.out.err - tpbitsOffsetExceeded.out - tpbitsOffsetExceeded.out.err - tpbitsCharOffsetExceeded.out - tpbitsCharOffsetExceeded.out.err - tpbitsIntOffsetExceeded.out - tpbitsIntOffsetExceeded.out.err - tpbitsLongOffsetExceeded.out - tpbitsLongOffsetExceeded.out.err - tpbitsOffsetNegative.out - tpbitsOffsetNegative.out.err - tpbitsOverlapped.out - tpbitsOverlapped.out.err - tpbitsSigned.out - tpbitsSigned.out.err - tpbitsUnsigned.out - tpbitsUnsigned.out.err - tpbitsSignedInt.out - tpbitsSignedInt.out.err - tpbitsUnsignedInt.out - tpbitsUnsignedInt.out.err - tpbitsSignedLong.out - tpbitsSignedLong.out.err - tpbitsUnsignedLong.out - tpbitsUnsignedLong.out.err - tpbitsSignedLongLong.out - tpbitsSignedLongLong.out.err - tpbitsUnsignedLongLong.out - tpbitsUnsignedLongLong.out.err - tpbitsSignedWhole.out - tpbitsSignedWhole.out.err - tpbitsUnsignedWhole.out - tpbitsUnsignedWhole.out.err - tpbitsSignedIntWhole.out - tpbitsSignedIntWhole.out.err - tpbitsUnsignedIntWhole.out - tpbitsUnsignedIntWhole.out.err - tpbitsSignedLongWhole.out - tpbitsSignedLongWhole.out.err - tpbitsUnsignedLongWhole.out - tpbitsUnsignedLongWhole.out.err - tpbitsSignedLongLongWhole.out - tpbitsSignedLongLongWhole.out.err - tpbitsUnsignedLongLongWhole.out - tpbitsUnsignedLongLongWhole.out.err - tpbitsSignedLongLongWhole1.out - tpbitsSignedLongLongWhole1.out.err - tpbitsUnsignedLongLongWhole1.out - tpbitsUnsignedLongLongWhole1.out.err - tpbitsSignedLongLongWhole63.out - tpbitsSignedLongLongWhole63.out.err - tpbitsUnsignedLongLongWhole63.out - tpbitsUnsignedLongLongWhole63.out.err - tpbitsSigned4.out - tpbitsSigned4.out.err - tpbitsUnsigned4.out - tpbitsUnsigned4.out.err - tpbitsSignedInt8.out - tpbitsSignedInt8.out.err - tpbitsUnsignedInt8.out - tpbitsUnsignedInt8.out.err - tpbitsSignedLong16.out - tpbitsSignedLong16.out.err - tpbitsUnsignedLong16.out - tpbitsUnsignedLong16.out.err - tpbitsSignedLongLong32.out - tpbitsSignedLongLong32.out.err - tpbitsUnsignedLongLong32.out - tpbitsUnsignedLongLong32.out.err - tpbitsSigned2.out - tpbitsSigned2.out.err - tpbitsUnsigned2.out - tpbitsUnsigned2.out.err - tpbitsSignedInt4.out - tpbitsSignedInt4.out.err - tpbitsUnsignedInt4.out - tpbitsUnsignedInt4.out.err - tpbitsSignedLong8.out - tpbitsSignedLong8.out.err - tpbitsUnsignedLong8.out - tpbitsUnsignedLong8.out.err - tpbitsSignedLongLong16.out - tpbitsSignedLongLong16.out.err - tpbitsUnsignedLongLong16.out - tpbitsUnsignedLongLong16.out.err - ) - 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_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). - # Maximun Offset is Maximum size - 1. - # Maximum Offset+Length is Maximum size. - # Tests: - # Normal operation on both signed and unsigned int datasets. - # Sanity check - # Their rawdata output should be the same. - 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_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_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_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_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_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_PBITS_TEST (tpbitsCompound 0 --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5) - # Array type. - 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_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_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_PBITS_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5) - # Bad length, must not be positive. - 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_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_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 - ADD_TEST ( - NAME H5DUMP-XML-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tall.h5.out - tall.h5.out.err - tall-2A.h5.out - tall-2A.h5.out.err - tarray1.h5.out - tarray1.h5.out.err - tarray2.h5.out - tarray2.h5.out.err - tarray3.h5.out - tarray3.h5.out.err - tarray6.h5.out - tarray6.h5.out.err - tarray7.h5.out - tarray7.h5.out.err - tattr.h5.out - tattr.h5.out.err - tbitfields.h5.out - tbitfields.h5.out.err - tcompound.h5.out - tcompound.h5.out.err - tcompound2.h5.out - tcompound2.h5.out.err - tcompound_complex.h5.out - tcompound_complex.h5.out.err - tdatareg.h5.out - tdatareg.h5.out.err - tdset.h5.out - tdset.h5.out.err - tdset2.h5.out - tdset2.h5.out.err - tempty-dtd-2.h5.out - tempty-dtd-2.h5.out.err - tempty-dtd-uri.h5.out - tempty-dtd-uri.h5.out.err - tempty-dtd.h5.out - tempty-dtd.h5.out.err - tempty-nons-2.h5.out - tempty-nons-2.h5.out.err - tempty-nons-uri.h5.out - tempty-nons-uri.h5.out.err - tempty-nons.h5.out - tempty-nons.h5.out.err - tempty-ns-2.h5.out - tempty-ns-2.h5.out.err - tempty-ns.h5.out - tempty-ns.h5.out.err - tempty.h5.out - tempty.h5.out.err - tenum.h5.out - tenum.h5.out.err - textlink.h5.out - textlink.h5.out.err - tfpformat.h5.out - tfpformat.h5.out.err - tgroup.h5.out - tgroup.h5.out.err - thlink.h5.out - thlink.h5.out.err - tloop.h5.out - tloop.h5.out.err - tloop2.h5.out - tloop2.h5.out.err - tmany.h5.out - tmany.h5.out.err - tname-amp.h5.out - tname-amp.h5.out.err - tname-apos.h5.out - tname-apos.h5.out.err - tname-gt.h5.out - tname-gt.h5.out.err - tname-lt.h5.out - tname-lt.h5.out.err - tname-quot.h5.out - tname-quot.h5.out.err - tname-sp.h5.out - tname-sp.h5.out.err - tnamed_dtype_attr.h5.out - tnamed_dtype_attr.h5.out.err - tnestedcomp.h5.out - tnestedcomp.h5.out.err - tnodata.h5.out - tnodata.h5.out.err - tnoname.h5.out - tnoname.h5.out.err - tobjref.h5.out - tobjref.h5.out.err - topaque.h5.out - topaque.h5.out.err - torderattr1.h5.out - torderattr1.h5.out.err - torderattr2.h5.out - torderattr2.h5.out.err - torderattr3.h5.out - torderattr3.h5.out.err - torderattr4.h5.out - torderattr4.h5.out.err - tref-escapes-at.h5.out - tref-escapes-at.h5.out.err - tref-escapes.h5.out - tref-escapes.h5.out.err - tref.h5.out - tref.h5.out.err - tsaf.h5.out - tsaf.h5.out.err - tslink.h5.out - tslink.h5.out.err - tstr.h5.out - tstr.h5.out.err - tstr2.h5.out - tstr2.h5.out.err - tstring.h5.out - tstring.h5.out.err - tstring-at.h5.out - tstring-at.h5.out.err - tudlink.h5.out - tudlink.h5.out.err - tvldtypes1.h5.out - tvldtypes1.h5.out.err - tvldtypes2.h5.out - tvldtypes2.h5.out.err - tvldtypes3.h5.out - tvldtypes3.h5.out.err - tvldtypes4.h5.out - tvldtypes4.h5.out.err - tvldtypes5.h5.out - tvldtypes5.h5.out.err - tvlstr.h5.out - tvlstr.h5.out.err - ) - 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) - - ########## test XML - ADD_XML_H5_TEST (tall.h5 0 tall.h5) - ADD_XML_H5_TEST (tattr.h5 0 tattr.h5) - ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5) - ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5) - ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5) - ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5) - ADD_XML_H5_TEST (tdset.h5 0 tdset.h5) - ADD_XML_H5_TEST (tdset2.h5 0 tdset2.h5) - ADD_XML_H5_TEST (tenum.h5 0 tenum.h5) - ADD_XML_H5_TEST (tgroup.h5 0 tgroup.h5) - ADD_XML_H5_TEST (thlink.h5 0 thlink.h5) - ADD_XML_H5_TEST (tloop.h5 0 tloop.h5) - ADD_XML_H5_TEST (tloop2.h5 0 tloop2.h5) - ADD_XML_H5_TEST (tmany.h5 0 tmany.h5) - ADD_XML_H5_TEST (tnestedcomp.h5 0 tnestedcomp.h5) - ADD_XML_H5_TEST (tcompound_complex.h5 0 tcompound_complex.h5) - ADD_XML_H5_TEST (tobjref.h5 0 tobjref.h5) - ADD_XML_H5_TEST (topaque.h5 0 topaque.h5) - ADD_XML_H5_TEST (tslink.h5 0 tslink.h5) - ADD_XML_H5_TEST (tudlink.h5 0 tudlink.h5) - ADD_XML_H5_TEST (textlink.h5 0 textlink.h5) - ADD_XML_H5_TEST (tstr.h5 0 tstr.h5) - ADD_XML_H5_TEST (tstr2.h5 0 tstr2.h5) - ADD_XML_H5_TEST (tref.h5 0 tref.h5) - ADD_XML_H5_TEST (tname-amp.h5 0 tname-amp.h5) - ADD_XML_H5_TEST (tname-apos.h5 0 tname-apos.h5) - ADD_XML_H5_TEST (tname-gt.h5 0 tname-gt.h5) - ADD_XML_H5_TEST (tname-lt.h5 0 tname-lt.h5) - ADD_XML_H5_TEST (tname-quot.h5 0 tname-quot.h5) - ADD_XML_H5_TEST (tname-sp.h5 0 tname-sp.h5) - ADD_XML_H5_TEST (tstring.h5 0 tstring.h5) - ADD_XML_H5_TEST (tstring-at.h5 0 tstring-at.h5) - ADD_XML_H5_TEST (tref-escapes.h5 0 tref-escapes.h5) - ADD_XML_H5_TEST (tref-escapes-at.h5 0 tref-escapes-at.h5) - ADD_XML_H5_TEST (tnodata.h5 0 tnodata.h5) - ADD_XML_H5_TEST (tarray1.h5 0 tarray1.h5) - ADD_XML_H5_TEST (tarray2.h5 0 tarray2.h5) - ADD_XML_H5_TEST (tarray3.h5 0 tarray3.h5) - ADD_XML_H5_TEST (tarray6.h5 0 tarray6.h5) - ADD_XML_H5_TEST (tarray7.h5 0 tarray7.h5) - ADD_XML_H5_TEST (tvldtypes1.h5 0 tvldtypes1.h5) - ADD_XML_H5_TEST (tvldtypes2.h5 0 tvldtypes2.h5) - ADD_XML_H5_TEST (tvldtypes3.h5 0 tvldtypes3.h5) - ADD_XML_H5_TEST (tvldtypes4.h5 0 tvldtypes4.h5) - ADD_XML_H5_TEST (tvldtypes5.h5 0 tvldtypes5.h5) - ADD_XML_H5_TEST (tvlstr.h5 0 tvlstr.h5) - ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5) - ADD_XML_H5_TEST (tempty.h5 0 tempty.h5) - ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5) - ##Test dataset and attribute of null space. Commented out: - ## wait until the XML schema is updated for null space. - ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5) - ## So is dataspace with 0 dimension size. - ## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5) - - # other options for xml - - ADD_XML_H5_TEST (tempty-dtd.h5 0 --use-dtd tempty.h5) - ADD_XML_H5_TEST (tempty-dtd-2.h5 0 -u tempty.h5) - - # The lone colon here confuses some systems (Cray X1). Skip - # it if configure detects that this is a problem. - SET (TESTTYPE "TEST") - IF (NOT "H5_LONE_COLON") - SET (TESTTYPE "SKIP") - ENDIF (NOT "H5_LONE_COLON") - ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) - - ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) - - ## Some of these combinations are syntactically correct but - ## the URLs are dummies - ADD_XML_H5_TEST (tempty-ns.h5 0 -X thing: tempty.h5) - ADD_XML_H5_TEST (tempty-ns-2.h5 0 --xml-ns=thing: tempty.h5) - ADD_XML_H5_TEST (tempty-nons-uri.h5 0 --xml-ns=: --xml-dtd=http://somewhere.net tempty.h5) - ADD_XML_H5_TEST (tempty-dtd-uri.h5 0 --use-dtd --xml-dtd=http://somewhere.net tempty.h5) - - ADD_XML_H5_TEST (tall-2A.h5 0 -A tall.h5) + INCLUDE (CMakeTests.cmake) - # tests for attribute order - ADD_XML_H5_TEST (torderattr1.h5 0 -H --sort_by=name --sort_order=ascending torderattr.h5) - ADD_XML_H5_TEST (torderattr2.h5 0 -H --sort_by=name --sort_order=descending torderattr.h5) - ADD_XML_H5_TEST (torderattr3.h5 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) - ADD_XML_H5_TEST (torderattr4.h5 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) + INCLUDE (CMakeTestsPBITS.cmake) - # tests for floating point user defined printf format - ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5) - + INCLUDE (CMakeTestsXML.cmake) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/h5dump/CMakeTests.cmake b/tools/h5dump/CMakeTests.cmake new file mode 100644 index 0000000..026b6b2 --- /dev/null +++ b/tools/h5dump/CMakeTests.cmake @@ -0,0 +1,1367 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the test directory into the source directory + # -------------------------------------------------------------------- + SET (HDF5_REFERENCE_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/charsets.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/file_space.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A0.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2B.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-4s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-5s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-6.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-7.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-7N.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tallfilters.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr-4_be.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrcontents2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbin4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tboot2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchunked.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompact.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontents.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcontiguos.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregR.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdeflate.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-3s.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstart.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubcount.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubstride.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texceedsubblock.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/texternal.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfill.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfletcher32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesno.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicessub4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tindicesyes.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tqmarkfile.ddl + #${HDF5_TOOLS_SRC_DIR}/testfiles/tstarfile.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.ddl + ${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/trawssetfile.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr5.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordercontents2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderlinks2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tperror.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/treference.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarattrintsize.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarstring.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscaleoffset.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tshuffle.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-D.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstringe.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tszip.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tuserfilter.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.ddl + ${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 + trawssetfile.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 + ${HDF5_TOOLS_SRC_DIR}/testfiles/filter_fail.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/packedbits.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/taindices.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1_big.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray4.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray5.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray8.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr4_be.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbigdims.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbinary.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tchar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdattrintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcmpdintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.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/tempty.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinkfar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfcontents2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfilters.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfvalues.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thyperslab.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlarge_objname.h5 + #${HDF5_TOOLS_SRC_DIR}/testfiles/tldouble.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tlonglinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-b.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-g.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-l.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-o.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-r.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmulti-s.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcmpddt.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tno-subset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnullspace.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/zerodim.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tordergr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarattrintsize.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tscalarstring.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-m.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsplit_file-r.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr3.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 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvms.h5 + ) + SET (HDF5_ERROR_REFERENCE_TEST_FILES + ${PROJECT_SOURCE_DIR}/errfiles/filter_fail.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-1.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2A0.err + ${PROJECT_SOURCE_DIR}/errfiles/tall-2B.err + ${PROJECT_SOURCE_DIR}/errfiles/tarray1_big.err + ${PROJECT_SOURCE_DIR}/errfiles/tattrregR.err + ${PROJECT_SOURCE_DIR}/errfiles/tattr-3.err + ${PROJECT_SOURCE_DIR}/errfiles/tcomp-3.err + ${PROJECT_SOURCE_DIR}/errfiles/tdataregR.err + ${PROJECT_SOURCE_DIR}/errfiles/tdset-2.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubblock.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubcount.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstart.err + ${PROJECT_SOURCE_DIR}/errfiles/texceedsubstride.err + ${PROJECT_SOURCE_DIR}/errfiles/textlink.err + ${PROJECT_SOURCE_DIR}/errfiles/textlinkfar.err + ${PROJECT_SOURCE_DIR}/errfiles/textlinksrc.err + ${PROJECT_SOURCE_DIR}/errfiles/torderlinks1.err + ${PROJECT_SOURCE_DIR}/errfiles/torderlinks2.err + ${PROJECT_SOURCE_DIR}/errfiles/tgroup-2.err + ${PROJECT_SOURCE_DIR}/errfiles/tperror.err + ${PROJECT_SOURCE_DIR}/errfiles/tslink-D.err + ) + + # make test dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + # + # copy test files from source dir to test dir + # + FOREACH (tst_h5_file ${HDF5_REFERENCE_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_h5_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #MESSAGE (STATUS " Copying ${tst_h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + 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/std/${fname}") + #MESSAGE (STATUS " Copying ${tst_other_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${tst_other_file} ${dest} + ) + ENDFOREACH (tst_other_file ${HDF5_REFERENCE_FILES}) + + FOREACH (tst_error_file ${HDF5_ERROR_REFERENCE_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_error_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/std/${fname}") + #MESSAGE (STATUS " Copying ${tst_error_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${tst_error_file} ${dest} + ) + 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) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_HELP_TEST testname resultcode) + # 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/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-h5dump-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove h5dump-${testname}.out h5dump-${testname}.out.err + ) + 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/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-h5dump-${testname}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_HELP_TEST) + + MACRO (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-${skipresultfile}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile} ${ARGN}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + ADD_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_SKIP_H5_TEST) + + MACRO (ADD_H5_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/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}.bin ${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}" + -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") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) + + MACRO (ADD_H5_TEST_N resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN}) + SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-N-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}-N.bin ${resultfile}-N.out ${resultfile}-N.out.err + ) + SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + ADD_TEST ( + NAME H5DUMP-N-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${resultfile}-N.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST_N 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) + 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 ${resultfile}.txt ${resultfile}.exp + ) + 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-${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/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/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-${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-${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/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/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + 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_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval) + IF (NOT 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/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/std" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_ERRREF=${resultfile}.err" + -D "TEST_MASK_ERROR=true" + -D "TEST_ENV_VAR:STRING=${envvar}" + -D "TEST_ENV_VALUE:STRING=${envval}" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5ERR_MASK_ENV_TEST) + + 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) + +############################################################################## +############################################################################## +### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5dump-help.out + charsets.out + charsets.out.err + file_space.out + file_space.out.err + filter_fail.out + filter_fail.out.err + packedbits.out + packedbits.out.err + tall-1.out + tall-1.out.err + tall-2.out + tall-2.out.err + tall-2A.out + tall-2A.out.err + tall-2A0.out + tall-2A0.out.err + tall-2B.out + tall-2B.out.err + tall-3.out + tall-3.out.err + tall-4s.out + tall-4s.out.err + tall-5s.out + tall-5s.out.err + tall-6.txt + tall-6.out + tall-6.out.err + tall-7.out + tall-7.out.err + tall-7N.out + tall-7N.out.err + tallfilters.out + tallfilters.out.err + tarray1.out + tarray1.out.err + tarray1_big.out + tarray1_big.out.err + tarray2.out + tarray2.out.err + tarray3.out + tarray3.out.err + tarray4.out + tarray4.out.err + tarray5.out + tarray5.out.err + tarray6.out + tarray6.out.err + tarray7.out + tarray7.out.err + tarray8.out + tarray8.out.err + tattr-1.out + tattr-1.out.err + tattr-2.out + tattr-2.out.err + tattr-3.out + tattr-3.out.err + tattr-4_be.out + tattr-4_be.out.err + tattrcontents1.out + tattrcontents1.out.err + tattrcontents2.out + tattrcontents2.out.err + tattrintsize.out + tattrintsize.out.err + tattrreg.out + tattrreg.out.err + tattrregR.out + tattrregR.out.err + tbin1LE.bin + tbinregR.txt + tbinregR.out + tbinregR.out.err + tbigdims.out + tbigdims.out.err + tboot1.out + tboot1.out.err + tboot2.out + tboot2.out.err + tchar1.out + tchar1.out.err + tchunked.out + tchunked.out.err + tcmpdattrintsize.out + tcmpdattrintsize.out.err + tcmpdintsize.out + tcmpdintsize.out.err + tcomp-1.out + tcomp-1.out.err + tcomp-2.out + tcomp-2.out.err + tcomp-3.out + tcomp-3.out.err + tcomp-4.out + tcomp-4.out.err + tcompact.out + tcompact.out.err + tcontents.out + tcontents.out.err + tcontiguos.out + tcontiguos.out.err + tdatareg.out + tdatareg.out.err + tdataregR.out + tdataregR.out.err + tdeflate.out + tdeflate.out.err + tdset-1.out + tdset-1.out.err + tdset-2.out + tdset-2.out.err + tdset-3s.out + tdset-3s.out.err + tempty.out + tempty.out.err + texternal.out + texternal.out.err + textlinksrc.out + textlinksrc.out.err + textlinkfar.out + textlinkfar.out.err + textlink.out + textlink.out.err + tfamily.out + tfamily.out.err + tfill.out + tfill.out.err + tfletcher32.out + tfletcher32.out.err + tfpformat.out + tfpformat.out.err + tgroup-1.out + tgroup-1.out.err + tgroup-2.out + tgroup-2.out.err + tgrp_comments.out + tgrp_comments.out.err + thlink-1.out + thlink-1.out.err + thlink-2.out + thlink-2.out.err + thlink-3.out + thlink-3.out.err + thlink-4.out + thlink-4.out.err + thlink-5.out + thlink-5.out.err + thyperslab.out + thyperslab.out.err + tindicesno.out + tindicesno.out.err + tindicessub1.out + tindicessub1.out.err + tindicessub2.out + tindicessub2.out.err + tindicessub3.out + tindicessub3.out.err + tindicessub4.out + tindicessub4.out.err + texceedsubstart.out + texceedsubstart.out.err + texceedsubcount.out + texceedsubcount.out.err + texceedsubstride.out + texceedsubstride.out.err + texceedsubblock.out + texceedsubblock.out.err + tindicesyes.out + tindicesyes.out.err + tlarge_objname.out + tlarge_objname.out.err + tldouble.out + tldouble.out.err + tlonglinks.out + tlonglinks.out.err + tloop-1.out + tloop-1.out.err + tmulti.out + tmulti.out.err + tmultifile.out + tmultifile.out.err +# tqmarkfile.out +# tqmarkfile.out.err +# tstarfile.out +# tstarfile.out.err + tnamed_dtype_attr.out + tnamed_dtype_attr.out.err + tnestcomp-1.out + tnestcomp-1.out.err + tnestedcmpddt.out + 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 + trawssetfile.out + trawssetfile.out.err + trawssetfile.txt + tno-subset.out + tno-subset.out.err + tnullspace.out + tnullspace.out.err + zerodim.out + zerodim.out.err + tordergr1.out + tordergr1.out.err + tordergr2.out + tordergr2.out.err + tordergr3.out + tordergr3.out.err + tordergr4.out + tordergr4.out.err + tordergr5.out + tordergr5.out.err + torderattr1.out + torderattr1.out.err + torderattr2.out + torderattr2.out.err + torderattr3.out + torderattr3.out.err + torderattr4.out + torderattr4.out.err + tordercontents1.out + tordercontents1.out.err + tordercontents2.out + tordercontents2.out.err + torderlinks1.out + torderlinks1.out.err + torderlinks2.out + torderlinks2.out.err + tperror.out + tperror.out.err + treference.out + treference.out.err + tsaf.out + tsaf.out.err + tscalarintsize.out + tscalarintsize.out.err + tscalarattrintsize.out + tscalarattrintsize.out.err + tscalarstring.out + tscalarstring.out.err + tscaleoffset.out + tscaleoffset.out.err + tshuffle.out + tshuffle.out.err + tslink-1.out + tslink-1.out.err + tslink-2.out + tslink-2.out.err + tslink-D.out + tslink-D.out.err + tsplit_file.out + tsplit_file.out.err + tstr-1.out + tstr-1.out.err + tstr-2.out + tstr-2.out.err + tstr2bin2.txt + tstr2bin6.txt + tstring.out + tstring.out.err + tstring2.out + tstring2.out.err + tstringe.out + tstringe.out.err + tszip.out + tszip.out.err + tudlink-1.out + tudlink-1.out.err + tudlink-2.out + tudlink-2.out.err + tuserfilter.out + tuserfilter.out.err + tvldtypes1.out + tvldtypes1.out.err + tvldtypes2.out + tvldtypes2.out.err + tvldtypes3.out + tvldtypes3.out.err + tvldtypes4.out + tvldtypes4.out.err + tvldtypes5.out + tvldtypes5.out.err + tvlstr.out + tvlstr.out.err + tvms.out + 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/std") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5DUMP-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + 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 (trawssetfile tdset.h5 0 --enable-error-stack -d "/dset1[1,1;;;]" -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) + + # test for signed/unsigned datasets + ADD_H5_TEST (packedbits 0 --enable-error-stack packedbits.h5) + # test for compound signed/unsigned datasets + ADD_H5_TEST (tcmpdintsize 0 --enable-error-stack tcmpdintsize.h5) + # test for signed/unsigned scalar datasets + ADD_H5_TEST (tscalarintsize 0 --enable-error-stack tscalarintsize.h5) + # test for signed/unsigned attributes + ADD_H5_TEST (tattrintsize 0 --enable-error-stack tattrintsize.h5) + # test for compound signed/unsigned attributes + ADD_H5_TEST (tcmpdattrintsize 0 --enable-error-stack tcmpdattrintsize.h5) + # test for signed/unsigned scalar attributes + ADD_H5_TEST (tscalarattrintsize 0 --enable-error-stack tscalarattrintsize.h5) + # test for string scalar dataset and attribute + ADD_H5_TEST (tscalarstring 0 --enable-error-stack tscalarstring.h5) + # test for displaying groups + ADD_H5_TEST (tgroup-1 0 --enable-error-stack tgroup.h5) + # test for displaying the selected groups + ADD_H5ERR_MASK_TEST (tgroup-2 1 --enable-error-stack --group=/g2 --group / -g /y tgroup.h5) + + # test for displaying simple space datasets + ADD_H5_TEST (tdset-1 0 --enable-error-stack tdset.h5) + # test for displaying selected datasets + ADD_H5ERR_MASK_TEST (tdset-2 1 --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5) + + # test for displaying attributes + ADD_H5_TEST (tattr-1 0 --enable-error-stack tattr.h5) + # test for displaying the selected attributes of string type and scalar space + ADD_H5_TEST (tattr-2 0 --enable-error-stack -a /\\\\/attr1 --attribute /attr4 --attribute=/attr5 tattr.h5) + ADD_H5_TEST_N (tattr-2 0 --enable-error-stack -N /\\\\/attr1 --any_path /attr4 --any_path=/attr5 tattr.h5) + # test for header and error messages + ADD_H5ERR_MASK_TEST (tattr-3 1 --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5) + # test for displaying attributes in shared datatype (also in group and dataset) + ADD_H5_TEST (tnamed_dtype_attr 0 --enable-error-stack tnamed_dtype_attr.h5) + # test for displaying at least 9 attributes on root from a be machine + ADD_H5_TEST (tattr-4_be 0 --enable-error-stack tattr4_be.h5) + + # test for displaying soft links and user-defined links + ADD_H5_TEST (tslink-1 0 --enable-error-stack tslink.h5) + ADD_H5_TEST (tudlink-1 0 --enable-error-stack tudlink.h5) + # test for displaying the selected link + ADD_H5_TEST (tslink-2 0 --enable-error-stack -l slink2 tslink.h5) + ADD_H5_TEST_N (tslink-2 0 --enable-error-stack -N slink2 tslink.h5) + ADD_H5_TEST (tudlink-2 0 --enable-error-stack -l udlink2 tudlink.h5) + # test for displaying dangling soft links + ADD_H5ERR_MASK_TEST (tslink-D 0 --enable-error-stack -d /slink1 tslink.h5) + + # tests for hard links + ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5) + ADD_H5_TEST (thlink-2 0 --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5) + ADD_H5_TEST (thlink-3 0 --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5) + ADD_H5_TEST (thlink-4 0 --enable-error-stack -g /g1 thlink.h5) + ADD_H5_TEST_N (thlink-4 0 --enable-error-stack -N /g1 thlink.h5) + ADD_H5_TEST (thlink-5 0 --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5) + ADD_H5_TEST_N (thlink-5 0 --enable-error-stack -N /dset1 -N /g2 -N /g1/dset2 thlink.h5) + + # tests for compound data types + ADD_H5_TEST (tcomp-1 0 --enable-error-stack tcompound.h5) + # test for named data types + ADD_H5_TEST (tcomp-2 0 --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5) + ADD_H5_TEST_N (tcomp-2 0 --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5) + # test for unamed type + ADD_H5ERR_MASK_TEST (tcomp-3 0 "--enable-error-stack;-t;/#6632;-g;/group2;tcompound.h5") + # test complicated compound datatype + ADD_H5_TEST (tcomp-4 0 --enable-error-stack tcompound_complex.h5) + + #test for the nested compound type + ADD_H5_TEST (tnestcomp-1 0 --enable-error-stack tnestedcomp.h5) + ADD_H5_TEST (tnestedcmpddt 0 --enable-error-stack tnestedcmpddt.h5) + + # test for options + ADD_H5ERR_MASK_TEST (tall-1 0 --enable-error-stack tall.h5) + ADD_H5_TEST (tall-2 0 --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5) + ADD_H5_TEST (tall-3 0 --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5) + ADD_H5_TEST_N (tall-3 0 --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5) + ADD_H5_TEST (tall-7 0 --enable-error-stack -a attr1 tall.h5) + ADD_H5_TEST (tall-7N 0 --enable-error-stack -N attr1 tall.h5) + + # test for loop detection + ADD_H5_TEST (tloop-1 0 --enable-error-stack tloop.h5) + + # test for string + ADD_H5_TEST (tstr-1 0 --enable-error-stack tstr.h5) + ADD_H5_TEST (tstr-2 0 --enable-error-stack tstr2.h5) + + # test for file created by Lib SAF team + ADD_H5_TEST (tsaf 0 --enable-error-stack tsaf.h5) + + # test for file with variable length data + ADD_H5_TEST (tvldtypes1 0 --enable-error-stack tvldtypes1.h5) + ADD_H5_TEST (tvldtypes2 0 --enable-error-stack tvldtypes2.h5) + ADD_H5_TEST (tvldtypes3 0 --enable-error-stack tvldtypes3.h5) + ADD_H5_TEST (tvldtypes4 0 --enable-error-stack tvldtypes4.h5) + ADD_H5_TEST (tvldtypes5 0 --enable-error-stack tvldtypes5.h5) + + #test for file with variable length string data + ADD_H5_TEST (tvlstr 0 --enable-error-stack tvlstr.h5) + + # test for files with array data + ADD_H5_TEST (tarray1 0 --enable-error-stack tarray1.h5) + # # added for bug# 2092 - tarray1_big.h5 + ADD_H5ERR_MASK_TEST (tarray1_big 0 --enable-error-stack -R tarray1_big.h5) + ADD_H5_TEST (tarray2 0 --enable-error-stack tarray2.h5) + ADD_H5_TEST (tarray3 0 --enable-error-stack tarray3.h5) + ADD_H5_TEST (tarray4 0 --enable-error-stack tarray4.h5) + ADD_H5_TEST (tarray5 0 --enable-error-stack tarray5.h5) + ADD_H5_TEST (tarray6 0 --enable-error-stack tarray6.h5) + ADD_H5_TEST (tarray7 0 --enable-error-stack tarray7.h5) + ADD_H5_TEST (tarray8 0 --enable-error-stack tarray8.h5) + + # test for wildcards in filename (does not work with cmake) + #ADD_H5_MASK_TEST (tstarfile 0 --enable-error-stack -H -d Dataset1 tarr*.h5) + #ADD_H5_MASK_TEST (tqmarkfile 0 --enable-error-stack -H -d Dataset1 tarray?.h5) + ADD_H5_TEST (tmultifile 0 --enable-error-stack -H -d Dataset1 tarray2.h5 tarray3.h5 tarray4.h5 tarray5.h5 tarray6.h5 tarray7.h5) + + # test for files with empty data + ADD_H5_TEST (tempty 0 --enable-error-stack tempty.h5) + + # test for files with groups that have comments + ADD_H5_TEST (tgrp_comments 0 --enable-error-stack tgrp_comments.h5) + + # test the --filedriver flag + ADD_H5_TEST (tsplit_file 0 --enable-error-stack --filedriver=split tsplit_file) + ADD_H5_TEST (tfamily 0 --enable-error-stack --filedriver=family tfamily%05d.h5) + ADD_H5_TEST (tmulti 0 --enable-error-stack --filedriver=multi tmulti) + + # test for files with group names which reach > 1024 bytes in size + ADD_H5_TEST (tlarge_objname 0 --enable-error-stack -w157 tlarge_objname.h5) + + # test '-A' to suppress data but print attr's + ADD_H5ERR_MASK_TEST (tall-2A 0 --enable-error-stack -A tall.h5) + + # test '-A' to suppress attr's but print data + ADD_H5ERR_MASK_TEST (tall-2A0 0 --enable-error-stack -A 0 tall.h5) + + # test '-r' to print attributes in ASCII instead of decimal + ADD_H5ERR_MASK_TEST (tall-2B 0 --enable-error-stack -A -r tall.h5) + + # test Subsetting + ADD_H5_TEST (tall-4s 0 --enable-error-stack --dataset=/g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1 tall.h5) + ADD_H5_TEST (tall-5s 0 --enable-error-stack -d "/g1/g1.1/dset1.1.2[0;2;10;]" tall.h5) + ADD_H5_TEST (tdset-3s 0 --enable-error-stack -d "/dset1[1,1;;;]" tdset.h5) + ADD_H5_TEST (tno-subset 0 --enable-error-stack --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] it=0 tl=0" tno-subset.h5) + + # test printing characters in ASCII instead of decimal + ADD_H5_TEST (tchar1 0 --enable-error-stack -r tchar.h5) + + # test datatypes in ASCII and UTF8 + ADD_H5_TEST (charsets 0 --enable-error-stack charsets.h5) + + # rev. 2004 + # tests for super block + ADD_H5_TEST (tboot1 0 --enable-error-stack -H -B -d dset tfcontents1.h5) + ADD_H5_TEST (tboot2 0 --enable-error-stack -B tfcontents2.h5) + ADD_H5_TEST (file_space 0 --enable-error-stack -B file_space.h5) + + # test -p with a non existing dataset + ADD_H5ERR_MASK_TEST (tperror 1 --enable-error-stack -p -d bogus tfcontents1.h5) + + # test for file contents + ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5) + ADD_H5_TEST (tordercontents1 0 --enable-error-stack -n --sort_by=name --sort_order=ascending tfcontents1.h5) + ADD_H5_TEST (tordercontents2 0 --enable-error-stack -n --sort_by=name --sort_order=descending tfcontents1.h5) + ADD_H5_TEST (tattrcontents1 0 --enable-error-stack -n 1 --sort_order=ascending tall.h5) + ADD_H5_TEST (tattrcontents2 0 --enable-error-stack -n 1 --sort_order=descending tall.h5) + + # tests for storage layout + # compact + ADD_H5_TEST (tcompact 0 --enable-error-stack -H -p -d compact tfilters.h5) + # contiguous + ADD_H5_TEST (tcontiguos 0 --enable-error-stack -H -p -d contiguous tfilters.h5) + # chunked + ADD_H5_TEST (tchunked 0 --enable-error-stack -H -p -d chunked tfilters.h5) + # external + ADD_H5_TEST (texternal 0 --enable-error-stack -H -p -d external tfilters.h5) + + # fill values + ADD_H5_TEST (tfill 0 --enable-error-stack -p tfvalues.h5) + + # several datatype, with references , print path + ADD_H5_TEST (treference 0 --enable-error-stack tattr2.h5) + + # escape/not escape non printable characters + ADD_H5_TEST (tstringe 0 --enable-error-stack -e tstr3.h5) + ADD_H5_TEST (tstring 0 --enable-error-stack tstr3.h5) + # char data as ASCII with non escape + ADD_H5_TEST (tstring2 0 --enable-error-stack -r -d str4 tstr3.h5) + + # array indices print/not print + ADD_H5_TEST (tindicesyes 0 --enable-error-stack taindices.h5) + ADD_H5_TEST (tindicesno 0 --enable-error-stack -y taindices.h5) + + ########## array indices with subsetting + # 1D case + ADD_H5_TEST (tindicessub1 0 --enable-error-stack -d 1d -s 1 -S 10 -c 2 -k 3 taindices.h5) + + # 2D case + ADD_H5_TEST (tindicessub2 0 --enable-error-stack -d 2d -s 1,2 -S 3,3 -c 3,2 -k 2,2 taindices.h5) + + # 3D case + ADD_H5_TEST (tindicessub3 0 --enable-error-stack -d 3d -s 0,1,2 -S 1,3,3 -c 2,2,2 -k 1,2,2 taindices.h5) + + # 4D case + ADD_H5_TEST (tindicessub4 0 --enable-error-stack -d 4d -s 0,0,1,2 -c 2,2,3,2 -S 1,1,3,3 -k 1,1,2,2 taindices.h5) + + # Exceed the dimensions for subsetting + ADD_H5_TEST (texceedsubstart 1 --enable-error-stack -d 1d -s 1,3 taindices.h5) + ADD_H5_TEST (texceedsubcount 1 --enable-error-stack -d 1d -c 1,3 taindices.h5) + ADD_H5_TEST (texceedsubstride 1 --enable-error-stack -d 1d -S 1,3 taindices.h5) + ADD_H5_TEST (texceedsubblock 1 --enable-error-stack -d 1d -k 1,3 taindices.h5) + + # tests for filters + # SZIP + ADD_H5_TEST (tszip 0 --enable-error-stack -H -p -d szip tfilters.h5) + + # deflate + ADD_H5_TEST (tdeflate 0 --enable-error-stack -H -p -d deflate tfilters.h5) + + # shuffle + ADD_H5_TEST (tshuffle 0 --enable-error-stack -H -p -d shuffle tfilters.h5) + + # fletcher32 + ADD_H5_TEST (tfletcher32 0 --enable-error-stack -H -p -d fletcher32 tfilters.h5) + + # nbit + ADD_H5_TEST (tnbit 0 --enable-error-stack -H -p -d nbit tfilters.h5) + + # scaleoffset + ADD_H5_TEST (tscaleoffset 0 --enable-error-stack -H -p -d scaleoffset tfilters.h5) + + # all + ADD_H5_TEST (tallfilters 0 --enable-error-stack -H -p -d all tfilters.h5) + + # user defined + ADD_H5_TEST (tuserfilter 0 --enable-error-stack -H -p -d myfilter tfilters.h5) + + # test for displaying objects with very long names + ADD_H5_TEST (tlonglinks 0 --enable-error-stack tlonglinks.h5) + + # dimensions over 4GB, print boundary + ADD_H5_TEST (tbigdims 0 --enable-error-stack -d dset4gb -s 4294967284 -c 22 tbigdims.h5) + + # hyperslab read + ADD_H5_TEST (thyperslab 0 --enable-error-stack thyperslab.h5) + + # test for displaying dataset and attribute of null space + ADD_H5_TEST (tnullspace 0 --enable-error-stack tnullspace.h5) + + # test for displaying dataset and attribute of space with 0 dimension size + ADD_H5_TEST (zerodim 0 --enable-error-stack zerodim.h5) + + # test for long double (some systems do not have long double) + #ADD_H5_TEST (tldouble 0 --enable-error-stack tldouble.h5) + + # test for vms + 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 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_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) + + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + # the NATIVE test can be validated with h5import/h5diff + ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) + + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + # test for dataset region references + ADD_H5_TEST (tdatareg 0 --enable-error-stack tdatareg.h5) + ADD_H5ERR_MASK_TEST (tdataregR 0 --enable-error-stack -R tdatareg.h5) + ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5) + ADD_H5_EXPORT_TEST (tbinregR tdatareg.h5 0 --enable-error-stack -d /Dataset1 -s 0 -R -y -o) + + # tests for group creation order + # "1" tracked, "2" name, root tracked + ADD_H5_TEST (tordergr1 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=ascending tordergr.h5) + ADD_H5_TEST (tordergr2 0 --enable-error-stack --group=1 --sort_by=creation_order --sort_order=descending tordergr.h5) + ADD_H5_TEST (tordergr3 0 --enable-error-stack -g 2 -q name -z ascending tordergr.h5) + ADD_H5_TEST (tordergr4 0 --enable-error-stack -g 2 -q name -z descending tordergr.h5) + ADD_H5_TEST (tordergr5 0 --enable-error-stack -q creation_order tordergr.h5) + + # tests for attribute order + ADD_H5_TEST (torderattr1 0 --enable-error-stack -H --sort_by=name --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr2 0 --enable-error-stack -H --sort_by=name --sort_order=descending torderattr.h5) + ADD_H5_TEST (torderattr3 0 --enable-error-stack -H --sort_by=creation_order --sort_order=ascending torderattr.h5) + ADD_H5_TEST (torderattr4 0 --enable-error-stack -H --sort_by=creation_order --sort_order=descending torderattr.h5) + + # tests for link references and order + ADD_H5ERR_MASK_TEST (torderlinks1 0 --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5) + ADD_H5ERR_MASK_TEST (torderlinks2 0 --enable-error-stack --sort_by=name --sort_order=descending tfcontents1.h5) + + # tests for floating point user defined printf format + ADD_H5_TEST (tfpformat 0 --enable-error-stack -m %.7f tfpformat.h5) + + # tests for traversal of external links + ADD_H5ERR_MASK_TEST (textlinksrc 0 --enable-error-stack textlinksrc.h5) + ADD_H5ERR_MASK_TEST (textlinkfar 0 --enable-error-stack textlinkfar.h5) + + # test for dangling external links + ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5) + + # test for error stack display (BZ2048) + ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "HDF5_PLUGIN_PRELOAD" "::" --enable-error-stack filter_fail.h5) + + # test for -o -y for dataset with attributes + ADD_H5_TEST_EXPORT (tall-6 tall.h5 0 --enable-error-stack -d /g1/g1.1/dset1.1.1 -y -o) diff --git a/tools/h5dump/CMakeTestsPBITS.cmake b/tools/h5dump/CMakeTestsPBITS.cmake new file mode 100644 index 0000000..baa1705 --- /dev/null +++ b/tools/h5dump/CMakeTestsPBITS.cmake @@ -0,0 +1,367 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Packed Bits + # -------------------------------------------------------------------- + #-- Copy all the HDF5 files from the test directory into the source directory + SET (HDF5_REFERENCE_PBITS + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnofilename-with-packed-bits.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsArray.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCompound.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIncomplete.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongLengthExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLengthPositive.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMax.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsMaxExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsCharOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsIntOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsLongOffsetExceeded.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOffsetNegative.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsOverlapped.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedIntWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedIntWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole1.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLongWhole63.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLongWhole63.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong16.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLongLong32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLongLong32.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSigned2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsigned2.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedInt4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedInt4.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsSignedLong8.ddl + ${HDF5_TOOLS_SRC_DIR}/testfiles/tpbitsUnsignedLong8.ddl + ${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 + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsCharOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIncomplete.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsIntOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLengthPositive.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongLengthExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsLongOffsetExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsMaxExceeded.err + ${PROJECT_SOURCE_DIR}/errfiles/tpbitsOffsetExceeded.err + ${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/pbits/${fname}") + #MESSAGE (STATUS " Copying ${ddl_pbits}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${ddl_pbits} ${ddldest} + ) + ENDFOREACH (ddl_pbits ${HDF5_REFERENCE_PBITS}) + + FOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + GET_FILENAME_COMPONENT(fname "${ddl_pbits}" NAME) + SET (ddldest "${PROJECT_BINARY_DIR}/testfiles/pbits/${fname}") + #MESSAGE (STATUS " Copying ${ddl_pbits}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${ddl_pbits} ${ddldest} + ) + ENDFOREACH (ddl_pbits ${HDF5_ERROR_REFERENCE_PBITS}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + 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) + +############################################################################## +############################################################################## +### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP_PACKED_BITS-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tnofilename-with-packed-bits.out + tnofilename-with-packed-bits.out.err + tpbitsArray.out + tpbitsArray.out.err + tpbitsCompound.out + tpbitsCompound.out.err + tpbitsIncomplete.out + tpbitsIncomplete.out.err + tpbitsLengthExceeded.out + tpbitsLengthExceeded.out.err + tpbitsCharLengthExceeded.out + tpbitsCharLengthExceeded.out.err + tpbitsIntLengthExceeded.out + tpbitsIntLengthExceeded.out.err + tpbitsLongLengthExceeded.out + tpbitsLongLengthExceeded.out.err + tpbitsLengthPositive.out + tpbitsLengthPositive.out.err + tpbitsMax.out + tpbitsMax.out.err + tpbitsMaxExceeded.out + tpbitsMaxExceeded.out.err + tpbitsOffsetExceeded.out + tpbitsOffsetExceeded.out.err + tpbitsCharOffsetExceeded.out + tpbitsCharOffsetExceeded.out.err + tpbitsIntOffsetExceeded.out + tpbitsIntOffsetExceeded.out.err + tpbitsLongOffsetExceeded.out + tpbitsLongOffsetExceeded.out.err + tpbitsOffsetNegative.out + tpbitsOffsetNegative.out.err + tpbitsOverlapped.out + tpbitsOverlapped.out.err + tpbitsSigned.out + tpbitsSigned.out.err + tpbitsUnsigned.out + tpbitsUnsigned.out.err + tpbitsSignedInt.out + tpbitsSignedInt.out.err + tpbitsUnsignedInt.out + tpbitsUnsignedInt.out.err + tpbitsSignedLong.out + tpbitsSignedLong.out.err + tpbitsUnsignedLong.out + tpbitsUnsignedLong.out.err + tpbitsSignedLongLong.out + tpbitsSignedLongLong.out.err + tpbitsUnsignedLongLong.out + tpbitsUnsignedLongLong.out.err + tpbitsSignedWhole.out + tpbitsSignedWhole.out.err + tpbitsUnsignedWhole.out + tpbitsUnsignedWhole.out.err + tpbitsSignedIntWhole.out + tpbitsSignedIntWhole.out.err + tpbitsUnsignedIntWhole.out + tpbitsUnsignedIntWhole.out.err + tpbitsSignedLongWhole.out + tpbitsSignedLongWhole.out.err + tpbitsUnsignedLongWhole.out + tpbitsUnsignedLongWhole.out.err + tpbitsSignedLongLongWhole.out + tpbitsSignedLongLongWhole.out.err + tpbitsUnsignedLongLongWhole.out + tpbitsUnsignedLongLongWhole.out.err + tpbitsSignedLongLongWhole1.out + tpbitsSignedLongLongWhole1.out.err + tpbitsUnsignedLongLongWhole1.out + tpbitsUnsignedLongLongWhole1.out.err + tpbitsSignedLongLongWhole63.out + tpbitsSignedLongLongWhole63.out.err + tpbitsUnsignedLongLongWhole63.out + tpbitsUnsignedLongLongWhole63.out.err + tpbitsSigned4.out + tpbitsSigned4.out.err + tpbitsUnsigned4.out + tpbitsUnsigned4.out.err + tpbitsSignedInt8.out + tpbitsSignedInt8.out.err + tpbitsUnsignedInt8.out + tpbitsUnsignedInt8.out.err + tpbitsSignedLong16.out + tpbitsSignedLong16.out.err + tpbitsUnsignedLong16.out + tpbitsUnsignedLong16.out.err + tpbitsSignedLongLong32.out + tpbitsSignedLongLong32.out.err + tpbitsUnsignedLongLong32.out + tpbitsUnsignedLongLong32.out.err + tpbitsSigned2.out + tpbitsSigned2.out.err + tpbitsUnsigned2.out + tpbitsUnsigned2.out.err + tpbitsSignedInt4.out + tpbitsSignedInt4.out.err + tpbitsUnsignedInt4.out + tpbitsUnsignedInt4.out.err + tpbitsSignedLong8.out + tpbitsSignedLong8.out.err + tpbitsUnsignedLong8.out + tpbitsUnsignedLong8.out.err + tpbitsSignedLongLong16.out + tpbitsSignedLongLong16.out.err + tpbitsUnsignedLongLong16.out + tpbitsUnsignedLongLong16.out.err + ) + 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_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). + # Maximun Offset is Maximum size - 1. + # Maximum Offset+Length is Maximum size. + # Tests: + # Normal operation on both signed and unsigned int datasets. + # Sanity check + # Their rawdata output should be the same. + 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_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_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_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_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_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_PBITS_TEST (tpbitsCompound 0 --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5) + # Array type. + 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_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_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_PBITS_TEST (tpbitsOffsetNegative 1 --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5) + # Bad length, must not be positive. + 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_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_PBITS_TEST (tpbitsIncomplete 1 --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5) diff --git a/tools/h5dump/CMakeTestsXML.cmake b/tools/h5dump/CMakeTestsXML.cmake new file mode 100644 index 0000000..6c9cae1 --- /dev/null +++ b/tools/h5dump/CMakeTestsXML.cmake @@ -0,0 +1,442 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # + # 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 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5 + ${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 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2A.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray6.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray7.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tbitfields.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound_complex.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-dtd-uri.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-nons-uri.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty-ns-2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tenum.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfpformat.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmany.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-amp.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-apos.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnamed_dtype_attr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-gt.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-lt.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-quot.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tname-sp.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnodata.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tobjref.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/topaque.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/torderattr4.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tref-escapes-at.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstring-at.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes3.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes4.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes5.h5.xml + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvlstr.h5.xml + ) + + 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/xml/${fname}") + #MESSAGE (STATUS " Copying ${tst_xml_h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${tst_xml_h5_file} ${dest} + ) + ENDFOREACH (tst_xml_h5_file ${HDF5_XML_REFERENCE_TEST_FILES}) + + FOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + GET_FILENAME_COMPONENT(fname "${tst_xml_other_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/xml/${fname}") + #MESSAGE (STATUS " Copying ${tst_xml_other_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5dump + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${tst_xml_other_file} ${dest} + ) + ENDFOREACH (tst_xml_other_file ${HDF5_XML_REFERENCE_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5DUMP-XML-${skipresultfile}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${skipresultfile}.xml --xml ${ARGN}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + ADD_XML_H5_TEST (${skipresultfile} ${skipresultcode} ${ARGN}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_XML_SKIP_H5_TEST) + + 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/xml") + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5DUMP-XML-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + 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-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + 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/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-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_XML_H5_TEST file) + +############################################################################## +############################################################################## +### T H E T E S T S HDF5_ENABLE_USING_MEMCHECKER ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5DUMP-XML-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tall.h5.out + tall.h5.out.err + tall-2A.h5.out + tall-2A.h5.out.err + tarray1.h5.out + tarray1.h5.out.err + tarray2.h5.out + tarray2.h5.out.err + tarray3.h5.out + tarray3.h5.out.err + tarray6.h5.out + tarray6.h5.out.err + tarray7.h5.out + tarray7.h5.out.err + tattr.h5.out + tattr.h5.out.err + tbitfields.h5.out + tbitfields.h5.out.err + tcompound.h5.out + tcompound.h5.out.err + tcompound2.h5.out + tcompound2.h5.out.err + tcompound_complex.h5.out + tcompound_complex.h5.out.err + tdatareg.h5.out + tdatareg.h5.out.err + tdset.h5.out + tdset.h5.out.err + tdset2.h5.out + tdset2.h5.out.err + tempty-dtd-2.h5.out + tempty-dtd-2.h5.out.err + tempty-dtd-uri.h5.out + tempty-dtd-uri.h5.out.err + tempty-dtd.h5.out + tempty-dtd.h5.out.err + tempty-nons-2.h5.out + tempty-nons-2.h5.out.err + tempty-nons-uri.h5.out + tempty-nons-uri.h5.out.err + tempty-nons.h5.out + tempty-nons.h5.out.err + tempty-ns-2.h5.out + tempty-ns-2.h5.out.err + tempty-ns.h5.out + tempty-ns.h5.out.err + tempty.h5.out + tempty.h5.out.err + tenum.h5.out + tenum.h5.out.err + textlink.h5.out + textlink.h5.out.err + tfpformat.h5.out + tfpformat.h5.out.err + tgroup.h5.out + tgroup.h5.out.err + thlink.h5.out + thlink.h5.out.err + tloop.h5.out + tloop.h5.out.err + tloop2.h5.out + tloop2.h5.out.err + tmany.h5.out + tmany.h5.out.err + tname-amp.h5.out + tname-amp.h5.out.err + tname-apos.h5.out + tname-apos.h5.out.err + tname-gt.h5.out + tname-gt.h5.out.err + tname-lt.h5.out + tname-lt.h5.out.err + tname-quot.h5.out + tname-quot.h5.out.err + tname-sp.h5.out + tname-sp.h5.out.err + tnamed_dtype_attr.h5.out + tnamed_dtype_attr.h5.out.err + tnestedcomp.h5.out + tnestedcomp.h5.out.err + tnodata.h5.out + tnodata.h5.out.err + tnoname.h5.out + tnoname.h5.out.err + tobjref.h5.out + tobjref.h5.out.err + topaque.h5.out + topaque.h5.out.err + torderattr1.h5.out + torderattr1.h5.out.err + torderattr2.h5.out + torderattr2.h5.out.err + torderattr3.h5.out + torderattr3.h5.out.err + torderattr4.h5.out + torderattr4.h5.out.err + tref-escapes-at.h5.out + tref-escapes-at.h5.out.err + tref-escapes.h5.out + tref-escapes.h5.out.err + tref.h5.out + tref.h5.out.err + tsaf.h5.out + tsaf.h5.out.err + tslink.h5.out + tslink.h5.out.err + tstr.h5.out + tstr.h5.out.err + tstr2.h5.out + tstr2.h5.out.err + tstring.h5.out + tstring.h5.out.err + tstring-at.h5.out + tstring-at.h5.out.err + tudlink.h5.out + tudlink.h5.out.err + tvldtypes1.h5.out + tvldtypes1.h5.out.err + tvldtypes2.h5.out + tvldtypes2.h5.out.err + tvldtypes3.h5.out + tvldtypes3.h5.out.err + tvldtypes4.h5.out + tvldtypes4.h5.out.err + tvldtypes5.h5.out + tvldtypes5.h5.out.err + tvlstr.h5.out + tvlstr.h5.out.err + ) + 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) + + ########## test XML + ADD_XML_H5_TEST (tall.h5 0 tall.h5) + ADD_XML_H5_TEST (tattr.h5 0 tattr.h5) + ADD_XML_H5_TEST (tbitfields.h5 0 tbitfields.h5) + ADD_XML_H5_TEST (tcompound.h5 0 tcompound.h5) + ADD_XML_H5_TEST (tcompound2.h5 0 tcompound2.h5) + ADD_XML_H5_TEST (tdatareg.h5 0 tdatareg.h5) + ADD_XML_H5_TEST (tdset.h5 0 tdset.h5) + ADD_XML_H5_TEST (tdset2.h5 0 tdset2.h5) + ADD_XML_H5_TEST (tenum.h5 0 tenum.h5) + ADD_XML_H5_TEST (tgroup.h5 0 tgroup.h5) + ADD_XML_H5_TEST (thlink.h5 0 thlink.h5) + ADD_XML_H5_TEST (tloop.h5 0 tloop.h5) + ADD_XML_H5_TEST (tloop2.h5 0 tloop2.h5) + ADD_XML_H5_TEST (tmany.h5 0 tmany.h5) + ADD_XML_H5_TEST (tnestedcomp.h5 0 tnestedcomp.h5) + ADD_XML_H5_TEST (tcompound_complex.h5 0 tcompound_complex.h5) + ADD_XML_H5_TEST (tobjref.h5 0 tobjref.h5) + ADD_XML_H5_TEST (topaque.h5 0 topaque.h5) + ADD_XML_H5_TEST (tslink.h5 0 tslink.h5) + ADD_XML_H5_TEST (tudlink.h5 0 tudlink.h5) + ADD_XML_H5_TEST (textlink.h5 0 textlink.h5) + ADD_XML_H5_TEST (tstr.h5 0 tstr.h5) + ADD_XML_H5_TEST (tstr2.h5 0 tstr2.h5) + ADD_XML_H5_TEST (tref.h5 0 tref.h5) + ADD_XML_H5_TEST (tname-amp.h5 0 tname-amp.h5) + ADD_XML_H5_TEST (tname-apos.h5 0 tname-apos.h5) + ADD_XML_H5_TEST (tname-gt.h5 0 tname-gt.h5) + ADD_XML_H5_TEST (tname-lt.h5 0 tname-lt.h5) + ADD_XML_H5_TEST (tname-quot.h5 0 tname-quot.h5) + ADD_XML_H5_TEST (tname-sp.h5 0 tname-sp.h5) + ADD_XML_H5_TEST (tstring.h5 0 tstring.h5) + ADD_XML_H5_TEST (tstring-at.h5 0 tstring-at.h5) + ADD_XML_H5_TEST (tref-escapes.h5 0 tref-escapes.h5) + ADD_XML_H5_TEST (tref-escapes-at.h5 0 tref-escapes-at.h5) + ADD_XML_H5_TEST (tnodata.h5 0 tnodata.h5) + ADD_XML_H5_TEST (tarray1.h5 0 tarray1.h5) + ADD_XML_H5_TEST (tarray2.h5 0 tarray2.h5) + ADD_XML_H5_TEST (tarray3.h5 0 tarray3.h5) + ADD_XML_H5_TEST (tarray6.h5 0 tarray6.h5) + ADD_XML_H5_TEST (tarray7.h5 0 tarray7.h5) + ADD_XML_H5_TEST (tvldtypes1.h5 0 tvldtypes1.h5) + ADD_XML_H5_TEST (tvldtypes2.h5 0 tvldtypes2.h5) + ADD_XML_H5_TEST (tvldtypes3.h5 0 tvldtypes3.h5) + ADD_XML_H5_TEST (tvldtypes4.h5 0 tvldtypes4.h5) + ADD_XML_H5_TEST (tvldtypes5.h5 0 tvldtypes5.h5) + ADD_XML_H5_TEST (tvlstr.h5 0 tvlstr.h5) + ADD_XML_H5_TEST (tsaf.h5 0 tsaf.h5) + ADD_XML_H5_TEST (tempty.h5 0 tempty.h5) + ADD_XML_H5_TEST (tnamed_dtype_attr.h5 0 tnamed_dtype_attr.h5) + ##Test dataset and attribute of null space. Commented out: + ## wait until the XML schema is updated for null space. + ## ADD_XML_H5_TEST (tnullspace.h5 0 tnulspace.h5) + ## So is dataspace with 0 dimension size. + ## ADD_XML_H5_TEST (zerodim.h5 0 zerodim.h5) + + # other options for xml + + ADD_XML_H5_TEST (tempty-dtd.h5 0 --use-dtd tempty.h5) + ADD_XML_H5_TEST (tempty-dtd-2.h5 0 -u tempty.h5) + + # The lone colon here confuses some systems (Cray X1). Skip + # it if configure detects that this is a problem. + SET (TESTTYPE "TEST") + IF (NOT "H5_LONE_COLON") + SET (TESTTYPE "SKIP") + ENDIF (NOT "H5_LONE_COLON") + ADD_XML_SKIP_H5_TEST (tempty-nons.h5 0 ${TESTTYPE} -X : tempty.h5) + + ADD_XML_H5_TEST (tempty-nons-2.h5 0 --xml-ns=: tempty.h5) + + ## Some of these combinations are syntactically correct but + ## the URLs are dummies + ADD_XML_H5_TEST (tempty-ns.h5 0 -X thing: tempty.h5) + ADD_XML_H5_TEST (tempty-ns-2.h5 0 --xml-ns=thing: tempty.h5) + ADD_XML_H5_TEST (tempty-nons-uri.h5 0 --xml-ns=: --xml-dtd=http://somewhere.net tempty.h5) + ADD_XML_H5_TEST (tempty-dtd-uri.h5 0 --use-dtd --xml-dtd=http://somewhere.net tempty.h5) + + ADD_XML_H5_TEST (tall-2A.h5 0 -A tall.h5) + + + # tests for attribute order + ADD_XML_H5_TEST (torderattr1.h5 0 -H --sort_by=name --sort_order=ascending torderattr.h5) + ADD_XML_H5_TEST (torderattr2.h5 0 -H --sort_by=name --sort_order=descending torderattr.h5) + ADD_XML_H5_TEST (torderattr3.h5 0 -H --sort_by=creation_order --sort_order=ascending torderattr.h5) + ADD_XML_H5_TEST (torderattr4.h5 0 -H --sort_by=creation_order --sort_order=descending torderattr.h5) + + # tests for floating point user defined printf format + ADD_XML_H5_TEST (tfpformat.h5 0 -u -m %.7f tfpformat.h5) + diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 9b304bd..ea38c61 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:A*q:z:m:RECM:O*"; +static const char *s_opts = "hn*peyBHirVa:c:d:f:g:k:l:t:w:xD:uX:o*b*F:s:S:A*q:z:m:RECM:O*N:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "hel", no_arg, 'h' }, @@ -188,6 +188,7 @@ static struct long_options l_opts[] = { { "packed-bits", require_arg, 'M' }, { "no-compact-subset", no_arg, 'C' }, { "ddl", optional_arg, 'O' }, + { "any_path", require_arg, 'N' }, { NULL, 0, '\0' } }; @@ -230,57 +231,63 @@ usage(const char *prog) 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, " -V, --version Print version number and exit\n"); + PRINTVALSTREAM(rawoutstream, "--------------- File Options ---------------\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, " Optional value 0 suppresses printing 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, " -f D, --filedriver=D Specify which driver to open the file with\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, " -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, "--------------- Object Options ---------------\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, " -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P\n"); + PRINTVALSTREAM(rawoutstream, " P can be the absolute path or just a relative path.\n"); + PRINTVALSTREAM(rawoutstream, " -A, --onlyattr Print the header and value of attributes\n"); + PRINTVALSTREAM(rawoutstream, " Optional value 0 suppresses printing attributes.\n"); + PRINTVALSTREAM(rawoutstream, "--------------- Object Property Options ---------------\n"); + PRINTVALSTREAM(rawoutstream, " -i, --object-ids Print the object ids\n"); + PRINTVALSTREAM(rawoutstream, " -p, --properties Print dataset filters, storage layout and fill value\n"); + PRINTVALSTREAM(rawoutstream, " -M L, --packedbits=L Print packed bits as unsigned integers, using mask\n"); + PRINTVALSTREAM(rawoutstream, " format L for an integer dataset specified with\n"); + PRINTVALSTREAM(rawoutstream, " option -d. L is a list of offset,length values,\n"); + PRINTVALSTREAM(rawoutstream, " separated by commas. Offset is the beginning bit in\n"); + PRINTVALSTREAM(rawoutstream, " the data value and length is the number of bits of\n"); + PRINTVALSTREAM(rawoutstream, " the mask.\n"); + PRINTVALSTREAM(rawoutstream, " -R, --region Print dataset pointed by region references\n"); + PRINTVALSTREAM(rawoutstream, "--------------- Formatting Options ---------------\n"); + PRINTVALSTREAM(rawoutstream, " -e, --escape Escape non printing characters\n"); + PRINTVALSTREAM(rawoutstream, " -r, --string Print 1-byte integer datasets as ASCII\n"); + PRINTVALSTREAM(rawoutstream, " -y, --noindex Do not print array indices with the data\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" - " separated by commas. Offset is the beginning bit in\n" - " the data value and length is the number of bits of\n" - " the mask.\n" - ); - PRINTVALSTREAM(rawoutstream, " -R, --region Print dataset pointed by region references\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, " -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, "--------------- XML Options ---------------\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 Options ---------------\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"); @@ -296,20 +303,13 @@ usage(const char *prog) 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, "--------------- Option Argument Conventions ---------------\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, " See examples below for family, split, and multi driver special file name usage.\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"); @@ -324,7 +324,7 @@ usage(const char *prog) 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, "--------------- Examples ---------------\n"); PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " 1) Attribute foo of the group /bar_none in file quux.h5\n"); PRINTVALSTREAM(rawoutstream, "\n"); @@ -355,6 +355,14 @@ usage(const char *prog) PRINTVALSTREAM(rawoutstream, "\n"); PRINTVALSTREAM(rawoutstream, " h5dump -d /foo -f split splitfile\n"); PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " h5dump -d /foo -f multi mf\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5\n"); + PRINTVALSTREAM(rawoutstream, "\n"); + PRINTVALSTREAM(rawoutstream, " h5dump -d /foo -f family fam%%05d.h5\n"); + PRINTVALSTREAM(rawoutstream, "\n"); } @@ -481,172 +489,6 @@ table_list_free(void) } /* end table_list_free() */ /*------------------------------------------------------------------------- - * Function: set_data_output_file - * - * Purpose: Open fname as the output file for dataset raw data. - * Set rawdatastream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed - * - * Programmer: Albert Cheng, 2000/09/30 - * - * Modifications: - * pvn June, 1, 2006. Add a switch for binary output - * - *------------------------------------------------------------------------- - */ -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 */ - - if (rawdatastream && rawdatastream != stdout) { - if (HDfclose(rawdatastream)) - HDperror("closing rawdatastream"); - else - rawdatastream = NULL; - } - - /* 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) { - rawattrstream = f; - retvalue = SUCCEED; - } - } - else { - rawattrstream = NULL; - retvalue = SUCCEED; - } - - return retvalue; -} - -/*------------------------------------------------------------------------- - * Function: set_output_file - * - * Purpose: Open fname as the output file for raw output. - * Set rawoutstream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed - * - *------------------------------------------------------------------------- - */ -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 */ - - if (rawoutstream && rawoutstream != stdout) { - if (HDfclose(rawoutstream)) - HDperror("closing rawoutstream"); - else - rawoutstream = NULL; - } - /* 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 retvalue; -} - -/*------------------------------------------------------------------------- - * Function: set_error_file - * - * Purpose: Open fname as the error output file for dataset raw error. - * Set rawerrorstream as its file stream. - * - * Return: 0 -- succeeded - * negative -- failed - * - *------------------------------------------------------------------------- - */ -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 */ - - if (rawerrorstream && rawerrorstream != stderr) { - if (HDfclose(rawerrorstream)) - HDperror("closing rawerrorstream"); - else - rawerrorstream = NULL; - } - - if ((f = HDfopen(fname, "w")) != NULL) { - rawerrorstream = f; - retvalue = SUCCEED; - } - - return retvalue; -} - -/*------------------------------------------------------------------------- * Function: set_binary_form * * Purpose: set the binary form of output by translating from a string input @@ -1119,6 +961,18 @@ parse_start: } last_was_dset = FALSE; break; + case 'N': + display_all = 0; + + for (i = 0; i < argc; i++) + if (!hand[i].func) { + hand[i].func = handle_paths; + hand[i].obj = HDstrdup(opt_arg); + break; + } + + last_was_dset = FALSE; + break; case 'a': display_all = 0; @@ -1186,7 +1040,7 @@ parse_start: break; case 'O': - if (set_output_file(opt_arg) < 0) { + if (h5tools_set_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1194,20 +1048,20 @@ parse_start: case 'o': if ( bin_output ) { - if (set_data_output_file(opt_arg, 1) < 0) { + if (h5tools_set_data_output_file(opt_arg, 1) < 0) { usage(h5tools_getprogname()); goto error; } } else { if(display_attr_data && !display_data) { - if (set_attr_output_file(opt_arg, 0) < 0) { + if (h5tools_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) { + if (h5tools_set_data_output_file(opt_arg, 0) < 0) { usage(h5tools_getprogname()); goto error; } @@ -1229,7 +1083,7 @@ parse_start: } bin_output = TRUE; if (outfname!=NULL) { - if (set_data_output_file(outfname, 1) < 0) { + if (h5tools_set_data_output_file(outfname, 1) < 0) { /* failed to set output file */ usage(h5tools_getprogname()); goto error; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index a9a23a5..380eb8e 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -24,6 +24,20 @@ #include "h5dump_extern.h" #include "h5dump_ddl.h" +typedef struct { + hid_t fid; /* File ID being traversed */ + char *op_name; /* Object name wanted */ +} trav_handle_udata_t; + +typedef struct { + char *path; /* Path of object being searched */ + char *op_name; /* Object name wanted */ +} trav_attr_udata_t; + +/* callback function used by H5Literate() */ +static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); +static int dump_extlink(hid_t group, const char *linkname, const char *objname); + /*------------------------------------------------------------------------- * Function: dump_datatype * @@ -134,7 +148,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo outputformat = &string_dataformat; h5dump_type_table = type_table; - h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char); h5dump_type_table = NULL; if(attr_id < 0) { @@ -145,6 +159,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo return ret; } + /*------------------------------------------------------------------------- * Function: dump_all_cb * @@ -166,7 +181,7 @@ dump_attr_cb(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *info, vo * *------------------------------------------------------------------------- */ -herr_t +static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void UNUSED *op_data) { hid_t obj; @@ -1179,9 +1194,9 @@ dump_fcpl(hid_t fid) indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s %u\n","OBJECTHEADER_VERSION", finfo.sohm.version); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream,"%s %Hd\n","OFFSET_SIZE", (long long)off_size); + PRINTSTREAM(rawoutstream,"%s %zu\n","OFFSET_SIZE", off_size); indentation(dump_indent + COL); - PRINTSTREAM(rawoutstream,"%s %Hd\n","LENGTH_SIZE", (long long)len_size); + PRINTSTREAM(rawoutstream,"%s %zu\n","LENGTH_SIZE", len_size); indentation(dump_indent + COL); PRINTSTREAM(rawoutstream, "%s %u\n","BTREE_RANK", sym_ik); indentation(dump_indent + COL); @@ -1288,6 +1303,200 @@ dump_fcontents(hid_t fid) PRINTSTREAM(rawoutstream, " %s\n",END); } +static herr_t +attr_search(hid_t oid, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *_op_data) +{ + herr_t ret = SUCCEED; + int i; + int j; + int k; + char *obj_op_name; + char *obj_name; + trav_attr_udata_t *attr_data = (trav_attr_udata_t*)_op_data; + char *buf = attr_data->path; + char *op_name = attr_data->op_name; + + j = (int)HDstrlen(op_name) - 1; + /* find the last / */ + while(j >= 0) { + if (op_name[j] == '/' && (j==0 || (j>0 && op_name[j-1]!='\\'))) + break; + j--; + } + + obj_op_name = h5tools_str_replace(op_name + j + 1, "\\/", "/"); + + if(obj_op_name == NULL) { + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + if(HDstrcmp(attr_name, obj_op_name)==0) { + /* object name */ + i = (int)HDstrlen(buf); + j = (int)HDstrlen(op_name); + k = (size_t)i + 1 + (size_t)j + 1 + 2; + obj_name = (char *)HDmalloc((size_t)k); + if(obj_name == NULL) { + h5tools_setstatus(EXIT_FAILURE); + ret = FAIL; + } + else { + HDmemset(obj_name, '\0', (size_t)k); + if(op_name[0] != '/') { + HDstrncat(obj_name, buf, (size_t)i + 1); + if(buf[i-1] != '/') + HDstrncat(obj_name, "/", 2); + } + HDstrncat(obj_name, op_name, (size_t)j + 1); + + handle_attributes(oid, obj_name, NULL, 0, NULL); + HDfree(obj_name); + } + } + HDfree(obj_op_name); + } + return ret; +} /* end attr_search() */ + +static herr_t +obj_search(const char *path, const H5O_info_t *oi, const char UNUSED *already_visited, void *_op_data) +{ + trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data; + char *op_name = (char*)handle_data->op_name; + + trav_attr_udata_t attr_data; + attr_data.path = (char*)path; + attr_data.op_name = op_name; + H5Aiterate_by_name(handle_data->fid, path, H5_INDEX_NAME, H5_ITER_INC, NULL, attr_search, (void*)&attr_data, H5P_DEFAULT); + + if(HDstrcmp(path, op_name)==0) { + switch(oi->type) { + case H5O_TYPE_GROUP: + handle_groups(handle_data->fid, path, NULL, 0, NULL); + break; + case H5O_TYPE_DATASET: + handle_datasets(handle_data->fid, path, NULL, 0, NULL); + break; + case H5O_TYPE_NAMED_DATATYPE: + handle_datatypes(handle_data->fid, path, NULL, 0, NULL); + break; + case H5O_TYPE_UNKNOWN: + case H5O_TYPE_NTYPES: + default: + error_msg("unknown object type value\n"); + h5tools_setstatus(EXIT_FAILURE); + } /* end switch */ + } + + return 0; +} /* end obj_search() */ + +static herr_t +lnk_search(const char *path, const H5L_info_t *li, void *_op_data) +{ + int search_len; + int k; + char *search_name; + trav_handle_udata_t *handle_data = (trav_handle_udata_t*)_op_data; + char *op_name = (char*)handle_data->op_name; + + search_len = HDstrlen(op_name); + if(search_len > 0 && op_name[0] != '/') { + k = 2; + } + else + k = 1; + search_name = (char *)HDmalloc(search_len + k); + if(search_name == NULL) { + error_msg("creating temporary link\n"); + h5tools_setstatus(EXIT_FAILURE); + } + else { + if (k == 2) { + HDstrcpy(search_name, "/"); + HDstrncat(search_name, op_name, (size_t)search_len + 1); + } + else + HDstrncpy(search_name, op_name, (size_t)search_len + 1); + search_name[search_len + k - 1] = '\0'; + + if(HDstrcmp(path, search_name) == 0) { + switch(li->type) { + case H5L_TYPE_SOFT: + case H5L_TYPE_EXTERNAL: + handle_links(handle_data->fid, op_name, NULL, 0, NULL); + break; + + case H5L_TYPE_HARD: + case H5L_TYPE_MAX: + case H5L_TYPE_ERROR: + default: + error_msg("unknown link type value\n"); + h5tools_setstatus(EXIT_FAILURE); + break; + } /* end switch() */ + } + HDfree(search_name); + } + return 0; +} /* end lnk_search() */ + +/*------------------------------------------------------------------------- + * Function: handle_paths + * + * Purpose: Handle objects from the command. + * + * Return: void + * + *------------------------------------------------------------------------- + */ +void +handle_paths(hid_t fid, const char *path_name, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name) +{ + hid_t gid = -1; + + if((gid = H5Gopen2(fid, "/", H5P_DEFAULT)) < 0) { + error_msg("unable to open root group\n"); + h5tools_setstatus(EXIT_FAILURE); + } + else { + hid_t gcpl_id; + unsigned crt_order_flags; + unsigned attr_crt_order_flags; + trav_handle_udata_t handle_udata; /* User data for traversal */ + + if ((gcpl_id = H5Gget_create_plist(gid)) < 0) { + error_msg("error in getting group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties for attributes */ + if (H5Pget_attr_creation_order(gcpl_id, &attr_crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + /* query the group creation properties */ + if(H5Pget_link_creation_order(gcpl_id, &crt_order_flags) < 0) { + error_msg("error in getting group creation properties\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + if(H5Pclose(gcpl_id) < 0) { + error_msg("error in closing group creation property list ID\n"); + h5tools_setstatus(EXIT_FAILURE); + } + + handle_udata.fid = fid; + handle_udata.op_name = (char*)path_name; + if(h5trav_visit(fid, "/", TRUE, TRUE, obj_search, lnk_search, &handle_udata) < 0) { + error_msg("error traversing information\n"); + h5tools_setstatus(EXIT_FAILURE); + } + } +} + /*------------------------------------------------------------------------- * Function: handle_attributes * @@ -1363,7 +1572,6 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe attr_name = h5tools_str_replace(attr + j + 1, "\\/", "/"); - /* handle error case: cannot open the object with the attribute */ if((oid = H5Oopen(fid, obj_name, H5P_DEFAULT)) < 0) { /* setup */ @@ -1405,7 +1613,7 @@ handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe attr_data_output = display_attr_data; h5dump_type_table = type_table; - h5tools_dump_attribute(rawoutstream, outputformat, &ctx, oid, attr_name, attr_id, display_ai, display_char); + h5tools_dump_attribute(rawoutstream, outputformat, &ctx, attr_name, attr_id, display_ai, display_char); h5dump_type_table = NULL; if(attr_id < 0) { @@ -1840,9 +2048,8 @@ handle_datatypes(hid_t fid, const char *type, void UNUSED * data, int pe, const * *------------------------------------------------------------------------- */ - - -static int dump_extlink(hid_t group, const char *linkname, const char *objname) +static int +dump_extlink(hid_t group, const char *linkname, const char *objname) { hid_t oid; H5O_info_t oi; diff --git a/tools/h5dump/h5dump_ddl.h b/tools/h5dump/h5dump_ddl.h index c769194..c4f4638 100644 --- a/tools/h5dump/h5dump_ddl.h +++ b/tools/h5dump/h5dump_ddl.h @@ -12,13 +12,10 @@ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + #ifndef H5DUMP_DDL_H__ #define H5DUMP_DDL_H__ -/* callback function used by H5Literate() */ -static herr_t dump_all_cb(hid_t group, const char *name, const H5L_info_t *linfo, void *op_data); -static int dump_extlink(hid_t group, const char *linkname, const char *objname); - #ifdef __cplusplus extern "C" { #endif @@ -37,6 +34,7 @@ void dump_fcontents(hid_t fid); /* callback function used by H5Aiterate2() */ herr_t dump_attr_cb(hid_t loc_id, const char *attr_name, const H5A_info_t *info, void *_op_data); +void handle_paths(hid_t fid, const char *path_name, void *data, int pe, const char *display_name); void handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *display_name); void handle_attributes(hid_t fid, const char *attr, void UNUSED * data, int UNUSED pe, const char UNUSED *display_name); void handle_groups(hid_t fid, const char *group, void UNUSED *data, int pe, const char *display_name); diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 28264e7..f3fefba 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -26,6 +26,88 @@ const char *xmlnsprefix="hdf5:"; +/* + * Alternative formating for data dumped to XML + * In general, the numbers are the same, but separators + * except spaces are not used. + * + * Some of these are not used, as some kinds of data are + * dumped in completely new subroutines. + * + * Some of this formatting may yet need to change. + * + * This table only affects XML output. + */ +static h5tool_format_t xml_dataformat = { + 0, /*raw */ + + "", /*fmt_raw */ + "%d", /*fmt_int */ + "%u", /*fmt_uint */ + "%hhd", /*fmt_schar */ + "%u", /*fmt_uchar */ + "%d", /*fmt_short */ + "%u", /*fmt_ushort */ + "%ld", /*fmt_long */ + "%lu", /*fmt_ulong */ + NULL, /*fmt_llong */ + NULL, /*fmt_ullong */ + "%g", /*fmt_double */ + "%g", /*fmt_float */ + + 0, /*ascii */ + 0, /*str_locale */ + 0, /*str_repeat */ + + "", /*arr_pre */ + "", /*arr_sep */ + "", /*arr_suf */ + 1, /*arr_linebreak */ + + "", /*cmpd_name */ + "", /*cmpd_sep */ + "", /*cmpd_pre */ + "", /*cmpd_suf */ + "", /*cmpd_end */ + + " ", /*vlen_sep */ + " ", /*vlen_pre */ + "", /*vlen_suf */ + "", /*vlen_end */ + + "%s", /*elmt_fmt */ + "", /*elmt_suf1 */ + " ", /*elmt_suf2 */ + + "", /*idx_n_fmt */ + "", /*idx_sep */ + "", /*idx_fmt */ + + 80, /*line_ncols *//*standard default columns */ + 0, /*line_per_line */ + "", /*line_pre */ + "%s", /*line_1st */ + "%s", /*line_cont */ + "", /*line_suf */ + "", /*line_sep */ + 1, /*line_multi_new */ + " ", /*line_indent */ + + 1, /*skip_first */ + + 1, /*obj_hidefileno */ + " "H5_PRINTF_HADDR_FMT, /*obj_format */ + + 1, /*dset_hidefileno */ + "DATASET %s ", /*dset_format */ + "%s", /*dset_blockformat_pre */ + "%s", /*dset_ptformat_pre */ + "%s", /*dset_ptformat */ + 0, /*array indices */ + 0 /*escape non printable characters */ +}; + + /* internal functions */ static int xml_name_to_XID(const char *, char *, int , int ); @@ -38,7 +120,7 @@ static char *xml_escape_the_string(const char *, int); static char *xml_escape_the_name(const char *); /*------------------------------------------------------------------------- - * Function: dump_all_cb + * Function: xml_dump_all_cb * * Purpose: function callback called by H5Literate, * displays everything in the specified object @@ -1782,7 +1864,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU int ndims; int i; int status = -1; - int stdindent = COL; /* should be 3 */ void *buf = NULL; hsize_t curr_pos = 0; /* total data element position */ h5tools_str_t buffer; /* string into which to render */ diff --git a/tools/h5dump/h5dump_xml.h b/tools/h5dump/h5dump_xml.h index 258fd38..c1d6c62 100644 --- a/tools/h5dump/h5dump_xml.h +++ b/tools/h5dump/h5dump_xml.h @@ -17,87 +17,6 @@ extern const char *xmlnsprefix; -/* - * Alternative formating for data dumped to XML - * In general, the numbers are the same, but separators - * except spaces are not used. - * - * Some of these are not used, as some kinds of data are - * dumped in completely new subroutines. - * - * Some of this formatting may yet need to change. - * - * This table only affects XML output. - */ -static h5tool_format_t xml_dataformat = { - 0, /*raw */ - - "", /*fmt_raw */ - "%d", /*fmt_int */ - "%u", /*fmt_uint */ - "%hhd", /*fmt_schar */ - "%u", /*fmt_uchar */ - "%d", /*fmt_short */ - "%u", /*fmt_ushort */ - "%ld", /*fmt_long */ - "%lu", /*fmt_ulong */ - NULL, /*fmt_llong */ - NULL, /*fmt_ullong */ - "%g", /*fmt_double */ - "%g", /*fmt_float */ - - 0, /*ascii */ - 0, /*str_locale */ - 0, /*str_repeat */ - - "", /*arr_pre */ - "", /*arr_sep */ - "", /*arr_suf */ - 1, /*arr_linebreak */ - - "", /*cmpd_name */ - "", /*cmpd_sep */ - "", /*cmpd_pre */ - "", /*cmpd_suf */ - "", /*cmpd_end */ - - " ", /*vlen_sep */ - " ", /*vlen_pre */ - "", /*vlen_suf */ - "", /*vlen_end */ - - "%s", /*elmt_fmt */ - "", /*elmt_suf1 */ - " ", /*elmt_suf2 */ - - "", /*idx_n_fmt */ - "", /*idx_sep */ - "", /*idx_fmt */ - - 80, /*line_ncols *//*standard default columns */ - 0, /*line_per_line */ - "", /*line_pre */ - "%s", /*line_1st */ - "%s", /*line_cont */ - "", /*line_suf */ - "", /*line_sep */ - 1, /*line_multi_new */ - " ", /*line_indent */ - - 1, /*skip_first */ - - 1, /*obj_hidefileno */ - " "H5_PRINTF_HADDR_FMT, /*obj_format */ - - 1, /*dset_hidefileno */ - "DATASET %s ", /*dset_format */ - "%s", /*dset_blockformat_pre */ - "%s", /*dset_ptformat_pre */ - "%s", /*dset_ptformat */ - 0, /*array indices */ - 0 /*escape non printable characters */ -}; - #ifdef __cplusplus extern "C" { #endif diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index ac74637..71b1e65 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -3421,14 +3421,19 @@ static void gent_array8(void) H5P_DEFAULT); if(dset>=0) status = H5Dwrite (dset, filetype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + HDassert(status >= 0); } /* * Close and release resources. */ status = H5Dclose (dset); + HDassert(status >= 0); status = H5Sclose (space); + HDassert(status >= 0); status = H5Tclose (filetype); + HDassert(status >= 0); status = H5Fclose (file); + HDassert(status >= 0); } static void gent_empty(void) @@ -7397,14 +7402,17 @@ gent_charsets(void) sid = H5Screate_simple( 1, dim, NULL ); fid = H5Fcreate( FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); status = H5Tset_cset( ascii_dtid, H5T_CSET_ASCII ); + HDassert(status >= 0); H5Tinsert( charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_ ), ascii_dtid ); status = H5Tset_cset( utf8_dtid, H5T_CSET_UTF8 ); + HDassert(status >= 0); H5Tinsert( charset_dtid, "utf8", HOFFSET( CharSetInfo, utf8_p_ ), utf8_dtid ); did = H5Dcreate2( fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT ); status = H5Dwrite( did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData ); + HDassert(status >= 0); H5Tclose( charset_dtid ); H5Tclose( ascii_dtid ); @@ -7415,7 +7423,7 @@ gent_charsets(void) } static void gent_compound_intsizes(void) { - hid_t fid, dataset, space, root; + hid_t fid, dataset, space; hsize_t dims[2]; hsize_t array_dim8[]={F70_XDIM,F70_YDIM8}; /* Array dimensions */ hsize_t array_dim16[]={F70_XDIM,F70_YDIM16}; /* Array dimensions */ @@ -7992,7 +8000,6 @@ static void gent_nested_compound_dt(void) { /* test nested data type */ dset3_t dset3[10]; enumtype dset4[] = {RED, GREEN, BLUE, GREEN, WHITE, BLUE}; - dset1_t dset5[10]; int i, j, k; unsigned ndims; diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 0e3cfda..77a0113 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -182,6 +182,8 @@ $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/tall-7.ddl +$SRC_H5DUMP_TESTFILES/tall-7N.ddl $SRC_H5DUMP_TESTFILES/tallfilters.ddl $SRC_H5DUMP_TESTFILES/tarray1.ddl $SRC_H5DUMP_TESTFILES/tarray1_big.ddl @@ -912,6 +914,7 @@ TOOLTEST4 tdset-2.ddl --enable-error-stack -H -d dset1 -d /dset2 --dataset=dset3 TOOLTEST tattr-1.ddl --enable-error-stack tattr.h5 # test for displaying the selected attributes of string type and scalar space TOOLTEST tattr-2.ddl --enable-error-stack -a "/\/attr1" --attribute /attr4 --attribute=/attr5 tattr.h5 +TOOLTEST tattr-2.ddl --enable-error-stack -N "/\/attr1" --any_path /attr4 --any_path=/attr5 tattr.h5 # test for header and error messages TOOLTEST4 tattr-3.ddl --enable-error-stack --header -a /attr2 --attribute=/attr tattr.h5 # test for displaying at least 9 attributes on root from a BE machine @@ -924,6 +927,7 @@ TOOLTEST tslink-1.ddl --enable-error-stack tslink.h5 TOOLTEST tudlink-1.ddl --enable-error-stack tudlink.h5 # test for displaying the selected link TOOLTEST tslink-2.ddl --enable-error-stack -l slink2 tslink.h5 +TOOLTEST tslink-2.ddl --enable-error-stack -N slink2 tslink.h5 TOOLTEST tudlink-2.ddl --enable-error-stack -l udlink2 tudlink.h5 # test for displaying dangling soft links TOOLTEST4 tslink-D.ddl --enable-error-stack -d /slink1 tslink.h5 @@ -933,12 +937,15 @@ TOOLTEST thlink-1.ddl --enable-error-stack thlink.h5 TOOLTEST thlink-2.ddl --enable-error-stack -d /g1/dset2 --dataset /dset1 --dataset=/g1/g1.1/dset3 thlink.h5 TOOLTEST thlink-3.ddl --enable-error-stack -d /g1/g1.1/dset3 --dataset /g1/dset2 --dataset=/dset1 thlink.h5 TOOLTEST thlink-4.ddl --enable-error-stack -g /g1 thlink.h5 +TOOLTEST thlink-4.ddl --enable-error-stack -N /g1 thlink.h5 TOOLTEST thlink-5.ddl --enable-error-stack -d /dset1 -g /g2 -d /g1/dset2 thlink.h5 +TOOLTEST thlink-5.ddl --enable-error-stack -N /dset1 -N /g2 -N /g1/dset2 thlink.h5 # tests for compound data types TOOLTEST tcomp-1.ddl --enable-error-stack tcompound.h5 # test for named data types TOOLTEST tcomp-2.ddl --enable-error-stack -t /type1 --datatype /type2 --datatype=/group1/type3 tcompound.h5 +TOOLTEST tcomp-2.ddl --enable-error-stack -N /type1 --any_path /type2 --any_path=/group1/type3 tcompound.h5 # test for unamed type TOOLTEST4 tcomp-3.ddl --enable-error-stack -t /#6632 -g /group2 tcompound.h5 # test complicated compound datatype @@ -952,6 +959,9 @@ TOOLTEST tnestedcmpddt.ddl --enable-error-stack tnestedcmpddt.h5 TOOLTEST4 tall-1.ddl --enable-error-stack tall.h5 TOOLTEST tall-2.ddl --enable-error-stack --header -g /g1/g1.1 -a attr2 tall.h5 TOOLTEST tall-3.ddl --enable-error-stack -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5 +TOOLTEST tall-3.ddl --enable-error-stack -N /g2/dset2.1 -N /g1/g1.2/g1.2.1/slink tall.h5 +TOOLTEST tall-7.ddl --enable-error-stack -a attr1 tall.h5 +TOOLTEST tall-7N.ddl --enable-error-stack -N attr1 tall.h5 # test for loop detection TOOLTEST tloop-1.ddl --enable-error-stack tloop.h5 diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 94dd69c..7caf44a 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -18,12 +18,6 @@ SET_TARGET_PROPERTIES (h5import PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5import) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5import executables @@ -34,476 +28,7 @@ IF (BUILD_TESTING) TARGET_LINK_LIBRARIES (h5importtest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5importtest PROPERTIES FOLDER tools) - SET (HDF5_REFERENCE_CONF_FILES - binfp64.conf - binin8.conf - binin8w.conf - binin16.conf - binin32.conf - binuin16.conf - binuin32.conf - txtfp32.conf - txtfp64.conf - txtin8.conf - txtin16.conf - txtin32.conf - txtuin16.conf - txtuin32.conf - textpfe.conf - txtstr.conf - ) - SET (HDF5_REFERENCE_TXT_FILES - txtfp32.txt - txtfp64.txt - txtuin16.txt - txtuin32.txt - txtin8.txt - txtin16.txt - txtin32.txt - textpfe64.txt - txtstr.txt - dbinfp64.h5.txt - dbinin8.h5.txt - dbinin8w.h5.txt - dbinin16.h5.txt - dbinin32.h5.txt - dbinuin16.h5.txt - dbinuin32.h5.txt - dtxtstr.h5.txt - ) - SET (HDF5_REFERENCE_TEST_FILES - binfp64.h5 - binin8.h5 - binin8w.h5 - binin16.h5 - binin32.h5 - binuin16.h5 - binuin32.h5 - txtfp32.h5 - txtfp64.h5 - txtin8.h5 - txtin16.h5 - txtin32.h5 - txtuin16.h5 - txtuin32.h5 - txtstr.h5 - textpfe.h5 - ) - - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") - #MESSAGE (STATUS " Copying ${conf_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5import - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} - ) - ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) - - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5import - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} - ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5import - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} - ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - MACRO (ADD_H5_TEST testname importfile conffile testfile) - # If using memchecker skip macro based tests - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ) - - ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) - SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) - - ADD_TEST ( - NAME H5IMPORT-${testname}-H5DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}.new" - -D "TEST_EXPECT=0" - -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) - ADD_TEST ( - NAME H5IMPORT-${testname}-H5DMP_CMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=testfiles/${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testfile}.out" - -D "TEST_EXPECT=0" - -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_REFERENCE=${testfile}.new" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) - - MACRO (ADD_H5_DUMPTEST testname datasetname testfile) - # If using memchecker skip tests - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - d${testfile} - d${testfile}.bin - d${testfile}.imp - d${testfile}.imp.err - d${testfile}.dmp - d${testfile}.dmp.err - d${testfile}.dff - d${testfile}.dff.err - ) - - IF ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=d${testfile}.dmp" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - ELSE ("${ARGN}" STREQUAL "BINARY") - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=d${testfile}.dmp" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - ENDIF ("${ARGN}" STREQUAL "BINARY") - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") - - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5import>" - -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=d${testfile}.imp" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") - - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-H5DFF - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" - -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=d${testfile}.dff" - -D "TEST_EXPECT=0" - -D "TEST_FILTER=(^(Warning)[^\n]*)" - -D "TEST_REFERENCE=testfiles/d${testfile}.txt" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) - - MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5IMPORT-DUMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) - - # -------------------------------------------------------------------- - # Determine if filter is available for h5diff - # -------------------------------------------------------------------- - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5IMPORT-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - binfp64.bin - binin8.bin - binin8w.bin - binin16.bin - binin32.bin - binuin16.bin - binuin32.bin - txtin32.h5 - txtin32.h5.new - txtin32.h5.new.err - txtin32.h5.out - txtin32.h5.out.err - txtin16.h5 - txtin16.h5.new - txtin16.h5.new.err - txtin16.h5.out - txtin16.h5.out.err - txtin8.h5 - txtin8.h5.new - txtin8.h5.new.err - txtin8.h5.out - txtin8.h5.out.err - txtuin16.h5 - txtuin16.h5.new - txtuin16.h5.new.err - txtuin16.h5.out - txtuin16.h5.out.err - txtuin32.h5 - txtuin32.h5.new - txtuin32.h5.new.err - txtuin32.h5.out - txtuin32.h5.out.err - txtfp32.h5 - txtfp32.h5.new - txtfp32.h5.new.err - txtfp32.h5.out - txtfp32.h5.out.err - txtfp64.h5 - txtfp64.h5.new - txtfp64.h5.new.err - txtfp64.h5.out - txtfp64.h5.out.err - binfp64.h5 - binfp64.h5.new - binfp64.h5.new.err - binfp64.h5.out - binfp64.h5.out.err - binin8.h5 - binin8.h5.new - binin8.h5.new.err - binin8.h5.out - binin8.h5.out.err - binin8w.h5 - binin8w.h5.new - binin8w.h5.new.err - binin8w.h5.out - binin8w.h5.out.err - binin16.h5 - binin16.h5.new - binin16.h5.new.err - binin16.h5.out - binin16.h5.out.err - binin32.h5 - binin32.h5.new - binin32.h5.new.err - binin32.h5.out - binin32.h5.out.err - binuin16.h5 - binuin16.h5.new - binuin16.h5.new.err - binuin16.h5.out - binuin16.h5.out.err - binuin32.h5 - binuin32.h5.new - binuin32.h5.new.err - binuin32.h5.out - binuin32.h5.out.err - txtstr.h5 - txtstr.h5.new - txtstr.h5.new.err - txtstr.h5.out - txtstr.h5.out.err - textpfe.h5 - textpfe.h5.new - textpfe.h5.new.err - textpfe.h5.out - textpfe.h5.out.err - dbinfp64.h5 - dbinfp64.h5.bin - dbinfp64.h5.imp - dbinfp64.h5.imp.err - dbinfp64.h5.dmp - dbinfp64.h5.dmp.err - dbinfp64.h5.dff - dbinfp64.h5.dff.err - dbinin8.h5 - dbinin8.h5.bin - dbinin8.h5.imp - dbinin8.h5.imp.err - dbinin8.h5.dmp - dbinin8.h5.dmp.err - dbinin8.h5.dff - dbinin8.h5.dff.err - dbinin8w.h5 - dbinin8w.h5.bin - dbinin8w.h5.imp - dbinin8w.h5.imp.err - dbinin8w.h5.dmp - dbinin8w.h5.dmp.err - dbinin8w.h5.dff - dbinin8w.h5.dff.err - dbinin16.h5 - dbinin16.h5.bin - dbinin16.h5.imp - dbinin16.h5.imp.err - dbinin16.h5.dmp - dbinin16.h5.dmp.err - dbinin16.h5.dff - dbinin16.h5.dff.err - dbinin32.h5 - dbinin32.h5.bin - dbinin32.h5.imp - dbinin32.h5.imp.err - dbinin32.h5.dmp - dbinin32.h5.dmp.err - dbinin32.h5.dff - dbinin32.h5.dff.err - dbinuin16.h5 - dbinuin16.h5.bin - dbinuin16.h5.imp - dbinuin16.h5.imp.err - dbinuin16.h5.dmp - dbinuin16.h5.dmp.err - dbinuin16.h5.dff - dbinuin16.h5.dff.err - dbinuin32.h5 - dbinuin32.h5.bin - dbinuin32.h5.imp - dbinuin32.h5.imp.err - dbinuin32.h5.dmp - dbinuin32.h5.dmp.err - dbinuin32.h5.dff - dbinuin32.h5.dff.err - dtxtstr.h5 - dtxtstr.h5.bin - dtxtstr.h5.imp - dtxtstr.h5.imp.err - dtxtstr.h5.dmp - dtxtstr.h5.dmp.err - dtxtstr.h5.dff - dtxtstr.h5.dff.err - ) - SET (last_test "H5IMPORT-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - - # ----- TESTING "ASCII I32 rank 3 - Output BE " ; - ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) - - # ----- TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" - ADD_H5_TEST (ASCII_I16 testfiles/txtin16.txt testfiles/txtin16.conf txtin16.h5) - - # ----- TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " - ADD_H5_TEST (ASCII_I8 testfiles/txtin8.txt testfiles/txtin8.conf txtin8.h5) - - # ----- TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " - ADD_H5_TEST (ASCII_UI16 testfiles/txtuin16.txt testfiles/txtuin16.conf txtuin16.h5) - - # ----- TESTING "ASCII UI32 - rank 3 - Output BE" - ADD_H5_TEST (ASCII_UI32 testfiles/txtuin32.txt testfiles/txtuin32.conf txtuin32.h5) - - # ----- TESTING "ASCII F32 - rank 3 - Output LE " - ADD_H5_TEST (ASCII_F32 testfiles/txtfp32.txt testfiles/txtfp32.conf txtfp32.h5) - - # ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " - ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5) - - # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " - ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) - IF (NOT USE_FILTER_DEFLATE) - ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) - ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) - - # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) - IF (NOT USE_FILTER_DEFLATE) - ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ELSE (NOT USE_FILTER_DEFLATE) - ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) - ENDIF (NOT USE_FILTER_DEFLATE) - - # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) - ADD_H5_DUMPTEST (BINARY_I16 "/int/bin/16-bit" binin16.h5 BINARY) - - # ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " - ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/binin32.conf binin32.h5) - ADD_H5_DUMPTEST (BINARY_I32 "/int/bin/32-bit" binin32.h5 BINARY) - - # ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " - ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5) - ADD_H5_DUMPTEST (BINARY_UI16 "/int/buin/16-bit" binuin16.h5 BINARY) - - # ----- TESTING "BINARY UI32 - rank 3 - Output LE " - ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5) - ADD_H5_DUMPTEST (BINARY_UI32 "/int/buin/32-bit" binuin32.h5 BINARY) - - # ----- TESTING "STR" - ADD_H5_TEST (STR testfiles/txtstr.txt testfiles/txtstr.conf txtstr.h5) - ADD_H5_DUMPTEST (STR "/mytext/data" txtstr.h5) - - # ----- TESTING "BINARY I8 CR LF EOF" - ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5) - ADD_H5_DUMPTEST (BINARY_I8_EOF "/dataset0" binin8w.h5 BINARY) - - # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " - ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) diff --git a/tools/h5import/CMakeTests.cmake b/tools/h5import/CMakeTests.cmake new file mode 100644 index 0000000..cb76204 --- /dev/null +++ b/tools/h5import/CMakeTests.cmake @@ -0,0 +1,478 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + SET (HDF5_REFERENCE_CONF_FILES + binfp64.conf + binin8.conf + binin8w.conf + binin16.conf + binin32.conf + binuin16.conf + binuin32.conf + txtfp32.conf + txtfp64.conf + txtin8.conf + txtin16.conf + txtin32.conf + txtuin16.conf + txtuin32.conf + textpfe.conf + txtstr.conf + ) + SET (HDF5_REFERENCE_TXT_FILES + txtfp32.txt + txtfp64.txt + txtuin16.txt + txtuin32.txt + txtin8.txt + txtin16.txt + txtin32.txt + textpfe64.txt + txtstr.txt + dbinfp64.h5.txt + dbinin8.h5.txt + dbinin8w.h5.txt + dbinin16.h5.txt + dbinin32.h5.txt + dbinuin16.h5.txt + dbinuin32.h5.txt + dtxtstr.h5.txt + ) + SET (HDF5_REFERENCE_TEST_FILES + binfp64.h5 + binin8.h5 + binin8w.h5 + binin16.h5 + binin32.h5 + binuin16.h5 + binuin32.h5 + txtfp32.h5 + txtfp64.h5 + txtin8.h5 + txtin16.h5 + txtin32.h5 + txtuin16.h5 + txtuin32.h5 + txtstr.h5 + textpfe.h5 + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${conf_file}") + #MESSAGE (STATUS " Copying ${conf_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5import + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${conf_file} ${dest} + ) + ENDFOREACH (conf_file ${HDF5_REFERENCE_CONF_FILES}) + + FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #MESSAGE (STATUS " Copying ${txt_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5import + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${txt_file} ${dest} + ) + ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5import + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + MACRO (ADD_H5_TEST testname importfile conffile testfile) + # If using memchecker skip macro based tests + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ) + + ADD_TEST (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import> ${importfile} -c ${conffile} -o ${testfile}) + SET_TESTS_PROPERTIES (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) + + ADD_TEST ( + NAME H5IMPORT-${testname}-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testfile}.new" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(HDF5)[^\n]*)" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) + ADD_TEST ( + NAME H5IMPORT-${testname}-H5DMP_CMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testfile}.out" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(HDF5)[^\n]*)" + -D "TEST_REFERENCE=${testfile}.new" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST testname importfile conffile testfile) + + MACRO (ADD_H5_DUMPTEST testname datasetname testfile) + # If using memchecker skip tests + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + d${testfile} + d${testfile}.bin + d${testfile}.imp + d${testfile}.imp.err + d${testfile}.dmp + d${testfile}.dmp.err + d${testfile}.dff + d${testfile}.dff.err + ) + + IF ("${ARGN}" STREQUAL "BINARY") + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ELSE ("${ARGN}" STREQUAL "BINARY") + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF ("${ARGN}" STREQUAL "BINARY") + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5import>" + -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.imp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") + + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-H5DFF + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>" + -D "TEST_ARGS:STRING=-v;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d${testfile}.dff" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(Warning)[^\n]*)" + -D "TEST_REFERENCE=testfiles/d${testfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_DUMPTEST testname datasetname testfile) + + MACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5IMPORT-DUMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname} ${datasetname} ${testfile} --- DEFLATE filter not available" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) + + # -------------------------------------------------------------------- + # Determine if filter is available for h5diff + # -------------------------------------------------------------------- + IF (H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_DEFLATE "true") + ENDIF (H5_HAVE_FILTER_DEFLATE) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5IMPORT-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + binfp64.bin + binin8.bin + binin8w.bin + binin16.bin + binin32.bin + binuin16.bin + binuin32.bin + txtin32.h5 + txtin32.h5.new + txtin32.h5.new.err + txtin32.h5.out + txtin32.h5.out.err + txtin16.h5 + txtin16.h5.new + txtin16.h5.new.err + txtin16.h5.out + txtin16.h5.out.err + txtin8.h5 + txtin8.h5.new + txtin8.h5.new.err + txtin8.h5.out + txtin8.h5.out.err + txtuin16.h5 + txtuin16.h5.new + txtuin16.h5.new.err + txtuin16.h5.out + txtuin16.h5.out.err + txtuin32.h5 + txtuin32.h5.new + txtuin32.h5.new.err + txtuin32.h5.out + txtuin32.h5.out.err + txtfp32.h5 + txtfp32.h5.new + txtfp32.h5.new.err + txtfp32.h5.out + txtfp32.h5.out.err + txtfp64.h5 + txtfp64.h5.new + txtfp64.h5.new.err + txtfp64.h5.out + txtfp64.h5.out.err + binfp64.h5 + binfp64.h5.new + binfp64.h5.new.err + binfp64.h5.out + binfp64.h5.out.err + binin8.h5 + binin8.h5.new + binin8.h5.new.err + binin8.h5.out + binin8.h5.out.err + binin8w.h5 + binin8w.h5.new + binin8w.h5.new.err + binin8w.h5.out + binin8w.h5.out.err + binin16.h5 + binin16.h5.new + binin16.h5.new.err + binin16.h5.out + binin16.h5.out.err + binin32.h5 + binin32.h5.new + binin32.h5.new.err + binin32.h5.out + binin32.h5.out.err + binuin16.h5 + binuin16.h5.new + binuin16.h5.new.err + binuin16.h5.out + binuin16.h5.out.err + binuin32.h5 + binuin32.h5.new + binuin32.h5.new.err + binuin32.h5.out + binuin32.h5.out.err + txtstr.h5 + txtstr.h5.new + txtstr.h5.new.err + txtstr.h5.out + txtstr.h5.out.err + textpfe.h5 + textpfe.h5.new + textpfe.h5.new.err + textpfe.h5.out + textpfe.h5.out.err + dbinfp64.h5 + dbinfp64.h5.bin + dbinfp64.h5.imp + dbinfp64.h5.imp.err + dbinfp64.h5.dmp + dbinfp64.h5.dmp.err + dbinfp64.h5.dff + dbinfp64.h5.dff.err + dbinin8.h5 + dbinin8.h5.bin + dbinin8.h5.imp + dbinin8.h5.imp.err + dbinin8.h5.dmp + dbinin8.h5.dmp.err + dbinin8.h5.dff + dbinin8.h5.dff.err + dbinin8w.h5 + dbinin8w.h5.bin + dbinin8w.h5.imp + dbinin8w.h5.imp.err + dbinin8w.h5.dmp + dbinin8w.h5.dmp.err + dbinin8w.h5.dff + dbinin8w.h5.dff.err + dbinin16.h5 + dbinin16.h5.bin + dbinin16.h5.imp + dbinin16.h5.imp.err + dbinin16.h5.dmp + dbinin16.h5.dmp.err + dbinin16.h5.dff + dbinin16.h5.dff.err + dbinin32.h5 + dbinin32.h5.bin + dbinin32.h5.imp + dbinin32.h5.imp.err + dbinin32.h5.dmp + dbinin32.h5.dmp.err + dbinin32.h5.dff + dbinin32.h5.dff.err + dbinuin16.h5 + dbinuin16.h5.bin + dbinuin16.h5.imp + dbinuin16.h5.imp.err + dbinuin16.h5.dmp + dbinuin16.h5.dmp.err + dbinuin16.h5.dff + dbinuin16.h5.dff.err + dbinuin32.h5 + dbinuin32.h5.bin + dbinuin32.h5.imp + dbinuin32.h5.imp.err + dbinuin32.h5.dmp + dbinuin32.h5.dmp.err + dbinuin32.h5.dff + dbinuin32.h5.dff.err + dtxtstr.h5 + dtxtstr.h5.bin + dtxtstr.h5.imp + dtxtstr.h5.imp.err + dtxtstr.h5.dmp + dtxtstr.h5.dmp.err + dtxtstr.h5.dff + dtxtstr.h5.dff.err + ) + SET (last_test "H5IMPORT-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5IMPORT-h5importtest PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + + # ----- TESTING "ASCII I32 rank 3 - Output BE " ; + ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) + + # ----- TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" + ADD_H5_TEST (ASCII_I16 testfiles/txtin16.txt testfiles/txtin16.conf txtin16.h5) + + # ----- TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " + ADD_H5_TEST (ASCII_I8 testfiles/txtin8.txt testfiles/txtin8.conf txtin8.h5) + + # ----- TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " + ADD_H5_TEST (ASCII_UI16 testfiles/txtuin16.txt testfiles/txtuin16.conf txtuin16.h5) + + # ----- TESTING "ASCII UI32 - rank 3 - Output BE" + ADD_H5_TEST (ASCII_UI32 testfiles/txtuin32.txt testfiles/txtuin32.conf txtuin32.h5) + + # ----- TESTING "ASCII F32 - rank 3 - Output LE " + ADD_H5_TEST (ASCII_F32 testfiles/txtfp32.txt testfiles/txtfp32.conf txtfp32.h5) + + # ----- TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " + ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5) + + # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " + ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) + IF (NOT USE_FILTER_DEFLATE) + ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) + ELSE (NOT USE_FILTER_DEFLATE) + ADD_H5_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) + ENDIF (NOT USE_FILTER_DEFLATE) + + # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " + ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) + IF (NOT USE_FILTER_DEFLATE) + ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) + ELSE (NOT USE_FILTER_DEFLATE) + ADD_H5_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) + ENDIF (NOT USE_FILTER_DEFLATE) + + # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " + ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) + ADD_H5_DUMPTEST (BINARY_I16 "/int/bin/16-bit" binin16.h5 BINARY) + + # ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " + ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/binin32.conf binin32.h5) + ADD_H5_DUMPTEST (BINARY_I32 "/int/bin/32-bit" binin32.h5 BINARY) + + # ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " + ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5) + ADD_H5_DUMPTEST (BINARY_UI16 "/int/buin/16-bit" binuin16.h5 BINARY) + + # ----- TESTING "BINARY UI32 - rank 3 - Output LE " + ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5) + ADD_H5_DUMPTEST (BINARY_UI32 "/int/buin/32-bit" binuin32.h5 BINARY) + + # ----- TESTING "STR" + ADD_H5_TEST (STR testfiles/txtstr.txt testfiles/txtstr.conf txtstr.h5) + ADD_H5_DUMPTEST (STR "/mytext/data" txtstr.h5) + + # ----- TESTING "BINARY I8 CR LF EOF" + ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5) + ADD_H5_DUMPTEST (BINARY_I8_EOF "/dataset0" binin8w.h5 BINARY) + + # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " + ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) + diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index 9497e58..7038a95 100644 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -1009,10 +1009,7 @@ static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id) char *str2 = NULL; char *str3 = NULL; char str[1024] = ""; - char c; - int results; int j; - int nlines = 0; int line; /*------------------------------------------------------------------------- diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index af9639d..49d1b0c 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -40,12 +40,6 @@ SET (H5_DEP_EXECUTABLES h5unjam ) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5jam test executables @@ -60,427 +54,7 @@ IF (BUILD_TESTING) #ADD_TEST (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - SET (HDF5_REFERENCE_TXT_FILES - u10.txt - u511.txt - u512.txt - u513.txt - h5jam-help.txt - h5unjam-help.txt - h5jam-ub-nohdf5.txt - ) - SET (HDF5_REFERENCE_TEST_FILES - tall.h5 - twithub.h5 - twithub513.h5 - ) - - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5jam - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} - ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - - FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5jam - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} - ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - # ============================================================ - # TEST_H5JAM_OUTPUT - # For the purpose to verify only output & exitcode from h5jam - # - MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - ADD_TEST ( - NAME H5JAM-${expectfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${expectfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/${expectfile}.txt" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5JAM_OUTPUT) - - # ============================================================ - # TEST_H5UNJAM_OUTPUT - # For the purpose to verify only output & exitcode from h5unjam - # - MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) - IF (NOT "${resultcode}" STREQUAL "0") - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT "${resultcode}" STREQUAL "0") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-UNJAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - ADD_TEST ( - NAME H5JAM-UNJAM-${expectfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${expectfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=testfiles/${expectfile}.txt" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (TEST_H5UNJAM_OUTPUT) - - MACRO (CHECKFILE testname testdepends expected actual) - # If using memchecker add tests without using scripts - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-${testname}-CHECKFILE-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${actual}.new - ${actual}.new.err - ${actual}.out - ${actual}.out.err - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - ADD_TEST ( - NAME H5JAM-${testname}-CHECKFILE-H5DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=testfiles/${expected}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${actual}.new" - -D "TEST_EXPECT=0" - -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) - ADD_TEST ( - NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=${actual}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${actual}.out" - -D "TEST_EXPECT=0" - -D "TEST_FILTER=(^(HDF5)[^\n]*)" - -D "TEST_REFERENCE=${actual}.new" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(CHECKFILE testname testdepends expected actual) - - MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${infile} - ) - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-SETUP - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) - IF (NOT "${ufile}" STREQUAL "NONE") - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM_D-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${ufile} - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test ${ufile}) - ELSE (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM_D-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" - -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${outfile}.ufile.txt" - -D "TEST_EXPECT=0" - -D "TEST_SKIP_COMPARE=TRUE" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) - SET (compare_test "${outfile}.ufile.txt") - ELSE (NOT "${ARGN}" STREQUAL "--delete") - ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - SET (compare_test "") - ENDIF (NOT "${ARGN}" STREQUAL "--delete") - ENDIF (NOT "${ufile}" STREQUAL "NONE") - IF (NOT "${compare_test}" STREQUAL "") - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${infile}.len.txt - ${infile}.cmp - ${infile}-ub.cmp - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" - -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" - -D "TEST_CHECKUB=YES" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${infile}" - -D "TEST_UFILE=${compare_test}" - -D "TEST_EXPECT=0" - -D "TEST_OFILE=" - -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) - ENDIF (NOT "${compare_test}" STREQUAL "") - - ADD_TEST ( - NAME H5JAM-${testname}-UNJAM-CHECK_NOUB - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" - -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" - -D "TEST_CHECKUB=NO" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${outfile}" - -D "TEST_EXPECT=0" - -D "TEST_UFILE=NULL" - -D "TEST_OFILE=NULL" - -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" - ) - IF (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) - ELSE (NOT "${compare_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) - ENDIF (NOT "${compare_test}" STREQUAL "") - - CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO(UNJAMTEST testname infile ufile outfile) - - MACRO (JAMTEST testname jamfile infile chkfile outfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) - SET (compare_test ${outfile}) - SET (compare_orig testfiles/${infile}) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - - ADD_TEST ( - NAME H5JAM-${testname}-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${compare_test}.len.txt - ${compare_test}.cmp - ${compare_test}-ub.cmp - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") - ADD_TEST ( - NAME H5JAM-${testname}-CHECK_UB_1 - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" - -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" - -D "TEST_CHECKUB=YES" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${compare_test}" - -D "TEST_UFILE=testfiles/${jamfile}" - -D "TEST_EXPECT=0" - -D "TEST_OFILE=${compare_orig}" - -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) - CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST testname jamfile infile outfile) - - MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5JAM-${testname}_NONE-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${chkfile} ${chkfile}.cpy.h5 - ) - ADD_TEST ( - NAME H5JAM-${testname}_NONE-SETUP - COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) - - ADD_TEST ( - NAME H5JAM-${testname}_NONE_COPY - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - - ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) - - SET (compare_test ${chkfile}) - SET (compare_orig ${chkfile}.cpy.h5) - IF ("${ARGN}" STREQUAL "--clobber") - SET (compare_orig "") - ENDIF ("${ARGN}" STREQUAL "--clobber") - - ADD_TEST ( - NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${compare_test}.len.txt - ${compare_test}.cmp - ${compare_test}-ub.cmp - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") - ADD_TEST ( - NAME H5JAM-${testname}_NONE-CHECK_UB_1 - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" - -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" - -D "TEST_CHECKUB=YES" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_HFILE=${compare_test}" - -D "TEST_UFILE=testfiles/${jamfile}" - -D "TEST_EXPECT=0" - -D "TEST_OFILE=${compare_orig}" - -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" - ) - SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) - CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - -#------------------------------- -# Testing h5jam -#------------------------------- - # help page - TEST_H5JAM_OUTPUT(h5jam-help 0 -h) - - # don't allow HDF5 format file as an user block file - TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) - - JAMTEST (tall_u10 u10.txt tall.h5 tall.h5 ta2.h5) - JAMTEST (tall_u511 u511.txt tall.h5 tall.h5 ta3.h5) - JAMTEST (tall_u512 u512.txt tall.h5 tall.h5 ta4.h5) - JAMTEST (tall_u513 u513.txt tall.h5 tall.h5 ta5.h5) - - JAMTEST_NONE (N_ta_u10 u10.txt tall.h5 tall.h5 ta6.h5) - JAMTEST_NONE (N_ta_u511 u511.txt tall.h5 tall.h5 ta7.h5) - JAMTEST_NONE (N_ta_u512 u512.txt tall.h5 tall.h5 ta8.h5) - JAMTEST_NONE (N_ta_u513 u513.txt tall.h5 tall.h5 ta9.h5) - - JAMTEST (twithub_u10 u10.txt twithub.h5 tall.h5 tax2.h5) - JAMTEST (twithub_u511 u511.txt twithub.h5 tall.h5 tax3.h5) - JAMTEST (twithub_u512 u512.txt twithub.h5 tall.h5 tax4.h5) - JAMTEST (twithub_u513 u513.txt twithub.h5 tall.h5 tax5.h5) - - JAMTEST (twithub513_u10 u10.txt twithub513.h5 tall.h5 tax6.h5) - JAMTEST (twithub513_u511 u511.txt twithub513.h5 tall.h5 tax7.h5) - JAMTEST (twithub513_u512 u512.txt twithub513.h5 tall.h5 tax8.h5) - JAMTEST (twithub513_u513 u513.txt twithub513.h5 tall.h5 tax9.h5) - - JAMTEST (twithub_u10_c u10.txt twithub.h5 tall.h5 taz2.h5 --clobber) - JAMTEST (twithub_u511_c u511.txt twithub.h5 tall.h5 taz3.h5 --clobber) - JAMTEST (twithub_u512_c u512.txt twithub.h5 tall.h5 taz4.h5 --clobber) - JAMTEST (twithub_u513_c u513.txt twithub.h5 tall.h5 taz5.h5 --clobber) - - JAMTEST (twithub513_u10_c u10.txt twithub513.h5 tall.h5 taz6.h5 --clobber) - JAMTEST (twithub513_u511_c u511.txt twithub513.h5 tall.h5 taz7.h5 --clobber) - JAMTEST (twithub513_u512_c u512.txt twithub513.h5 tall.h5 taz8.h5 --clobber) - JAMTEST (twithub513_u513_c u513.txt twithub513.h5 tall.h5 taz9.h5 --clobber) - - JAMTEST_NONE (N_twithub_u10_c u10.txt tall.h5 twithub.h5 tay2.h5 --clobber) - JAMTEST_NONE (N_twithub_u511_c u511.txt tall.h5 twithub.h5 tay3.h5 --clobber) - JAMTEST_NONE (N_twithub_u512_c u512.txt tall.h5 twithub.h5 tay4.h5 --clobber) - JAMTEST_NONE (N_twithub_u513_c u513.txt tall.h5 twithub.h5 tay5.h5 --clobber) - - JAMTEST_NONE (N_twithub513_u10_c u10.txt tall.h5 twithub513.h5 tay6.h5 --clobber) - JAMTEST_NONE (N_twithub513_u511_c u511.txt tall.h5 twithub513.h5 tay7.h5 --clobber) - JAMTEST_NONE (N_twithub513_u512_c u512.txt tall.h5 twithub513.h5 tay8.h5 --clobber) - JAMTEST_NONE (N_twithub513_u513_c u513.txt tall.h5 twithub513.h5 tay9.h5 --clobber) - -#------------------------------- -# Testing h5unjam -#------------------------------- - # help page - TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) - - UNJAMTEST (twithub_tall twithub.h5 tai1.h5 o10.txt tall.h5 taa1.h5) - UNJAMTEST (twithub513_tall twithub513.h5 tai2.h5 o512.txt tall.h5 taa2.h5) - - UNJAMTEST (N_twithub_tall twithub.h5 tai3.h5 NONE tall.h5 taa3.h5) - UNJAMTEST (N_twithub513_tall twithub513.h5 tai4.h5 NONE tall.h5 taa4.h5) - - UNJAMTEST (D_twithub_tall twithub.h5 taj2.h5 NONE tall.h5 tac2.h5 --delete) - UNJAMTEST (D_twithub513_tall twithub513.h5 taj3.h5 NONE tall.h5 tac3.h5 --delete) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) diff --git a/tools/h5jam/CMakeTests.cmake b/tools/h5jam/CMakeTests.cmake new file mode 100644 index 0000000..3816e85 --- /dev/null +++ b/tools/h5jam/CMakeTests.cmake @@ -0,0 +1,428 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + SET (HDF5_REFERENCE_TXT_FILES + u10.txt + u511.txt + u512.txt + u513.txt + h5jam-help.txt + h5unjam-help.txt + h5jam-ub-nohdf5.txt + ) + SET (HDF5_REFERENCE_TEST_FILES + tall.h5 + twithub.h5 + twithub513.h5 + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5jam + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + FOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${txt_file}") + #MESSAGE (STATUS " Copying ${txt_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5jam + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${txt_file} ${dest} + ) + ENDFOREACH (txt_file ${HDF5_REFERENCE_TXT_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + # ============================================================ + # TEST_H5JAM_OUTPUT + # For the purpose to verify only output & exitcode from h5jam + # + MACRO (TEST_H5JAM_OUTPUT expectfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam> ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT "${resultcode}" STREQUAL "0") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( + NAME H5JAM-${expectfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5jam>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${expectfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${expectfile} PROPERTIES DEPENDS H5JAM-${expectfile}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5JAM_OUTPUT) + + # ============================================================ + # TEST_H5UNJAM_OUTPUT + # For the purpose to verify only output & exitcode from h5unjam + # + MACRO (TEST_H5UNJAM_OUTPUT expectfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam> ${ARGN}) + IF (NOT "${resultcode}" STREQUAL "0") + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT "${resultcode}" STREQUAL "0") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-UNJAM-${expectfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${expectfile}.out + ${expectfile}.out.err + ) + ADD_TEST ( + NAME H5JAM-UNJAM-${expectfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${expectfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=testfiles/${expectfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS H5JAM-UNJAM-${expectfile}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (TEST_H5UNJAM_OUTPUT) + + MACRO (CHECKFILE testname testdepends expected actual) + # If using memchecker add tests without using scripts + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${testname}-CHECKFILE-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${actual}.new + ${actual}.new.err + ${actual}.out + ${actual}.out.err + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) + ADD_TEST ( + NAME H5JAM-${testname}-CHECKFILE-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=testfiles/${expected}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${actual}.new" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(HDF5)[^\n]*)" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=${actual}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${actual}.out" + -D "TEST_EXPECT=0" + -D "TEST_FILTER=(^(HDF5)[^\n]*)" + -D "TEST_REFERENCE=${actual}.new" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECKFILE-H5DMP_CMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-H5DMP) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO(CHECKFILE testname testdepends expected actual) + + MACRO (UNJAMTEST testname setfile infile ufile chkfile outfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-SETUP-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${infile} + ) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_H5JAM_SOURCE_DIR}/testfiles/${setfile} ${PROJECT_BINARY_DIR}/${infile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-SETUP PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-SETUP) + IF (NOT "${ufile}" STREQUAL "NONE") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${ufile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -u ${ufile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test ${ufile}) + ELSE (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM_D-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile}.ufile.txt ${outfile}.ufile.txt.err + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>" + -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${outfile}.ufile.txt" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) + SET (compare_test "${outfile}.ufile.txt") + ELSE (NOT "${ARGN}" STREQUAL "--delete") + ADD_TEST (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile}) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) + SET (compare_test "") + ENDIF (NOT "${ARGN}" STREQUAL "--delete") + ENDIF (NOT "${ufile}" STREQUAL "NONE") + IF (NOT "${compare_test}" STREQUAL "") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${infile}.len.txt + ${infile}.cmp + ${infile}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}-UNJAM") + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" + -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${infile}" + -D "TEST_UFILE=${compare_test}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects) + ENDIF (NOT "${compare_test}" STREQUAL "") + + ADD_TEST ( + NAME H5JAM-${testname}-UNJAM-CHECK_NOUB + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" + -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" + -D "TEST_CHECKUB=NO" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${outfile}" + -D "TEST_EXPECT=0" + -D "TEST_UFILE=NULL" + -D "TEST_OFILE=NULL" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + IF (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1) + ELSE (NOT "${compare_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM) + ENDIF (NOT "${compare_test}" STREQUAL "") + + CHECKFILE (${testname} "H5JAM-${testname}-UNJAM-CHECK_NOUB" ${chkfile} ${outfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO(UNJAMTEST testname infile ufile outfile) + + MACRO (JAMTEST testname jamfile infile chkfile outfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) + SET (compare_test ${outfile}) + SET (compare_orig testfiles/${infile}) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}") + ADD_TEST ( + NAME H5JAM-${testname}-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" + -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=${compare_orig}" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}-CHECK_UB_1" ${chkfile} ${outfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST testname jamfile infile outfile) + + MACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5JAM-${testname}_NONE-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${chkfile} ${chkfile}.cpy.h5 + ) + ADD_TEST ( + NAME H5JAM-${testname}_NONE-SETUP + COMMAND ${CMAKE_COMMAND} -E copy_if_different testfiles/${setfile} ${chkfile} + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-SETUP PROPERTIES DEPENDS H5JAM-${testname}_NONE-clear-objects) + + ADD_TEST ( + NAME H5JAM-${testname}_NONE_COPY + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${chkfile} ${chkfile}.cpy.h5 + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) + + ADD_TEST (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) + + SET (compare_test ${chkfile}) + SET (compare_orig ${chkfile}.cpy.h5) + IF ("${ARGN}" STREQUAL "--clobber") + SET (compare_orig "") + ENDIF ("${ARGN}" STREQUAL "--clobber") + + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${compare_test}.len.txt + ${compare_test}.cmp + ${compare_test}-ub.cmp + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects PROPERTIES DEPENDS "H5JAM-${testname}_NONE") + ADD_TEST ( + NAME H5JAM-${testname}_NONE-CHECK_UB_1 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" + -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" + -D "TEST_CHECKUB=YES" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_HFILE=${compare_test}" + -D "TEST_UFILE=testfiles/${jamfile}" + -D "TEST_EXPECT=0" + -D "TEST_OFILE=${compare_orig}" + -P "${HDF5_RESOURCES_DIR}/userblockTest.cmake" + ) + SET_TESTS_PROPERTIES (H5JAM-${testname}_NONE-CHECK_UB_1 PROPERTIES DEPENDS H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects) + CHECKFILE (${testname} "H5JAM-${testname}_NONE-CHECK_UB_1" ${infile} ${chkfile}) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (JAMTEST_NONE testname jamfile infile setfile chkfile) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + +#------------------------------- +# Testing h5jam +#------------------------------- + # help page + TEST_H5JAM_OUTPUT(h5jam-help 0 -h) + + # don't allow HDF5 format file as an user block file + TEST_H5JAM_OUTPUT(h5jam-ub-nohdf5 1 -i testfiles/tall.h5 -u testfiles/tall.h5 -o tall-tmp.h5) + + JAMTEST (tall_u10 u10.txt tall.h5 tall.h5 ta2.h5) + JAMTEST (tall_u511 u511.txt tall.h5 tall.h5 ta3.h5) + JAMTEST (tall_u512 u512.txt tall.h5 tall.h5 ta4.h5) + JAMTEST (tall_u513 u513.txt tall.h5 tall.h5 ta5.h5) + + JAMTEST_NONE (N_ta_u10 u10.txt tall.h5 tall.h5 ta6.h5) + JAMTEST_NONE (N_ta_u511 u511.txt tall.h5 tall.h5 ta7.h5) + JAMTEST_NONE (N_ta_u512 u512.txt tall.h5 tall.h5 ta8.h5) + JAMTEST_NONE (N_ta_u513 u513.txt tall.h5 tall.h5 ta9.h5) + + JAMTEST (twithub_u10 u10.txt twithub.h5 tall.h5 tax2.h5) + JAMTEST (twithub_u511 u511.txt twithub.h5 tall.h5 tax3.h5) + JAMTEST (twithub_u512 u512.txt twithub.h5 tall.h5 tax4.h5) + JAMTEST (twithub_u513 u513.txt twithub.h5 tall.h5 tax5.h5) + + JAMTEST (twithub513_u10 u10.txt twithub513.h5 tall.h5 tax6.h5) + JAMTEST (twithub513_u511 u511.txt twithub513.h5 tall.h5 tax7.h5) + JAMTEST (twithub513_u512 u512.txt twithub513.h5 tall.h5 tax8.h5) + JAMTEST (twithub513_u513 u513.txt twithub513.h5 tall.h5 tax9.h5) + + JAMTEST (twithub_u10_c u10.txt twithub.h5 tall.h5 taz2.h5 --clobber) + JAMTEST (twithub_u511_c u511.txt twithub.h5 tall.h5 taz3.h5 --clobber) + JAMTEST (twithub_u512_c u512.txt twithub.h5 tall.h5 taz4.h5 --clobber) + JAMTEST (twithub_u513_c u513.txt twithub.h5 tall.h5 taz5.h5 --clobber) + + JAMTEST (twithub513_u10_c u10.txt twithub513.h5 tall.h5 taz6.h5 --clobber) + JAMTEST (twithub513_u511_c u511.txt twithub513.h5 tall.h5 taz7.h5 --clobber) + JAMTEST (twithub513_u512_c u512.txt twithub513.h5 tall.h5 taz8.h5 --clobber) + JAMTEST (twithub513_u513_c u513.txt twithub513.h5 tall.h5 taz9.h5 --clobber) + + JAMTEST_NONE (N_twithub_u10_c u10.txt tall.h5 twithub.h5 tay2.h5 --clobber) + JAMTEST_NONE (N_twithub_u511_c u511.txt tall.h5 twithub.h5 tay3.h5 --clobber) + JAMTEST_NONE (N_twithub_u512_c u512.txt tall.h5 twithub.h5 tay4.h5 --clobber) + JAMTEST_NONE (N_twithub_u513_c u513.txt tall.h5 twithub.h5 tay5.h5 --clobber) + + JAMTEST_NONE (N_twithub513_u10_c u10.txt tall.h5 twithub513.h5 tay6.h5 --clobber) + JAMTEST_NONE (N_twithub513_u511_c u511.txt tall.h5 twithub513.h5 tay7.h5 --clobber) + JAMTEST_NONE (N_twithub513_u512_c u512.txt tall.h5 twithub513.h5 tay8.h5 --clobber) + JAMTEST_NONE (N_twithub513_u513_c u513.txt tall.h5 twithub513.h5 tay9.h5 --clobber) + +#------------------------------- +# Testing h5unjam +#------------------------------- + # help page + TEST_H5UNJAM_OUTPUT(h5unjam-help 0 -h) + + UNJAMTEST (twithub_tall twithub.h5 tai1.h5 o10.txt tall.h5 taa1.h5) + UNJAMTEST (twithub513_tall twithub513.h5 tai2.h5 o512.txt tall.h5 taa2.h5) + + UNJAMTEST (N_twithub_tall twithub.h5 tai3.h5 NONE tall.h5 taa3.h5) + UNJAMTEST (N_twithub513_tall twithub513.h5 tai4.h5 NONE tall.h5 taa4.h5) + + UNJAMTEST (D_twithub_tall twithub.h5 taj2.h5 NONE tall.h5 tac2.h5 --delete) + UNJAMTEST (D_twithub513_tall twithub513.h5 taj3.h5 NONE tall.h5 tac3.h5 --delete) diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 9641378..7b4dc91 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -27,7 +27,7 @@ hsize_t write_pad( int , hsize_t ); hsize_t compute_pad( hsize_t ); -herr_t copy_to_file( int , int , ssize_t, ssize_t ); +herr_t copy_to_file( FILE *, FILE * , ssize_t, ssize_t ); int do_delete = FALSE; char *output_file = NULL; @@ -137,20 +137,28 @@ static int parse_command_line(int argc, const char *argv[]) { int opt = FALSE; - - /* parse command line options */ + + /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch((char)opt) { case 'o': output_file = HDstrdup(opt_arg); - break; + if (output_file) + h5tools_set_data_output_file(output_file, 1); + break; case 'i': input_file = HDstrdup(opt_arg); - break; + if (input_file) + h5tools_set_input_file(input_file, 1); + break;; case 'u': ub_file = HDstrdup(opt_arg); + if (ub_file) + h5tools_set_output_file(ub_file, 1); + else + rawoutstream = stdout; break; case 'd': @@ -205,9 +213,6 @@ done: int main(int argc, const char *argv[]) { - int ifid = -1; - int ufid = -1; - int h5fid = -1; void *edata; H5E_auto2_t func; hid_t ifile = -1; @@ -222,24 +227,24 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ + /* Disable error reporting */ H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ + /* Initialize h5tools lib */ h5tools_init(); if(EXIT_FAILURE == parse_command_line(argc, argv)) goto done; if (input_file == NULL) { - /* no user block */ + /* no user block */ error_msg("missing arguemnt for HDF5 file input.\n"); help_ref_msg(stderr); h5tools_setstatus(EXIT_FAILURE); goto done; } - + testval = H5Fis_accessible(input_file, H5P_DEFAULT); if (testval <= 0) { @@ -283,14 +288,7 @@ main(int argc, const char *argv[]) goto done; } - ifid = HDopen(input_file,O_RDONLY,0); - if(ifid < 0) { - error_msg("unable to open input HDF5 file \"%s\"\n", input_file); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - - res = HDfstat(ifid, &sbuf); + res = HDfstat(HDfileno(rawinstream), &sbuf); if(res < 0) { error_msg("Can't stat file \"%s\"\n", input_file); h5tools_setstatus(EXIT_FAILURE); @@ -305,43 +303,15 @@ main(int argc, const char *argv[]) goto done; } - if (ub_file == NULL) { - /* write to sdtout */ - ufid = HDdup(1); - } - else { - ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); - - if (ufid < 0) { - error_msg("unable to open user block file for output\"%s\"\n", ub_file); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - } - if (output_file == NULL) { - h5fid = HDopen(input_file,O_WRONLY, 0); - - if (h5fid < 0) { error_msg("unable to open output HDF5 file \"%s\"\n", input_file); h5tools_setstatus(EXIT_FAILURE); goto done; - } } - else { - h5fid = HDopen(output_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); - - if (h5fid < 0) { - error_msg("unable to open output HDF5 file \"%s\"\n", output_file); - h5tools_setstatus(EXIT_FAILURE); - goto done; - } - } - - /* copy from 0 to 'usize - 1' into ufid */ + /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { - if(copy_to_file(ifid, ufid, 0, (ssize_t) usize) < 0) { + if(copy_to_file(rawinstream, rawoutstream, 0, (ssize_t) usize) < 0) { error_msg("unable to copy user block to output file \"%s\"\n", ub_file); h5tools_setstatus(EXIT_FAILURE); goto done; @@ -349,34 +319,25 @@ main(int argc, const char *argv[]) } /* copy from usize to end of file into h5fid, - * starting at end of user block if present - */ - if(copy_to_file(ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize)) < 0) { + * starting at end of user block if present */ + if(copy_to_file(rawinstream, rawdatastream, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize)) < 0) { error_msg("unable to copy hdf5 data to output file \"%s\"\n", output_file); h5tools_setstatus(EXIT_FAILURE); goto done; } - + done: if(input_file) HDfree(input_file); + if(output_file) HDfree(output_file); + if(ub_file) { HDfree(ub_file); - if(ufid >= 0) - status = HDclose(ufid); - HDassert(status >= 0); - } - - if(h5fid >= 0) { - status = HDclose(h5fid); - HDassert(status >= 0); - } - if(ifid >= 0) { - status = HDclose(ifid); - HDassert(status >= 0); } + + h5tools_close(); return h5tools_getstatus(); } @@ -388,54 +349,60 @@ done: * Returns 0 on success, -1 on failure. */ herr_t -copy_to_file( int infid, int ofid, ssize_t where, ssize_t how_much ) +copy_to_file( FILE *infid, FILE *ofid, ssize_t _where, ssize_t how_much ) { static char buf[COPY_BUF_SIZE]; + off_t where = (off_t)_where; off_t to; off_t from; - ssize_t nchars = -1; - ssize_t wnchars = -1; herr_t ret_value = 0; /* nothing to copy */ if(how_much <= 0) goto done; + /* rewind */ + HDfseek(infid, 0L, 0); + from = where; to = 0; - while(how_much > 0) { - /* Seek to correct position in input file */ - HDlseek(infid,from,SEEK_SET); + size_t bytes_in = 0; /* # of bytes to read */ + size_t bytes_read = 0; /* # of bytes actually read */ + size_t bytes_wrote = 0; /* # of bytes written */ - /* Read data to buffer */ if (how_much > COPY_BUF_SIZE) - nchars = HDread(infid,buf,(unsigned)COPY_BUF_SIZE); + bytes_in = COPY_BUF_SIZE; else - nchars = HDread(infid,buf,(unsigned)how_much); - if(nchars < 0) { + bytes_in = how_much; + + /* Seek to correct position in input file */ + HDfseek(infid, from, SEEK_SET); + + /* Read data to buffer */ + bytes_read = HDfread(buf, (size_t)1, bytes_in, infid); + if(0 == bytes_read && HDferror(infid)) { ret_value = -1; goto done; } /* end if */ + if(0 == bytes_read && HDfeof(infid)) { + goto done; + } /* end if */ /* Seek to correct position in output file */ - HDlseek(ofid,to,SEEK_SET); + HDfseek(ofid, to, SEEK_SET); /* Update positions/size */ - how_much -= nchars; - from += nchars; - to += nchars; - - /* Write nchars bytes to output file */ - wnchars = nchars; - while(nchars > 0) { - wnchars = HDwrite(ofid,buf,(unsigned)nchars); - if(wnchars < 0) { - ret_value = -1; - goto done; - } /* end if */ - nchars -= wnchars; - } /* end while */ + how_much -= bytes_read; + from += bytes_read; + to += bytes_read; + + /* Write nchars bytes to output file */ + bytes_wrote = HDfwrite(buf, (size_t)1, bytes_read, ofid); + if(bytes_wrote != bytes_read || (0 == bytes_wrote && HDferror(ofid))) { /* error */ + ret_value = -1; + goto done; + } /* end if */ } /* end while */ done: diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 2d7bd97..eeaf1ea 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -19,408 +19,9 @@ SET (H5_DEP_EXECUTABLES h5ls ) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) - # -------------------------------------------------------------------- - # Copy all the test files from source directory to test directory - # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 - ) - - SET (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/nosuchfile.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_le.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_be.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregbe.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregle.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-4.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-5.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1-old.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2-old.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3-old.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6-old.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7-old.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-3.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-4.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-5.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-nodangle-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlinks-nodangle-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-4.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls - ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls - ) - - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - - # copy the list of test files - FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") - ADD_CUSTOM_COMMAND ( - TARGET h5ls - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${listfiles} ${dest} - ) - ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_H5_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (${resultcode} STREQUAL "1") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (${resultcode} STREQUAL "1") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5LS-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err - ) - ADD_TEST ( - NAME H5LS-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5LS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - help-1.out - help-1.out.err - help-2.out - help-2.out.err - help-3.out - help-3.out.err - nosuchfile.out - nosuchfile.out.err - tall-1.out - tall-1.out.err - tall-2.out - tall-2.out.err - tarray1.out - tarray1.out.err - tattr2.out - tattr2.out.err - tcomp-1.out - tcomp-1.out.err - tdataregbe.out - tdataregbe.out.err - tdataregle.out - tdataregle.out.err - tdset-1.out - tdset-1.out.err - tempty.out - tempty.out.err - textlink-1.out - textlink-1.out.err - textlinksrc-1.out - textlinksrc-1.out.err - textlinksrc-2.out - textlinksrc-2.out.err - textlinksrc-3.out - textlinksrc-3.out.err - textlinksrc-4.out - textlinksrc-4.out.err - textlinksrc-5.out - textlinksrc-5.out.err - textlinksrc-6.out - textlinksrc-6.out.err - textlinksrc-7.out - textlinksrc-7.out.err - textlinksrc-1-old.out - textlinksrc-1-old.out.err - textlinksrc-2-old.out - textlinksrc-2-old.out.err - textlinksrc-3-old.out - textlinksrc-3-old.out.err - textlinksrc-6-old.out - textlinksrc-6-old.out.err - textlinksrc-7-old.out - textlinksrc-7-old.out.err - tgrp_comments.out - tgrp_comments.out.err - tsoftlinks-1.out - tsoftlinks-1.out.err - tsoftlinks-2.out - tsoftlinks-2.out.err - tsoftlinks-3.out - tsoftlinks-3.out.err - tsoftlinks-4.out - tsoftlinks-4.out.err - tsoftlinks-5.out - tsoftlinks-5.out.err - textlinksrc-nodangle-1.out - textlinksrc-nodangle-1.out.err - textlinksrc-nodangle-2.out - textlinksrc-nodangle-2.out.err - tsoftlinks-nodangle-1.out - tsoftlinks-nodangle-1.out.err - thlinks-nodangle-1.out - thlinks-nodangle-1.out.err - tgroup.out - tgroup.out.err - tgroup-1.out - tgroup-1.out.err - tgroup-2.out - tgroup-2.out.err - tgroup-3.out - tgroup-3.out.err - thlink-1.out - thlink-1.out.err - tloop-1.out - tloop-1.out.err - tnestcomp-1.out - tnestcomp-1.out.err - tnestcomp-2.out - tnestcomp-2.out.err - tnestcomp-3.out - tnestcomp-3.out.err - tnestcomp-4.out - tnestcomp-4.out.err - tsaf.out - tsaf.out.err - tslink-1.out - tslink-1.out.err - tstr-1.out - tstr-1.out.err - tudlink-1.out - tudlink-1.out.err - tvldtypes1.out - tvldtypes1.out.err - tvldtypes2le.out - tvldtypes2le.out.err - tvldtypes2be.out - tvldtypes2be.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5LS-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - # test the help syntax - ADD_H5_TEST (help-1 0 -w80 -h) - ADD_H5_TEST (help-2 0 -w80 --help) - ADD_H5_TEST (help-3 0 -w80 -?) - - # test simple command - ADD_H5_TEST (tall-1 0 -w80 tall.h5) - ADD_H5_TEST (tall-2 0 -w80 -r -d tall.h5) - ADD_H5_TEST (tgroup 0 -w80 tgroup.h5) - ADD_H5_TEST (tgroup-3 0 -w80 tgroup.h5/g1) - - # test for displaying groups - # The following combination of arguments is expected to return an error message - # and return value 1 - ADD_H5_TEST (tgroup-1 1 -w80 -r -g tgroup.h5) - ADD_H5_TEST (tgroup-2 0 -w80 -g tgroup.h5/g1) - - # test for files with groups that have long comments - ADD_H5_TEST (tgrp_comments 0 -w80 -v -g tgrp_comments.h5/glongcomment) - - # test for displaying simple space datasets - ADD_H5_TEST (tdset-1 0 -w80 -r -d tdset.h5) - - # test for displaying soft links (dangle) - ADD_H5_TEST (tslink-1 0 -w80 -r tslink.h5) - - # test for displaying more soft links with --follow-symlinks - ADD_H5_TEST (tsoftlinks-1 0 --follow-symlinks tsoftlinks.h5) - ADD_H5_TEST (tsoftlinks-2 0 --follow-symlinks -r tsoftlinks.h5) - ADD_H5_TEST (tsoftlinks-3 0 --follow-symlinks tsoftlinks.h5/group1) - ADD_H5_TEST (tsoftlinks-4 0 --follow-symlinks -r tsoftlinks.h5/group1) - ADD_H5_TEST (tsoftlinks-5 0 --follow-symlinks tsoftlinks.h5/soft_dset1) - - # test for displaying external and user-defined links with --follow-symlinks - ADD_H5_TEST (textlink-1 0 -w80 -r textlink.h5) - ADD_H5_TEST (textlinksrc-1 0 -w80 --follow-symlinks -r textlinksrc.h5) - ADD_H5_TEST (textlinksrc-2 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5) - ADD_H5_TEST (textlinksrc-3 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1) - ADD_H5_TEST (textlinksrc-4 0 -w80 -r textlinksrc.h5) - ADD_H5_TEST (textlinksrc-5 0 -w80 -r textlinksrc.h5/ext_link1) - ADD_H5_TEST (textlinksrc-6 0 -w80 --follow-symlinks textlinksrc.h5) - ADD_H5_TEST (textlinksrc-7 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1) - ADD_H5_TEST (tudlink-1 0 -w80 -r tudlink.h5) - - # test for displaying external links with -E - # the option -E will be depriciated but keep it for backward compatibility - ADD_H5_TEST (textlinksrc-1-old 0 -w80 -Er textlinksrc.h5) - ADD_H5_TEST (textlinksrc-2-old 0 -w80 -Erv textlinksrc.h5/ext_link5) - ADD_H5_TEST (textlinksrc-3-old 0 -w80 -Er textlinksrc.h5/ext_link1) - ADD_H5_TEST (textlinksrc-6-old 0 -w80 -E textlinksrc.h5) - ADD_H5_TEST (textlinksrc-7-old 0 -w80 -E textlinksrc.h5/ext_link1) - - # tests for no-dangling-links - # if this option is given on dangling link, h5ls should return exit code 1 - # when used alone , expect to print out help and return exit code 1 - ADD_H5_TEST (textlinksrc-nodangle-1 1 -w80 --no-dangling-links textlinksrc.h5) - # external dangling link - expected exit code 1 - ADD_H5_TEST (textlinksrc-nodangle-2 1 -w80 --follow-symlinks --no-dangling-links textlinksrc.h5) - # soft dangling link - expected exit code 1 - ADD_H5_TEST (tsoftlinks-nodangle-1 1 -w80 --follow-symlinks --no-dangling-links tsoftlinks.h5) - # when used file with no dangling links - expected exit code 0 - ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5) - -# test for wildcards in filename (does not work with cmake) -# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5) -# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5) - ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5) - - # tests for hard links - ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) - - # tests for compound data types - ADD_H5_TEST (tcomp-1 0 -w80 -r -d tcompound.h5) - - #test for the nested compound type - ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5) - - ADD_H5_TEST (tnestcomp-2 0 -w80 -r -d -S tnestedcomp.h5) - - ADD_H5_TEST (tnestcomp-3 0 -w80 -r -d -l tnestedcomp.h5) - - ADD_H5_TEST (tnestcomp-4 0 -w80 -r -d -l -S tnestedcomp.h5) - - # test for loop detection - ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5) - - # test for string - ADD_H5_TEST (tstr-1 0 -w80 -r -d tstr.h5) - - # test test file created from lib SAF team - ADD_H5_TEST (tsaf 0 -w80 -r -d tsaf.h5) - - # test for variable length data types - ADD_H5_TEST (tvldtypes1 0 -w80 -r -d tvldtypes1.h5) - - # test for array data types - ADD_H5_TEST (tarray1 0 -w80 -r -d tarray1.h5) - - # test for empty data - ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) - - # test for all dataset types written to attributes - # enable -S for avoiding printing NATIVE types - ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) - - # test for attribute with region references wo verbose mode - # ( HDFFV-7838, ) - IF (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) - ELSE (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) - ENDIF (H5_WORDS_BIGENDIAN) - - # test for non-existing file - ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) - - # test for variable length data types in verbose mode - IF (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) - ELSE (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) - ENDIF (H5_WORDS_BIGENDIAN) - # test for dataset region references data types in verbose mode - IF (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) - ELSE (H5_WORDS_BIGENDIAN) - ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) - ENDIF (H5_WORDS_BIGENDIAN) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) diff --git a/tools/h5ls/CMakeTests.cmake b/tools/h5ls/CMakeTests.cmake new file mode 100644 index 0000000..09f375d --- /dev/null +++ b/tools/h5ls/CMakeTests.cmake @@ -0,0 +1,402 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the test files from source directory to test directory + # -------------------------------------------------------------------- + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcompound.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdatareg.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinktar.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestedcomp.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.h5 + ) + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/help-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/nosuchfile.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tall-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tarray1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattr2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tattrreg_be.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregbe.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdataregle.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tdset-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tempty.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-1-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-2-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-3-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-6-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-7-old.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-5.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/textlinksrc-nodangle-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgrp_comments.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsoftlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlinks-nodangle-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tgroup-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/thlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tloop-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tmultifile.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-2.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-3.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tnestcomp-4.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tsaf.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tslink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tstr-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tudlink-1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes1.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2le.ls + ${HDF5_TOOLS_SRC_DIR}/testfiles/tvldtypes2be.ls + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + # copy the list of test files + FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${listfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${listfiles} to ${dest}") + ADD_CUSTOM_COMMAND ( + TARGET h5ls + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${listfiles} ${dest} + ) + ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_H5_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (${resultcode} STREQUAL "1") + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (${resultcode} STREQUAL "1") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5LS-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err + ) + ADD_TEST ( + NAME H5LS-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5LS-${resultfile} PROPERTIES DEPENDS "H5LS-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5LS-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + help-1.out + help-1.out.err + help-2.out + help-2.out.err + help-3.out + help-3.out.err + nosuchfile.out + nosuchfile.out.err + tall-1.out + tall-1.out.err + tall-2.out + tall-2.out.err + tarray1.out + tarray1.out.err + tattr2.out + tattr2.out.err + tcomp-1.out + tcomp-1.out.err + tdataregbe.out + tdataregbe.out.err + tdataregle.out + tdataregle.out.err + tdset-1.out + tdset-1.out.err + tempty.out + tempty.out.err + textlink-1.out + textlink-1.out.err + textlinksrc-1.out + textlinksrc-1.out.err + textlinksrc-2.out + textlinksrc-2.out.err + textlinksrc-3.out + textlinksrc-3.out.err + textlinksrc-4.out + textlinksrc-4.out.err + textlinksrc-5.out + textlinksrc-5.out.err + textlinksrc-6.out + textlinksrc-6.out.err + textlinksrc-7.out + textlinksrc-7.out.err + textlinksrc-1-old.out + textlinksrc-1-old.out.err + textlinksrc-2-old.out + textlinksrc-2-old.out.err + textlinksrc-3-old.out + textlinksrc-3-old.out.err + textlinksrc-6-old.out + textlinksrc-6-old.out.err + textlinksrc-7-old.out + textlinksrc-7-old.out.err + tgrp_comments.out + tgrp_comments.out.err + tsoftlinks-1.out + tsoftlinks-1.out.err + tsoftlinks-2.out + tsoftlinks-2.out.err + tsoftlinks-3.out + tsoftlinks-3.out.err + tsoftlinks-4.out + tsoftlinks-4.out.err + tsoftlinks-5.out + tsoftlinks-5.out.err + textlinksrc-nodangle-1.out + textlinksrc-nodangle-1.out.err + textlinksrc-nodangle-2.out + textlinksrc-nodangle-2.out.err + tsoftlinks-nodangle-1.out + tsoftlinks-nodangle-1.out.err + thlinks-nodangle-1.out + thlinks-nodangle-1.out.err + tgroup.out + tgroup.out.err + tgroup-1.out + tgroup-1.out.err + tgroup-2.out + tgroup-2.out.err + tgroup-3.out + tgroup-3.out.err + thlink-1.out + thlink-1.out.err + tloop-1.out + tloop-1.out.err + tnestcomp-1.out + tnestcomp-1.out.err + tnestcomp-2.out + tnestcomp-2.out.err + tnestcomp-3.out + tnestcomp-3.out.err + tnestcomp-4.out + tnestcomp-4.out.err + tsaf.out + tsaf.out.err + tslink-1.out + tslink-1.out.err + tstr-1.out + tstr-1.out.err + tudlink-1.out + tudlink-1.out.err + tvldtypes1.out + tvldtypes1.out.err + tvldtypes2le.out + tvldtypes2le.out.err + tvldtypes2be.out + tvldtypes2be.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5LS-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # test the help syntax + ADD_H5_TEST (help-1 0 -w80 -h) + ADD_H5_TEST (help-2 0 -w80 --help) + ADD_H5_TEST (help-3 0 -w80 -?) + + # test simple command + ADD_H5_TEST (tall-1 0 -w80 tall.h5) + ADD_H5_TEST (tall-2 0 -w80 -r -d tall.h5) + ADD_H5_TEST (tgroup 0 -w80 tgroup.h5) + ADD_H5_TEST (tgroup-3 0 -w80 tgroup.h5/g1) + + # test for displaying groups + # The following combination of arguments is expected to return an error message + # and return value 1 + ADD_H5_TEST (tgroup-1 1 -w80 -r -g tgroup.h5) + ADD_H5_TEST (tgroup-2 0 -w80 -g tgroup.h5/g1) + + # test for files with groups that have long comments + ADD_H5_TEST (tgrp_comments 0 -w80 -v -g tgrp_comments.h5/glongcomment) + + # test for displaying simple space datasets + ADD_H5_TEST (tdset-1 0 -w80 -r -d tdset.h5) + + # test for displaying soft links (dangle) + ADD_H5_TEST (tslink-1 0 -w80 -r tslink.h5) + + # test for displaying more soft links with --follow-symlinks + ADD_H5_TEST (tsoftlinks-1 0 --follow-symlinks tsoftlinks.h5) + ADD_H5_TEST (tsoftlinks-2 0 --follow-symlinks -r tsoftlinks.h5) + ADD_H5_TEST (tsoftlinks-3 0 --follow-symlinks tsoftlinks.h5/group1) + ADD_H5_TEST (tsoftlinks-4 0 --follow-symlinks -r tsoftlinks.h5/group1) + ADD_H5_TEST (tsoftlinks-5 0 --follow-symlinks tsoftlinks.h5/soft_dset1) + + # test for displaying external and user-defined links with --follow-symlinks + ADD_H5_TEST (textlink-1 0 -w80 -r textlink.h5) + ADD_H5_TEST (textlinksrc-1 0 -w80 --follow-symlinks -r textlinksrc.h5) + ADD_H5_TEST (textlinksrc-2 0 -w80 --follow-symlinks -rv textlinksrc.h5/ext_link5) + ADD_H5_TEST (textlinksrc-3 0 -w80 --follow-symlinks -r textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-4 0 -w80 -r textlinksrc.h5) + ADD_H5_TEST (textlinksrc-5 0 -w80 -r textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-6 0 -w80 --follow-symlinks textlinksrc.h5) + ADD_H5_TEST (textlinksrc-7 0 -w80 --follow-symlinks textlinksrc.h5/ext_link1) + ADD_H5_TEST (tudlink-1 0 -w80 -r tudlink.h5) + + # test for displaying external links with -E + # the option -E will be depriciated but keep it for backward compatibility + ADD_H5_TEST (textlinksrc-1-old 0 -w80 -Er textlinksrc.h5) + ADD_H5_TEST (textlinksrc-2-old 0 -w80 -Erv textlinksrc.h5/ext_link5) + ADD_H5_TEST (textlinksrc-3-old 0 -w80 -Er textlinksrc.h5/ext_link1) + ADD_H5_TEST (textlinksrc-6-old 0 -w80 -E textlinksrc.h5) + ADD_H5_TEST (textlinksrc-7-old 0 -w80 -E textlinksrc.h5/ext_link1) + + # tests for no-dangling-links + # if this option is given on dangling link, h5ls should return exit code 1 + # when used alone , expect to print out help and return exit code 1 + ADD_H5_TEST (textlinksrc-nodangle-1 1 -w80 --no-dangling-links textlinksrc.h5) + # external dangling link - expected exit code 1 + ADD_H5_TEST (textlinksrc-nodangle-2 1 -w80 --follow-symlinks --no-dangling-links textlinksrc.h5) + # soft dangling link - expected exit code 1 + ADD_H5_TEST (tsoftlinks-nodangle-1 1 -w80 --follow-symlinks --no-dangling-links tsoftlinks.h5) + # when used file with no dangling links - expected exit code 0 + ADD_H5_TEST (thlinks-nodangle-1 0 -w80 --follow-symlinks --no-dangling-links thlink.h5) + +# test for wildcards in filename (does not work with cmake) +# ADD_H5_TEST (tstarfile 0 -w80 t*link.h5) +# ADD_H5_TEST (tqmarkfile 0 -w80 t?link.h5) + ADD_H5_TEST (tmultifile 0 -w80 thlink.h5 tslink.h5) + + # tests for hard links + ADD_H5_TEST (thlink-1 0 -w80 thlink.h5) + + # tests for compound data types + ADD_H5_TEST (tcomp-1 0 -w80 -r -d tcompound.h5) + + #test for the nested compound type + ADD_H5_TEST (tnestcomp-1 0 -w80 -r -d tnestedcomp.h5) + + ADD_H5_TEST (tnestcomp-2 0 -w80 -r -d -S tnestedcomp.h5) + + ADD_H5_TEST (tnestcomp-3 0 -w80 -r -d -l tnestedcomp.h5) + + ADD_H5_TEST (tnestcomp-4 0 -w80 -r -d -l -S tnestedcomp.h5) + + # test for loop detection + ADD_H5_TEST (tloop-1 0 -w80 -r -d tloop.h5) + + # test for string + ADD_H5_TEST (tstr-1 0 -w80 -r -d tstr.h5) + + # test test file created from lib SAF team + ADD_H5_TEST (tsaf 0 -w80 -r -d tsaf.h5) + + # test for variable length data types + ADD_H5_TEST (tvldtypes1 0 -w80 -r -d tvldtypes1.h5) + + # test for array data types + ADD_H5_TEST (tarray1 0 -w80 -r -d tarray1.h5) + + # test for empty data + ADD_H5_TEST (tempty 0 -w80 -d tempty.h5) + + # test for all dataset types written to attributes + # enable -S for avoiding printing NATIVE types + ADD_H5_TEST (tattr2 0 -w80 -v -S tattr2.h5) + + # test for attribute with region references wo verbose mode + # ( HDFFV-7838, ) + IF (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tattrreg_be 0 -w80 -v -d tattrreg.h5) + ELSE (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tattrreg_le 0 -w80 -v -d tattrreg.h5) + ENDIF (H5_WORDS_BIGENDIAN) + + # test for non-existing file + ADD_H5_TEST (nosuchfile 1 nosuchfile.h5) + + # test for variable length data types in verbose mode + IF (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tvldtypes2be 0 -v tvldtypes1.h5) + ELSE (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tvldtypes2le 0 -v tvldtypes1.h5) + ENDIF (H5_WORDS_BIGENDIAN) + + # test for dataset region references data types in verbose mode + IF (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tdataregbe 0 -v tdatareg.h5) + ELSE (H5_WORDS_BIGENDIAN) + ADD_H5_TEST (tdataregle 0 -v tdatareg.h5) + ENDIF (H5_WORDS_BIGENDIAN) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 7d251ac..f03ad69 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -28,12 +28,6 @@ SET_TARGET_PROPERTIES (h5repack PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5repack) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add h5Repack test executables @@ -50,936 +44,7 @@ IF (BUILD_TESTING) TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repacktest PROPERTIES FOLDER tools) - IF (HDF5_TEST_VFD) - SET (VFD_LIST - sec2 - stdio - core - split - multi - family - ) - - IF (DIRECT_VFD) - SET (VFD_LIST ${VFD_LIST} direct) - ENDIF (DIRECT_VFD) - - MACRO (ADD_VFD_TEST vfdname resultcode) - ADD_TEST ( - NAME H5REPACK-VFD-${vfdname}-h5repacktest - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=h5repacktest" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - ENDMACRO (ADD_VFD_TEST) - ENDIF (HDF5_TEST_VFD) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the source directory into the test directory - # -------------------------------------------------------------------- - SET (LIST_HDF5_TEST_FILES - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_early.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fill.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fletcher.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_hlink.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout3.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_refs.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 - # h5diff/testfile - ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 - # tools/testfiles - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 - ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 - ) - - SET (LIST_OTHER_TEST_FILES - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin - ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack.info - # tools/testfiles - ${HDF5_TOOLS_SRC_DIR}/testfiles/h5repack_filters.h5.ddl - ) - - FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5repack - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${h5_file} ${dest} - ) - ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_H5_TEST_OLD testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK_OLD-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( - NAME H5REPACK_OLD-${testname} - COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5REPACK_OLD-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST_OLD) - - MACRO (ADD_H5_TEST testname testtype testfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - ADD_TEST ( - NAME H5REPACK-${testname} - COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5REPACK-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_H5_TEST) - - MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK_CMP-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5REPACK_CMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} testfiles/${resultfile} testfiles/out-${testname}.${resultfile}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK_CMP-${testname} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" - -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out-${testname}.${resultfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_H5_CMP_TEST) - - MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) - IF (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" - ) - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ELSE (${testtype} STREQUAL "SKIP") - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) - IF (${resultcode} STREQUAL "0") - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${testfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" - ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ELSE (${resultcode} STREQUAL "0") - IF (${testfilter} STREQUAL "CHUNKED") - SET (nottestfilter "(CONTIGUOUS|COMPACT)") - ENDIF (${testfilter} STREQUAL "CHUNKED") - IF (${testfilter} STREQUAL "CONTIGUOUS") - SET (nottestfilter "(CHUNK|COMPACT)") - ENDIF (${testfilter} STREQUAL "CONTIGUOUS") - IF (${testfilter} STREQUAL "COMPACT") - SET (nottestfilter "(CONTIGUOUS|CHUNK)") - ENDIF (${testfilter} STREQUAL "COMPACT") - ADD_TEST ( - NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" - -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${testfile}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_FILTER:STRING=${nottestfilter}" - -D "TEST_REFERENCE=${testfilter}" - -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" - ) - SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) - ENDIF (${resultcode} STREQUAL "0") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ENDIF (${testtype} STREQUAL "SKIP") - ENDMACRO (ADD_H5_VERIFY_TEST) - - MACRO (ADD_H5_TEST_META testname testfile) - ADD_TEST ( - NAME H5REPACK_META-${testname}_N - COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ADD_TEST ( - NAME H5REPACK_META-${testname}_M - COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 - ) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) - - ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") - SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) - ENDMACRO (ADD_H5_TEST_META) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # -------------------------------------------------------------------- - # test file names - # -------------------------------------------------------------------- - SET (INFO_FILE testfiles/h5repack.info) - - SET (FILE0 h5repack_fill.h5) - SET (FILE1 h5repack_objs.h5) - SET (FILE2 h5repack_attr.h5) - SET (FILE3 h5repack_hlink.h5) - SET (FILE4 h5repack_layout.h5) - SET (FILE5 h5repack_early.h5) - SET (FILE7 h5repack_szip.h5) - SET (FILE8 h5repack_deflate.h5) - SET (FILE9 h5repack_shuffle.h5) - SET (FILE10 h5repack_fletcher.h5) - SET (FILE11 h5repack_filters.h5) - SET (FILE12 h5repack_nbit.h5) - SET (FILE13 h5repack_soffset.h5) - SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) - SET (FILE15 h5repack_named_dtypes.h5) - SET (FILE16 tfamily%05d.h5) # located in common testfiles folder - SET (FILE18 h5repack_layout2.h5) - SET (FILE_REF h5repack_refs.h5) - SET (FILE_ATTR_REF h5repack_attr_refs.h5) - - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5REPACK-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out - ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out - ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-chunk_compa-v.out - ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err - ./testfiles/h5repack_layout.h5-chunk_conti-v.out - ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err - ./testfiles/h5repack_layout.h5-compa-v.out - ./testfiles/h5repack_layout.h5-compa-v.out.err - ./testfiles/h5repack_layout.h5-conti-v.out - ./testfiles/h5repack_layout.h5-conti-v.out.err - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out - ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err - ./testfiles/h5repack_layout.h5-dset2_compa-v.out - ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset2_conti-v.out - ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out - ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out - ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out - ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out - ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out - ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out - ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out - ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out - ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out - ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out - ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out - ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err - ./testfiles/h5repack_layout3.h5-error1-v.out - ./testfiles/h5repack_layout3.h5-error1-v.out.err - ./testfiles/h5repack_layout3.h5-error2-v.out - ./testfiles/h5repack_layout3.h5-error2-v.out.err - ./testfiles/h5repack_layout3.h5-error3-v.out - ./testfiles/h5repack_layout3.h5-error3-v.out.err - ./testfiles/out-family.tfamily%05d.h5 - ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 - ./testfiles/out-attr.h5repack_attr.h5 - ./testfiles/out-native_attr.h5repack_attr.h5 - ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 - ./testfiles/out-deflate_copy.h5repack_deflate.h5 - ./testfiles/out-deflate_remove.h5repack_deflate.h5 - ./testfiles/out-early.h5repack_early.h5 - ./testfiles/out-fill.h5repack_fill.h5 - ./testfiles/out-native_fill.h5repack_fill.h5 - ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 - ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 - ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 - ./testfiles/out-hlink.h5repack_hlink.h5 - ./testfiles/out-chunk_18x13.h5repack_layout.h5 - ./testfiles/out-chunk_20x10.h5repack_layout.h5 - ./testfiles/out-chunk_compa.h5repack_layout.h5 - ./testfiles/out-chunk_conti.h5repack_layout.h5 - ./testfiles/out-compa.h5repack_layout.h5 - ./testfiles/out-conti.h5repack_layout.h5 - ./testfiles/out-deflate_file.h5repack_layout.h5 - ./testfiles/out-deflate_limit.h5repack_layout.h5 - ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 - ./testfiles/out-dset2_compa.h5repack_layout.h5 - ./testfiles/out-dset2_conti.h5repack_layout.h5 - ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 - ./testfiles/out-dset_compa_compa.h5repack_layout.h5 - ./testfiles/out-dset_compa_conti.h5repack_layout.h5 - ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 - ./testfiles/out-dset_conti_compa.h5repack_layout.h5 - ./testfiles/out-dset_conti_conti.h5repack_layout.h5 - ./testfiles/out-fletcher_all.h5repack_layout.h5 - ./testfiles/out-fletcher_individual.h5repack_layout.h5 - ./testfiles/out-global_filters.h5repack_layout.h5 - ./testfiles/out-gzip_all.h5repack_layout.h5 - ./testfiles/out-gzip_individual.h5repack_layout.h5 - ./testfiles/out-layout.h5repack_layout.h5 - ./testfiles/out-layout_long_switches.h5repack_layout.h5 - ./testfiles/out-layout_short_switches.h5repack_layout.h5 - ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 - ./testfiles/out-shuffle_all.h5repack_layout.h5 - ./testfiles/out-shuffle_individual.h5repack_layout.h5 - ./testfiles/out-upgrade_layout.h5repack_layouto.h5 - ./testfiles/out-contig_small_compa.h5repack_layout2.h5 - ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 - ./testfiles/out-chunk2chunk.h5repack_layout3.h5 - ./testfiles/out-chunk2compa.h5repack_layout3.h5 - ./testfiles/out-chunk2conti.h5repack_layout3.h5 - ./testfiles/out-error1.h5repack_layout3.h5 - ./testfiles/out-error2.h5repack_layout3.h5 - ./testfiles/out-error3.h5repack_layout3.h5 - ./testfiles/out-error4.h5repack_layout3.h5 - ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 - ./testfiles/out-nbit_add.h5repack_nbit.h5 - ./testfiles/out-nbit_copy.h5repack_nbit.h5 - ./testfiles/out-nbit_remove.h5repack_nbit.h5 - ./testfiles/out-add_alignment.h5repack_objs.h5 - ./testfiles/out-add_userblock.h5repack_objs.h5 - ./testfiles/out-objs.h5repack_objs.h5 - ./testfiles/out-gt_mallocsize.h5repack_objs.h5 - ./testfiles/out-bug1814.h5repack_refs.h5 - ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 - ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 - ./testfiles/out-scale_add.h5repack_soffset.h5 - ./testfiles/out-scale_copy.h5repack_soffset.h5 - ./testfiles/out-scale_remove.h5repack_soffset.h5 - ./testfiles/out-meta_short_M.meta_short.h5 - ./testfiles/out-meta_short_N.meta_short.h5 - ./testfiles/out-meta_long_M.meta_long.h5 - ./testfiles/out-meta_long_N.meta_long.h5 - # from the h5repacktst - h5repack_attr.h5 - h5repack_attr_out.h5 - h5repack_attr_refs.h5 - h5repack_big.h5 - h5repack_deflate.h5 - h5repack_deflate_out.h5 - h5repack_early2.h5 - h5repack_early.h5 - h5repack_early_out.h5 - h5repack_ext.h5 - h5repack_ext_out.h5 - h5repack_fill.h5 - h5repack_fill_out.h5 - h5repack_filters.h5 - h5repack_filters_out.h5 - h5repack_fletcher.h5 - h5repack_fletcher_out.h5 - h5repack_hlink.h5 - h5repack_hlink_out.h5 - h5repack_layout.h5 - h5repack_layout_out.h5 - h5repack_layout2.h5 - h5repack_layout3.h5 - h5repack_named_dtypes.h5 - h5repack_named_dtypes_out.h5 - h5repack_nbit.h5 - h5repack_nbit_out.h5 - h5repack_objs.h5 - h5repack_objs_out.h5 - h5repack_refs.h5 - h5repack_shuffle.h5 - h5repack_shuffle_out.h5 - h5repack_soffset.h5 - h5repack_soffset_out.h5 - h5repack_szip.h5 - h5repack_szip_out.h5 - h5repack_ub.h5 - h5repack_ub_out.h5 - h5repack_ext.bin - ublock.bin - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - - ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) - IF (HDF5_ENABLE_SZIP_SUPPORT) - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "yes") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") - ELSE (HDF5_ENABLE_SZIP_ENCODING) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - ELSE (HDF5_ENABLE_SZIP_SUPPORT) - SET (passRegex "no") - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") - ENDIF (HDF5_ENABLE_SZIP_SUPPORT) - SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) - - ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) - SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - SET (last_test "H5REPACK-h5repacktest") - -# -# The tests -# We use the files generated by h5repacktst -# Each run generates "<file>.out.h5" and the tool h5diff is used to -# compare the input and output files -# -# the tests are the same as the program h5repacktst, but run from the CLI -# - -# See which filters are usable (and skip tests for filters we -# don't have). Do this by searching H5pubconf.h to see which -# filters are defined. - -# detect whether the encoder is present. - SET (USE_FILTER_SZIP_ENCODER "no") - IF (HDF5_ENABLE_SZIP_ENCODING) - SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) - ENDIF (HDF5_ENABLE_SZIP_ENCODING) - - IF (H5_HAVE_FILTER_DEFLATE) - SET (USE_FILTER_DEFLATE "true") - ENDIF (H5_HAVE_FILTER_DEFLATE) - - IF (H5_HAVE_FILTER_SZIP) - SET (USE_FILTER_SZIP "true") - ENDIF (H5_HAVE_FILTER_SZIP) - - IF (H5_HAVE_FILTER_SHUFFLE) - SET (USE_FILTER_SHUFFLE "true") - ENDIF (H5_HAVE_FILTER_SHUFFLE) - - IF (H5_HAVE_FILTER_FLETCHER32) - SET (USE_FILTER_FLETCHER32 "true") - ENDIF (H5_HAVE_FILTER_FLETCHER32) - - IF (H5_HAVE_FILTER_NBIT) - SET (USE_FILTER_NBIT "true") - ENDIF (H5_HAVE_FILTER_NBIT) - - IF (H5_HAVE_FILTER_SCALEOFFSET) - SET (USE_FILTER_SCALEOFFSET "true") - ENDIF (H5_HAVE_FILTER_SCALEOFFSET) - -# copy files (these files have no filters) - ADD_H5_TEST (fill "TEST" ${FILE0}) - ADD_H5_TEST (objs "TEST" ${FILE1}) - ADD_H5_TEST (attr "TEST" ${FILE2}) - ADD_H5_TEST (hlink "TEST" ${FILE3}) - ADD_H5_TEST (layout "TEST" ${FILE4}) - ADD_H5_TEST (early "TEST" ${FILE5}) - -# use $FILE4 to write some filters (this file has no filters) - -# gzip with individual object - SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) - -# gzip for all - SET (arg ${FILE4} -f GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) - -# szip with individual object - SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) - -# szip for all - SET (arg ${FILE4} -f SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) - -# shuffle with individual object - SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) - -# shuffle for all - SET (arg ${FILE4} -f SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) - -# fletcher32 with individual object - SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) - -# fletcher32 for all - SET (arg ${FILE4} -f FLET) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) - -# all filters - SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) - -# verbose gzip with individual object - SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) - -########################################################### -# the following tests assume the input files have filters -########################################################### - -# szip copy - SET (arg ${FILE7}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) - -# szip remove - SET (arg ${FILE7} --filter=dset_szip:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) - ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) - -# deflate copy - SET (arg ${FILE8}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) - -# deflate remove - SET (arg ${FILE8} -f dset_deflate:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) - -# shuffle copy - SET (arg ${FILE9}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) - -# shuffle remove - SET (arg ${FILE9} -f dset_shuffle:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SHUFFLE) - ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) - -# fletcher32 copy - SET (arg ${FILE10}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) - -# fletcher32 remove - SET (arg ${FILE10} -f dset_fletcher32:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32) - ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) - -# nbit copy - SET (arg ${FILE12}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) - ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) - -# nbit remove - SET (arg ${FILE12} -f dset_nbit:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) - ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) - -# nbit add - SET (arg ${FILE12} -f dset_int31:NBIT) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_NBIT) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_NBIT) - ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) - -# scaleoffset copy - SET (arg ${FILE13}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) - ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) - -# scaleoffset add - SET (arg ${FILE13} -f dset_none:SOFF=31,IN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) - ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) - -# scaleoffset remove - SET (arg ${FILE13} -f dset_scaleoffset:NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SCALEOFFSET) - ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) - -# remove all filters - SET (arg ${FILE11} -f NONE) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) - ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) - -#filter conversions - SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) - - SET (arg ${FILE7} -f dset_szip:GZIP=1) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) - -#limit - SET (arg ${FILE4} -f GZIP=1 -m 1024) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) - -#file - SET (arg ${FILE4} -e ${INFO_FILE}) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) - -######################################################### -# layout options (these files have no filters) -######################################################### - ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED --layout=dset2:CHUNK=20x10) - ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED -l CHUNK=20x10) - ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS -l dset2:CONTI) - ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI) - ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA) - ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA) - -################################################################ -# layout conversions (file has no filters) -############################################################### - ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS -l dset_compact:CONTI) - ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED -l dset_compact:CHUNK=2x5) - ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT -l dset_compact:COMPA) - ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT -l dset_contiguous:COMPA) - ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6) - ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI) - ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT -l dset_chunk:COMPA) - ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS -l dset_chunk:CONTI) - ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13) - -# test convert small size dataset ( < 1k) to compact layout without -m - ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT -l contig_small:COMPA) - ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA) - -#--------------------------------------------------------------------------- -# Test file contains chunked datasets (need multiple dsets) with -# unlimited max dims. (HDFFV-7933) -# Use first dset to test. -#--------------------------------------------------------------------------- -# chunk to chunk - specify chunk dim bigger than any current dim -ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) - -# chunk to contiguous -ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI) - -# chunk to compact - convert big dataset (should be > 64k) for this purpose, -# should remain as original layout (chunk) -ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA) - -#-------------------------------------------------------------------------- -# Test -f for some specific cases. Chunked dataset with unlimited max dims. -# (HDFFV-8012) -#-------------------------------------------------------------------------- -# - should not fail -# - should not change max dims from unlimit - -# chunk dim is bigger than dataset dim. ( dset size < 64k ) -ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE) - -# chunk dim is bigger than dataset dim. ( dset size > 64k ) -ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE) - -# chunk dims are smaller than dataset dims. ( dset size < 64k ) -ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE) - -# file input - should not fail -ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) - -#-------------------------------------------------------------------------- -# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset -# (dset size < 64K) and with unlimited max dims on a condition as follow. -# (HDFFV-8214) -#-------------------------------------------------------------------------- -# chunk dim is bigger than dataset dim. should succeed. -ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) -# chunk dim is smaller than dataset dim. should succeed. -ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) - - - -# Native option -# Do not use FILE1, as the named dtype will be converted to native, and h5diff will -# report a difference. - ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) - ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) - -# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) - -# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) - -# several global filters - SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) - SET (TESTTYPE "TEST") - IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) - ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) - -# syntax of -i infile -o outfile -# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) - SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) - SET (TESTTYPE "LEGACY") - IF (NOT USE_FILTER_DEFLATE) - SET (TESTTYPE "SKIP") - ENDIF (NOT USE_FILTER_DEFLATE) - ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) - -# add a userblock to file - SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) - ADD_H5_TEST (add_userblock "TEST" ${arg}) - -# add alignment - SET (arg ${FILE1} -t 1 -a 1) - ADD_H5_TEST (add_alignment "TEST" ${arg}) - -# Check repacking file with old version of layout message (should get upgraded -# to new version and be readable, etc.) - ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) - -# test for datum size > H5TOOLS_MALLOCSIZE - ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) - -# Check repacking file with committed datatypes in odd configurations - ADD_H5_TEST (committed_dt "TEST" ${FILE15}) - -# tests family driver (file is located in common testfiles folder, uses TOOLTEST1 - ADD_H5_TEST (family "TEST" ${FILE16}) - -# test various references (bug 1814 and 1726) - ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) - -# test attribute with various references (bug1797 / HDFFV-5932) -# the references in attribute of compund or vlen datatype - ADD_H5_TEST (HDFFV-5932 "TEST" ${FILE_ATTR_REF}) - -# Add test for memory leak in attirbute. This test is verified by CTEST. -# 1. leak from vlen string -# 2. leak from compound type without reference member -# (HDFFV-7840, ) -# Note: this test is experimental for sharing test file among tools - ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5) - -# tests for metadata block size option ('-M') - ADD_H5_TEST_META (meta_short h5repack_layout.h5 -M 8192) - ADD_H5_TEST_META (meta_long h5repack_layout.h5 --metadata_block_size=8192) - - IF (HDF5_TEST_VFD) - # Run test with different Virtual File Driver - FOREACH (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - ENDFOREACH (vfd ${VFD_LIST}) - ENDIF (HDF5_TEST_VFD) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) diff --git a/tools/h5repack/CMakeTests.cmake b/tools/h5repack/CMakeTests.cmake new file mode 100644 index 0000000..79d75a7 --- /dev/null +++ b/tools/h5repack/CMakeTests.cmake @@ -0,0 +1,937 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + IF (HDF5_TEST_VFD) + SET (VFD_LIST + sec2 + stdio + core + split + multi + family + ) + + IF (DIRECT_VFD) + SET (VFD_LIST ${VFD_LIST} direct) + ENDIF (DIRECT_VFD) + + MACRO (ADD_VFD_TEST vfdname resultcode) + ADD_TEST ( + NAME H5REPACK-VFD-${vfdname}-h5repacktest + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=h5repacktest" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake" + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + ENDMACRO (ADD_VFD_TEST) + ENDIF (HDF5_TEST_VFD) + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the source directory into the test directory + # -------------------------------------------------------------------- + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_attr_refs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_early.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fill.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fletcher.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_hlink.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout3.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_refs.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5 + # h5diff/testfile + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + # tools/testfiles + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00000.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00001.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00002.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00003.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00004.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00005.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00006.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00007.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00008.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00009.h5 + ${HDF5_TOOLS_SRC_DIR}/testfiles/tfamily00010.h5 + ) + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.bin + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/ublock.bin + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack.info + # tools/testfiles + ${HDF5_TOOLS_SRC_DIR}/testfiles/h5repack_filters.h5.ddl + ) + + FOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${h5_file}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repack + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_H5_TEST_OLD testname testtype testfile) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_OLD-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + ADD_TEST ( + NAME H5REPACK_OLD-${testname} + COMMAND $<TARGET_FILE:h5repack> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK_OLD-${testname}_DFF + COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST_OLD) + + MACRO (ADD_H5_TEST testname testtype testfile) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + ADD_TEST ( + NAME H5REPACK-${testname} + COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK-${testname}_DFF + COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST) + + MACRO (ADD_H5_CMP_TEST testname testfilter testtype resultcode resultfile) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_CMP-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5REPACK_CMP-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN} testfiles/${resultfile} testfiles/out-${testname}.${resultfile}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_CMP-${testname} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>" + -D "TEST_ARGS:STRING=${ARGN};testfiles/${resultfile};testfiles/out-${testname}.${resultfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${resultfile}-${testname}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=testfiles/${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_CMP_TEST) + + MACRO (ADD_H5_VERIFY_TEST testname testtype resultcode testfile testdset testfilter) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP -d ${testdset} -pH ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname} + COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF + COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) + IF (${resultcode} STREQUAL "0") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-d;${testdset};-pH;testfiles/out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${testfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" + ) + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + ELSE (${resultcode} STREQUAL "0") + IF (${testfilter} STREQUAL "CHUNKED") + SET (nottestfilter "(CONTIGUOUS|COMPACT)") + ENDIF (${testfilter} STREQUAL "CHUNKED") + IF (${testfilter} STREQUAL "CONTIGUOUS") + SET (nottestfilter "(CHUNK|COMPACT)") + ENDIF (${testfilter} STREQUAL "CONTIGUOUS") + IF (${testfilter} STREQUAL "COMPACT") + SET (nottestfilter "(CONTIGUOUS|CHUNK)") + ENDIF (${testfilter} STREQUAL "COMPACT") + ADD_TEST ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>" + -D "TEST_ARGS:STRING=-pH;testfiles/out-${testname}.${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=./testfiles/${testfile}-${testname}-v.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_FILTER:STRING=${nottestfilter}" + -D "TEST_REFERENCE=${testfilter}" + -P "${HDF5_RESOURCES_DIR}/grepTest.cmake" + ) + SET_TESTS_PROPERTIES (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + ENDIF (${resultcode} STREQUAL "0") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_VERIFY_TEST) + + MACRO (ADD_H5_TEST_META testname testfile) + ADD_TEST ( + NAME H5REPACK_META-${testname}_N + COMMAND $<TARGET_FILE:h5repack> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_N PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK_META-${testname}_M + COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 + ) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) + + ADD_TEST (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") + SET_TESTS_PROPERTIES (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) + ENDMACRO (ADD_H5_TEST_META) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # test file names + # -------------------------------------------------------------------- + SET (INFO_FILE testfiles/h5repack.info) + + SET (FILE0 h5repack_fill.h5) + SET (FILE1 h5repack_objs.h5) + SET (FILE2 h5repack_attr.h5) + SET (FILE3 h5repack_hlink.h5) + SET (FILE4 h5repack_layout.h5) + SET (FILE5 h5repack_early.h5) + SET (FILE7 h5repack_szip.h5) + SET (FILE8 h5repack_deflate.h5) + SET (FILE9 h5repack_shuffle.h5) + SET (FILE10 h5repack_fletcher.h5) + SET (FILE11 h5repack_filters.h5) + SET (FILE12 h5repack_nbit.h5) + SET (FILE13 h5repack_soffset.h5) + SET (FILE14 h5repack_layouto.h5 ) # A file with an older version of the layout message (copy of test/tlayouto.h5) + SET (FILE15 h5repack_named_dtypes.h5) + SET (FILE16 tfamily%05d.h5) # located in common testfiles folder + SET (FILE18 h5repack_layout2.h5) + SET (FILE_REF h5repack_refs.h5) + SET (FILE_ATTR_REF h5repack_attr_refs.h5) + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5REPACK-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out + ./testfiles/h5repack_filters.h5-gzip_verbose_filters.out.err + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out + ./testfiles/h5repack_layout.h5-chunk_18x13-v.out.err + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-chunk_compa-v.out + ./testfiles/h5repack_layout.h5-chunk_compa-v.out.err + ./testfiles/h5repack_layout.h5-chunk_conti-v.out + ./testfiles/h5repack_layout.h5-chunk_conti-v.out.err + ./testfiles/h5repack_layout.h5-compa-v.out + ./testfiles/h5repack_layout.h5-compa-v.out.err + ./testfiles/h5repack_layout.h5-conti-v.out + ./testfiles/h5repack_layout.h5-conti-v.out.err + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out + ./testfiles/h5repack_layout.h5-dset2_chunk_20x10-v.out.err + ./testfiles/h5repack_layout.h5-dset2_compa-v.out + ./testfiles/h5repack_layout.h5-dset2_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset2_conti-v.out + ./testfiles/h5repack_layout.h5-dset2_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_compa_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out + ./testfiles/h5repack_layout.h5-dset_compa_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out + ./testfiles/h5repack_layout.h5-dset_compa_conti-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out + ./testfiles/h5repack_layout.h5-dset_conti_chunk-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out + ./testfiles/h5repack_layout.h5-dset_conti_compa-v.out.err + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out + ./testfiles/h5repack_layout.h5-dset_conti_conti-v.out.err + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out + ./testfiles/h5repack_layout.h5-layout_long_switches-v.out.err + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out + ./testfiles/h5repack_layout.h5-layout_short_switches-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_compa-v.out.err + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out + ./testfiles/h5repack_layout2.h5-contig_small_fixed_compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out + ./testfiles/h5repack_layout3.h5-chunk2chunk-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out + ./testfiles/h5repack_layout3.h5-chunk2compa-v.out.err + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out + ./testfiles/h5repack_layout3.h5-chunk2conti-v.out.err + ./testfiles/h5repack_layout3.h5-error1-v.out + ./testfiles/h5repack_layout3.h5-error1-v.out.err + ./testfiles/h5repack_layout3.h5-error2-v.out + ./testfiles/h5repack_layout3.h5-error2-v.out.err + ./testfiles/h5repack_layout3.h5-error3-v.out + ./testfiles/h5repack_layout3.h5-error3-v.out.err + ./testfiles/out-family.tfamily%05d.h5 + ./testfiles/out-HDFFV-7840.h5diff_attr1.h5 + ./testfiles/out-attr.h5repack_attr.h5 + ./testfiles/out-native_attr.h5repack_attr.h5 + ./testfiles/out-HDFFV-5932.h5repack_attr_refs.h5 + ./testfiles/out-deflate_copy.h5repack_deflate.h5 + ./testfiles/out-deflate_remove.h5repack_deflate.h5 + ./testfiles/out-early.h5repack_early.h5 + ./testfiles/out-fill.h5repack_fill.h5 + ./testfiles/out-native_fill.h5repack_fill.h5 + ./testfiles/out-gzip_verbose_filters.h5repack_filters.h5 + ./testfiles/out-fletcher_copy.h5repack_fletcher.h5 + ./testfiles/out-fletcher_remove.h5repack_fletcher.h5 + ./testfiles/out-hlink.h5repack_hlink.h5 + ./testfiles/out-chunk_18x13.h5repack_layout.h5 + ./testfiles/out-chunk_20x10.h5repack_layout.h5 + ./testfiles/out-chunk_compa.h5repack_layout.h5 + ./testfiles/out-chunk_conti.h5repack_layout.h5 + ./testfiles/out-compa.h5repack_layout.h5 + ./testfiles/out-conti.h5repack_layout.h5 + ./testfiles/out-deflate_file.h5repack_layout.h5 + ./testfiles/out-deflate_limit.h5repack_layout.h5 + ./testfiles/out-dset2_chunk_20x10.h5repack_layout.h5 + ./testfiles/out-dset2_compa.h5repack_layout.h5 + ./testfiles/out-dset2_conti.h5repack_layout.h5 + ./testfiles/out-dset_compa_chunk.h5repack_layout.h5 + ./testfiles/out-dset_compa_compa.h5repack_layout.h5 + ./testfiles/out-dset_compa_conti.h5repack_layout.h5 + ./testfiles/out-dset_conti_chunk.h5repack_layout.h5 + ./testfiles/out-dset_conti_compa.h5repack_layout.h5 + ./testfiles/out-dset_conti_conti.h5repack_layout.h5 + ./testfiles/out-fletcher_all.h5repack_layout.h5 + ./testfiles/out-fletcher_individual.h5repack_layout.h5 + ./testfiles/out-global_filters.h5repack_layout.h5 + ./testfiles/out-gzip_all.h5repack_layout.h5 + ./testfiles/out-gzip_individual.h5repack_layout.h5 + ./testfiles/out-layout.h5repack_layout.h5 + ./testfiles/out-layout_long_switches.h5repack_layout.h5 + ./testfiles/out-layout_short_switches.h5repack_layout.h5 + ./testfiles/out-old_style_layout_short_switches.h5repack_layout.h5 + ./testfiles/out-shuffle_all.h5repack_layout.h5 + ./testfiles/out-shuffle_individual.h5repack_layout.h5 + ./testfiles/out-upgrade_layout.h5repack_layouto.h5 + ./testfiles/out-contig_small_compa.h5repack_layout2.h5 + ./testfiles/out-contig_small_fixed_compa.h5repack_layout2.h5 + ./testfiles/out-chunk2chunk.h5repack_layout3.h5 + ./testfiles/out-chunk2compa.h5repack_layout3.h5 + ./testfiles/out-chunk2conti.h5repack_layout3.h5 + ./testfiles/out-error1.h5repack_layout3.h5 + ./testfiles/out-error2.h5repack_layout3.h5 + ./testfiles/out-error3.h5repack_layout3.h5 + ./testfiles/out-error4.h5repack_layout3.h5 + ./testfiles/out-committed_dt.h5repack_named_dtypes.h5 + ./testfiles/out-nbit_add.h5repack_nbit.h5 + ./testfiles/out-nbit_copy.h5repack_nbit.h5 + ./testfiles/out-nbit_remove.h5repack_nbit.h5 + ./testfiles/out-add_alignment.h5repack_objs.h5 + ./testfiles/out-add_userblock.h5repack_objs.h5 + ./testfiles/out-objs.h5repack_objs.h5 + ./testfiles/out-gt_mallocsize.h5repack_objs.h5 + ./testfiles/out-bug1814.h5repack_refs.h5 + ./testfiles/out-shuffle_copy.h5repack_shuffle.h5 + ./testfiles/out-shuffle_remove.h5repack_shuffle.h5 + ./testfiles/out-scale_add.h5repack_soffset.h5 + ./testfiles/out-scale_copy.h5repack_soffset.h5 + ./testfiles/out-scale_remove.h5repack_soffset.h5 + ./testfiles/out-meta_short_M.meta_short.h5 + ./testfiles/out-meta_short_N.meta_short.h5 + ./testfiles/out-meta_long_M.meta_long.h5 + ./testfiles/out-meta_long_N.meta_long.h5 + # from the h5repacktst + h5repack_attr.h5 + h5repack_attr_out.h5 + h5repack_attr_refs.h5 + h5repack_big.h5 + h5repack_deflate.h5 + h5repack_deflate_out.h5 + h5repack_early2.h5 + h5repack_early.h5 + h5repack_early_out.h5 + h5repack_ext.h5 + h5repack_ext_out.h5 + h5repack_fill.h5 + h5repack_fill_out.h5 + h5repack_filters.h5 + h5repack_filters_out.h5 + h5repack_fletcher.h5 + h5repack_fletcher_out.h5 + h5repack_hlink.h5 + h5repack_hlink_out.h5 + h5repack_layout.h5 + h5repack_layout_out.h5 + h5repack_layout2.h5 + h5repack_layout3.h5 + h5repack_named_dtypes.h5 + h5repack_named_dtypes_out.h5 + h5repack_nbit.h5 + h5repack_nbit_out.h5 + h5repack_objs.h5 + h5repack_objs_out.h5 + h5repack_refs.h5 + h5repack_shuffle.h5 + h5repack_shuffle_out.h5 + h5repack_soffset.h5 + h5repack_soffset_out.h5 + h5repack_szip.h5 + h5repack_szip_out.h5 + h5repack_ub.h5 + h5repack_ub_out.h5 + h5repack_ext.bin + ublock.bin + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + + ADD_TEST (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) + IF (HDF5_ENABLE_SZIP_SUPPORT) + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (passRegex "yes") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "yes") + ELSE (HDF5_ENABLE_SZIP_ENCODING) + SET (passRegex "no") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + ELSE (HDF5_ENABLE_SZIP_SUPPORT) + SET (passRegex "no") + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") + ENDIF (HDF5_ENABLE_SZIP_SUPPORT) + SET_TESTS_PROPERTIES (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) + + ADD_TEST (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) + SET_TESTS_PROPERTIES (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) + SET (last_test "H5REPACK-h5repacktest") + +# +# The tests +# We use the files generated by h5repacktst +# Each run generates "<file>.out.h5" and the tool h5diff is used to +# compare the input and output files +# +# the tests are the same as the program h5repacktst, but run from the CLI +# + +# See which filters are usable (and skip tests for filters we +# don't have). Do this by searching H5pubconf.h to see which +# filters are defined. + +# detect whether the encoder is present. + SET (USE_FILTER_SZIP_ENCODER "no") + IF (HDF5_ENABLE_SZIP_ENCODING) + SET (USE_FILTER_SZIP_ENCODER ${testh5repack_detect_szip}) + ENDIF (HDF5_ENABLE_SZIP_ENCODING) + + IF (H5_HAVE_FILTER_DEFLATE) + SET (USE_FILTER_DEFLATE "true") + ENDIF (H5_HAVE_FILTER_DEFLATE) + + IF (H5_HAVE_FILTER_SZIP) + SET (USE_FILTER_SZIP "true") + ENDIF (H5_HAVE_FILTER_SZIP) + + IF (H5_HAVE_FILTER_SHUFFLE) + SET (USE_FILTER_SHUFFLE "true") + ENDIF (H5_HAVE_FILTER_SHUFFLE) + + IF (H5_HAVE_FILTER_FLETCHER32) + SET (USE_FILTER_FLETCHER32 "true") + ENDIF (H5_HAVE_FILTER_FLETCHER32) + + IF (H5_HAVE_FILTER_NBIT) + SET (USE_FILTER_NBIT "true") + ENDIF (H5_HAVE_FILTER_NBIT) + + IF (H5_HAVE_FILTER_SCALEOFFSET) + SET (USE_FILTER_SCALEOFFSET "true") + ENDIF (H5_HAVE_FILTER_SCALEOFFSET) + +# copy files (these files have no filters) + ADD_H5_TEST (fill "TEST" ${FILE0}) + ADD_H5_TEST (objs "TEST" ${FILE1}) + ADD_H5_TEST (attr "TEST" ${FILE2}) + ADD_H5_TEST (hlink "TEST" ${FILE3}) + ADD_H5_TEST (layout "TEST" ${FILE4}) + ADD_H5_TEST (early "TEST" ${FILE5}) + +# use $FILE4 to write some filters (this file has no filters) + +# gzip with individual object + SET (arg ${FILE4} -f dset1:GZIP=1 -l dset1:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (gzip_individual ${TESTTYPE} ${arg}) + +# gzip for all + SET (arg ${FILE4} -f GZIP=1) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (gzip_all ${TESTTYPE} ${arg}) + +# szip with individual object + SET (arg ${FILE4} -f dset2:SZIP=8,EC -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_individual ${TESTTYPE} ${arg}) + +# szip for all + SET (arg ${FILE4} -f SZIP=8,NN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_all ${TESTTYPE} ${arg}) + +# shuffle with individual object + SET (arg ${FILE4} -f dset2:SHUF -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_individual ${TESTTYPE} ${arg}) + +# shuffle for all + SET (arg ${FILE4} -f SHUF) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_all ${TESTTYPE} ${arg}) + +# fletcher32 with individual object + SET (arg ${FILE4} -f dset2:FLET -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_individual ${TESTTYPE} ${arg}) + +# fletcher32 for all + SET (arg ${FILE4} -f FLET) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_all ${TESTTYPE} ${arg}) + +# all filters + SET (arg ${FILE4} -f dset2:SHUF -f dset2:FLET -f dset2:SZIP=8,NN -f dset2:GZIP=1 -l dset2:CHUNK=20x10) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (all_filters ${TESTTYPE} ${arg}) + +# verbose gzip with individual object + SET (arg ${FILE11} -v -f /dset_deflate:GZIP=9) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_CMP_TEST (gzip_verbose_filters "O?...ing file[^\n]+\n" ${TESTTYPE} 0 ${arg}) + +########################################################### +# the following tests assume the input files have filters +########################################################### + +# szip copy + SET (arg ${FILE7}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_copy ${TESTTYPE} ${arg}) + +# szip remove + SET (arg ${FILE7} --filter=dset_szip:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP) + ADD_H5_TEST (szip_remove ${TESTTYPE} ${arg}) + +# deflate copy + SET (arg ${FILE8}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_copy ${TESTTYPE} ${arg}) + +# deflate remove + SET (arg ${FILE8} -f dset_deflate:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_remove ${TESTTYPE} ${arg}) + +# shuffle copy + SET (arg ${FILE9}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_copy ${TESTTYPE} ${arg}) + +# shuffle remove + SET (arg ${FILE9} -f dset_shuffle:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (shuffle_remove ${TESTTYPE} ${arg}) + +# fletcher32 copy + SET (arg ${FILE10}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_copy ${TESTTYPE} ${arg}) + +# fletcher32 remove + SET (arg ${FILE10} -f dset_fletcher32:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32) + ADD_H5_TEST (fletcher_remove ${TESTTYPE} ${arg}) + +# nbit copy + SET (arg ${FILE12}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_copy ${TESTTYPE} ${arg}) + +# nbit remove + SET (arg ${FILE12} -f dset_nbit:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_remove ${TESTTYPE} ${arg}) + +# nbit add + SET (arg ${FILE12} -f dset_int31:NBIT) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_NBIT) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_NBIT) + ADD_H5_TEST (nbit_add ${TESTTYPE} ${arg}) + +# scaleoffset copy + SET (arg ${FILE13}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_copy ${TESTTYPE} ${arg}) + +# scaleoffset add + SET (arg ${FILE13} -f dset_none:SOFF=31,IN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_add ${TESTTYPE} ${arg}) + +# scaleoffset remove + SET (arg ${FILE13} -f dset_scaleoffset:NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (scale_remove ${TESTTYPE} ${arg}) + +# remove all filters + SET (arg ${FILE11} -f NONE) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_FLETCHER32 OR NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SHUFFLE OR NOT USE_FILTER_NBIT OR NOT USE_FILTER_SCALEOFFSET) + ADD_H5_TEST (remove_all ${TESTTYPE} ${arg}) + +#filter conversions + SET (arg ${FILE8} -f dset_deflate:SZIP=8,NN) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_SZIP OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_convert ${TESTTYPE} ${arg}) + + SET (arg ${FILE7} -f dset_szip:GZIP=1) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_SZIP OR NOT USE_FILTER_SZIP_ENCODER OR NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (szip_convert ${TESTTYPE} ${arg}) + +#limit + SET (arg ${FILE4} -f GZIP=1 -m 1024) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_limit ${TESTTYPE} ${arg}) + +#file + SET (arg ${FILE4} -e ${INFO_FILE}) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST (deflate_file ${TESTTYPE} ${arg}) + +######################################################### +# layout options (these files have no filters) +######################################################### + ADD_H5_VERIFY_TEST (dset2_chunk_20x10 "TEST" 0 ${FILE4} dset2 CHUNKED --layout=dset2:CHUNK=20x10) + ADD_H5_VERIFY_TEST (chunk_20x10 "TEST" 1 ${FILE4} null CHUNKED -l CHUNK=20x10) + ADD_H5_VERIFY_TEST (dset2_conti "TEST" 0 ${FILE4} dset2 CONTIGUOUS -l dset2:CONTI) + ADD_H5_VERIFY_TEST (conti "TEST" 1 ${FILE4} null CONTIGUOUS -l CONTI) + ADD_H5_VERIFY_TEST (dset2_compa "TEST" 0 ${FILE4} dset2 COMPACT -l dset2:COMPA) + ADD_H5_VERIFY_TEST (compa "TEST" 1 ${FILE4} null COMPACT -l COMPA) + +################################################################ +# layout conversions (file has no filters) +############################################################### + ADD_H5_VERIFY_TEST (dset_compa_conti "TEST" 0 ${FILE4} dset_compact CONTIGUOUS -l dset_compact:CONTI) + ADD_H5_VERIFY_TEST (dset_compa_chunk "TEST" 0 ${FILE4} dset_compact CHUNKED -l dset_compact:CHUNK=2x5) + ADD_H5_VERIFY_TEST (dset_compa_compa "TEST" 0 ${FILE4} dset_compact COMPACT -l dset_compact:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_compa "TEST" 0 ${FILE4} dset_contiguous COMPACT -l dset_contiguous:COMPA) + ADD_H5_VERIFY_TEST (dset_conti_chunk "TEST" 0 ${FILE4} dset_contiguous CHUNKED -l dset_contiguous:CHUNK=3x6) + ADD_H5_VERIFY_TEST (dset_conti_conti "TEST" 0 ${FILE4} dset_contiguous CONTIGUOUS -l dset_contiguous:CONTI) + ADD_H5_VERIFY_TEST (chunk_compa "TEST" 0 ${FILE4} dset_chunk COMPACT -l dset_chunk:COMPA) + ADD_H5_VERIFY_TEST (chunk_conti "TEST" 0 ${FILE4} dset_chunk CONTIGUOUS -l dset_chunk:CONTI) + ADD_H5_VERIFY_TEST (chunk_18x13 "TEST" 0 ${FILE4} dset_chunk CHUNKED -l dset_chunk:CHUNK=18x13) + +# test convert small size dataset ( < 1k) to compact layout without -m + ADD_H5_VERIFY_TEST (contig_small_compa "TEST" 0 ${FILE18} contig_small COMPACT -l contig_small:COMPA) + ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT -l chunked_small_fixed:COMPA) + +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with +# unlimited max dims. (HDFFV-7933) +# Use first dset to test. +#--------------------------------------------------------------------------- +# chunk to chunk - specify chunk dim bigger than any current dim +ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) + +# chunk to contiguous +ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI) + +# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# should remain as original layout (chunk) +ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA) + +#-------------------------------------------------------------------------- +# Test -f for some specific cases. Chunked dataset with unlimited max dims. +# (HDFFV-8012) +#-------------------------------------------------------------------------- +# - should not fail +# - should not change max dims from unlimit + +# chunk dim is bigger than dataset dim. ( dset size < 64k ) +ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE) + +# chunk dim is bigger than dataset dim. ( dset size > 64k ) +ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE) + +# chunk dims are smaller than dataset dims. ( dset size < 64k ) +ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE) + +# file input - should not fail +ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) + +#-------------------------------------------------------------------------- +# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset +# (dset size < 64K) and with unlimited max dims on a condition as follow. +# (HDFFV-8214) +#-------------------------------------------------------------------------- +# chunk dim is bigger than dataset dim. should succeed. +ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) +# chunk dim is smaller than dataset dim. should succeed. +ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) + + + +# Native option +# Do not use FILE1, as the named dtype will be converted to native, and h5diff will +# report a difference. + ADD_H5_TEST (native_fill "TEST" ${FILE0} -n) + ADD_H5_TEST (native_attr "TEST" ${FILE2} -n) + +# latest file format with long switches. use FILE4=h5repack_layout.h5 (no filters) + SET (arg --layout CHUNK=20x10 --filter GZIP=1 --minimum=10 --native --latest --compact=8 --indexed=6 --ssize=8[:dtype]) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_VERIFY_TEST (layout_long_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) + +# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) + SET (arg -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_VERIFY_TEST (layout_short_switches ${TESTTYPE} 1 ${FILE4} null CHUNKED ${arg}) + +# several global filters + SET (arg ${FILE4} --filter GZIP=1 --filter SHUF) + SET (TESTTYPE "TEST") + IF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE OR NOT USE_FILTER_SHUFFLE) + ADD_H5_TEST (global_filters ${TESTTYPE} ${arg}) + +# syntax of -i infile -o outfile +# latest file format with short switches. use FILE4=h5repack_layout.h5 (no filters) + SET (arg ${FILE4} -l CHUNK=20x10 -f GZIP=1 -m 10 -n -L -c 8 -d 6 -s 8[:dtype]) + SET (TESTTYPE "LEGACY") + IF (NOT USE_FILTER_DEFLATE) + SET (TESTTYPE "SKIP") + ENDIF (NOT USE_FILTER_DEFLATE) + ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) + +# add a userblock to file + SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) + ADD_H5_TEST (add_userblock "TEST" ${arg}) + +# add alignment + SET (arg ${FILE1} -t 1 -a 1) + ADD_H5_TEST (add_alignment "TEST" ${arg}) + +# Check repacking file with old version of layout message (should get upgraded +# to new version and be readable, etc.) + ADD_H5_TEST (upgrade_layout "TEST" ${FILE14}) + +# test for datum size > H5TOOLS_MALLOCSIZE + ADD_H5_TEST (gt_mallocsize "TEST" ${FILE1} -f GZIP=1) + +# Check repacking file with committed datatypes in odd configurations + ADD_H5_TEST (committed_dt "TEST" ${FILE15}) + +# tests family driver (file is located in common testfiles folder, uses TOOLTEST1 + ADD_H5_TEST (family "TEST" ${FILE16}) + +# test various references (bug 1814 and 1726) + ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) + +# test attribute with various references (bug1797 / HDFFV-5932) +# the references in attribute of compund or vlen datatype + ADD_H5_TEST (HDFFV-5932 "TEST" ${FILE_ATTR_REF}) + +# Add test for memory leak in attirbute. This test is verified by CTEST. +# 1. leak from vlen string +# 2. leak from compound type without reference member +# (HDFFV-7840, ) +# Note: this test is experimental for sharing test file among tools + ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5) + +# tests for metadata block size option ('-M') + ADD_H5_TEST_META (meta_short h5repack_layout.h5 -M 8192) + ADD_H5_TEST_META (meta_long h5repack_layout.h5 --metadata_block_size=8192) + + IF (HDF5_TEST_VFD) + # Run test with different Virtual File Driver + FOREACH (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + ENDFOREACH (vfd ${VFD_LIST}) + ENDIF (HDF5_TEST_VFD) diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index f61c961..921b390 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -241,7 +241,7 @@ static void usage(const char *prog) printf(" <layout type> can be:\n"); printf(" CHUNK, to apply chunking layout\n"); printf(" COMPA, to apply compact layout\n"); - printf(" CONTI, to apply continuous layout\n"); + printf(" CONTI, to apply contiguous layout\n"); printf(" <layout parameters> is optional layout information\n"); printf(" CHUNK=DIM[xDIM...xDIM], the chunk size of each dimension\n"); printf(" COMPA (no parameter)\n"); diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index 00e4bea..bcddbb9 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -388,7 +388,7 @@ pack_info_t* options_get_object( const char *path, pack_opttbl_t *table ) { unsigned int i; - const char tbl_path[MAX_NC_NAME+1]; /* +1 for start with "/" case */ + char tbl_path[MAX_NC_NAME+1]; /* +1 for start with "/" case */ for ( i = 0; i < table->nelems; i++) diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 70eadd2..9f798e9 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -460,7 +460,7 @@ obj_list_t* parse_filter(const char *str, * chunked. NULL, on error * the layout type can be: * CHUNK, to apply chunking layout - * CONTI, to apply continuous layout + * CONTI, to apply contiguous layout * COMPA, to apply compact layout * * Example: diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 78f39dd..6086fc2 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -17,12 +17,6 @@ SET_TARGET_PROPERTIES (h5stat PROPERTIES FOLDER tools) SET (H5_DEP_EXECUTABLES h5stat) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the h5stat test executables @@ -36,165 +30,8 @@ IF (BUILD_TESTING) #ADD_TEST (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the test directory into the source directory - # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES - h5stat_help1.ddl - h5stat_help2.ddl - h5stat_notexist.ddl - h5stat_filters.ddl - h5stat_filters-file.ddl - h5stat_filters-F.ddl - h5stat_filters-d.ddl - h5stat_filters-g.ddl - h5stat_filters-dT.ddl - h5stat_filters-UD.ddl - h5stat_filters-UT.ddl - h5stat_tsohm.ddl - h5stat_newgrat.ddl - h5stat_newgrat-UG.ddl - h5stat_newgrat-UA.ddl - ) - SET (HDF5_REFERENCE_TEST_FILES - h5stat_filters.h5 - h5stat_tsohm.h5 - h5stat_newgrat.h5 - ) - - FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") - #MESSAGE (STATUS " Translating ${ddl_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5stat - POST_BUILD - COMMAND ${XLATE_UTILITY} - ARGS ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 - ) - ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) - - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5stat - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} - ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_H5_TEST resultfile resultcode) - # If using memchecker add tests without using scripts - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) - IF (NOT ${resultcode} STREQUAL "0") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") - ENDIF (NOT ${resultcode} STREQUAL "0") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5STAT-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err - ) - ADD_TEST ( - NAME H5STAT-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>" - -D "TEST_ARGS=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.ddl" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST file) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - IF (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5STAT-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5stat_help1.out - h5stat_help1.out.err - h5stat_help2.out - h5stat_help2.out.err - h5stat_notexist.out - h5stat_notexist.out.err - h5stat_filters.out - h5stat_filters.out.err - h5stat_filters-file.out - h5stat_filters-file.out.err - h5stat_filters-F.out - h5stat_filters-F.out.err - h5stat_filters-d.out - h5stat_filters-d.out.err - h5stat_filters-g.out - h5stat_filters-g.out.err - h5stat_filters-dT.out - h5stat_filters-dT.out.err - h5stat_filters-UD.out - h5stat_filters-UD.out.err - h5stat_filters-UT.out - h5stat_filters-UT.out.err - h5stat_tsohm.out - h5stat_tsohm.out.err - h5stat_newgrat.out - h5stat_newgrat.out.err - h5stat_newgrat-UG.out - h5stat_newgrat-UG.out.err - h5stat_newgrat-UA.out - h5stat_newgrat-UA.out.err - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5STAT-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - -# Test for help flag - ADD_H5_TEST (h5stat_help1 0 -h) - ADD_H5_TEST (h5stat_help2 0 --help) - -# Test when h5stat a file that does not exist - ADD_H5_TEST (h5stat_notexist 1 notexist.h5) -# Test file with groups, compressed datasets, user-applied fileters, etc. -# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 - ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-file 0 -f h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-F 0 -F h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-d 0 -d h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-g 0 -g h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) - ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) -# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c -# as of release 1.8.0-alpha4 - ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) -# h5stat_newgrat.h5 is generated by h5stat_gentest.c - ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) - ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5) - ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/h5stat/CMakeTests.cmake b/tools/h5stat/CMakeTests.cmake new file mode 100644 index 0000000..0e4315f --- /dev/null +++ b/tools/h5stat/CMakeTests.cmake @@ -0,0 +1,257 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the test directory into the source directory + # -------------------------------------------------------------------- + SET (HDF5_REFERENCE_FILES + h5stat_help1.ddl + h5stat_help2.ddl + h5stat_notexist.ddl + h5stat_nofile.ddl + h5stat_filters.ddl + h5stat_filters-file.ddl + h5stat_filters-F.ddl + h5stat_filters-d.ddl + h5stat_filters-g.ddl + h5stat_filters-dT.ddl + h5stat_filters-UD.ddl + h5stat_filters-UT.ddl + h5stat_tsohm.ddl + h5stat_newgrat.ddl + h5stat_newgrat-UG.ddl + h5stat_newgrat-UA.ddl + h5stat_err1_links.ddl + h5stat_links1.ddl + h5stat_links2.ddl + h5stat_links3.ddl + h5stat_links4.ddl + h5stat_links5.ddl + h5stat_err1_dims.ddl + h5stat_dims1.ddl + h5stat_dims2.ddl + h5stat_err1_numattrs.ddl + h5stat_err2_numattrs.ddl + h5stat_numattrs1.ddl + h5stat_numattrs2.ddl + h5stat_numattrs3.ddl + h5stat_numattrs4.ddl + ) + SET (HDF5_REFERENCE_TEST_FILES + h5stat_filters.h5 + h5stat_tsohm.h5 + h5stat_newgrat.h5 + h5stat_threshold.h5 + ) + + FOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + SET (ddldest "${PROJECT_BINARY_DIR}/${ddl_file}") + #MESSAGE (STATUS " Translating ${ddl_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5stat + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${ddl_file} ${ddldest} -l3 + ) + ENDFOREACH (ddl_file ${HDF5_REFERENCE_FILES}) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5stat + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_H5STAT_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_H5_TEST resultfile resultcode) + # If using memchecker add tests without using scripts + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat> ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5STAT-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${resultfile}.out ${resultfile}.out.err + ) + ADD_TEST ( + NAME H5STAT-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>" + -D "TEST_ARGS=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.ddl" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS "H5STAT-${resultfile}-clear-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST file) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + IF (HDF5_ENABLE_USING_MEMCHECKER) + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5STAT-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5stat_help1.out + h5stat_help1.out.err + h5stat_help2.out + h5stat_help2.out.err + h5stat_notexist.out + h5stat_notexist.out.err + h5stat_nofile.out + h5stat_nofile.out.err + h5stat_filters.out + h5stat_filters.out.err + h5stat_filters-file.out + h5stat_filters-file.out.err + h5stat_filters-F.out + h5stat_filters-F.out.err + h5stat_filters-d.out + h5stat_filters-d.out.err + h5stat_filters-g.out + h5stat_filters-g.out.err + h5stat_filters-dT.out + h5stat_filters-dT.out.err + h5stat_filters-UD.out + h5stat_filters-UD.out.err + h5stat_filters-UT.out + h5stat_filters-UT.out.err + h5stat_tsohm.out + h5stat_tsohm.out.err + h5stat_newgrat.out + h5stat_newgrat.out.err + h5stat_newgrat-UG.out + h5stat_newgrat-UG.out.err + h5stat_newgrat-UA.out + h5stat_newgrat-UA.out.err + h5stat_err1_links.out + h5stat_err1_links.out.err + h5stat_links1.out + h5stat_links1.out.err + h5stat_links2.out + h5stat_links2.out.err + h5stat_links3.out + h5stat_links3.out.err + h5stat_links4.out + h5stat_links4.out.err + h5stat_links5.out + h5stat_links5.out.err + h5stat_err1_dims.out + h5stat_err1_dims.out.err + h5stat_dims1.out + h5stat_dims1.out.err + h5stat_dims2.out + h5stat_dims2.out.err + h5stat_err1_numattrs.out + h5stat_err1_numattrs.out.err + h5stat_err2_numattrs.out + h5stat_err2_numattrs.out.err + h5stat_numattrs1.out + h5stat_numattrs1.out.err + h5stat_numattrs2.out + h5stat_numattrs2.out.err + h5stat_numattrs3.out + h5stat_numattrs3.out.err + h5stat_numattrs4.out + h5stat_numattrs4.out.err + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5STAT-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + +# Test for help flag + ADD_H5_TEST (h5stat_help1 0 -h) + ADD_H5_TEST (h5stat_help2 0 --help) + +# Test when h5stat a file that does not exist + ADD_H5_TEST (h5stat_notexist 1 notexist.h5) + ADD_H5_TEST (h5stat_nofile 1 '') + +# Test file with groups, compressed datasets, user-applied fileters, etc. +# h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-file 0 -f h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-F 0 -F h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-d 0 -d h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-g 0 -g h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-dT 0 -dT h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UD 0 -D h5stat_filters.h5) + ADD_H5_TEST (h5stat_filters-UT 0 -T h5stat_filters.h5) +# h5stat_tsohm.h5 is a copy of ../../../test/tsohm.h5 generated by tsohm.c +# as of release 1.8.0-alpha4 + ADD_H5_TEST (h5stat_tsohm 0 h5stat_tsohm.h5) +# h5stat_newgrat.h5 is generated by h5stat_gentest.c + ADD_H5_TEST (h5stat_newgrat 0 h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UG 0 -G h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_newgrat-UA 0 -A h5stat_newgrat.h5) +# +# Tests for -l (--links) option on h5stat_threshold.h5: +# -l 0 (incorrect threshold value) +# -g -l 8 +# --links=8 +# --links=20 -g + ADD_H5_TEST (h5stat_err1_links 1 -l 0 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_links1 0 -g -l 8 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_links2 0 --links=8 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_links3 0 --links=20 -g h5stat_threshold.h5) +# +# Tests for -l (--links) option on h5stat_newgrat.h5: +# -g +# -g -l 40000 + ADD_H5_TEST (h5stat_links4 0 -g h5stat_newgrat.h5) + ADD_H5_TEST (h5stat_links5 0 -g -l 40000 h5stat_newgrat.h5) +# +# Tests for -m (--dims) option on h5stat_threshold.h5 +# -d --dims=-1 (incorrect threshold value) +# -gd -m 5 +# -d --di=15 + ADD_H5_TEST (h5stat_err1_dims 1 -d --dims=-1 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_dims1 0 -gd -m 5 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_dims2 0 -d --di=15 h5stat_threshold.h5) +# +# Tests for -a option on h5stat_threshold.h5 +# -a -2 (incorrect threshold value) +# --numattrs (without threshold value) +# -AS -a 10 +# -a 1 +# -A --numattrs=25 + ADD_H5_TEST (h5stat_err1_numattrs 1 -a -2 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_err2_numattrs 1 --numattrs h5stat_threshold.h5) + ADD_H5_TEST (h5stat_numattrs1 0 -AS -a 10 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_numattrs2 0 -a 1 h5stat_threshold.h5) + ADD_H5_TEST (h5stat_numattrs3 0 -A --numattrs=25 h5stat_threshold.h5) +# +# Tests for -a option on h5stat_newgrat.h5 +# -A -a 100 + ADD_H5_TEST (h5stat_numattrs4 0 -A -a 100 h5stat_newgrat.h5) +# +
\ No newline at end of file diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index dcc2c08..a5d7eef 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -26,10 +26,13 @@ #define PROGRAMNAME "h5stat" /* Parameters to control statistics gathered */ -#define SIZE_SMALL_GROUPS 10 -#define SIZE_SMALL_ATTRS 10 -#define SIZE_SMALL_DSETS 10 -#define SIZE_SMALL_SECTS 10 + +/* Default threshold for small groups/datasets/attributes */ +#define DEF_SIZE_SMALL_GROUPS 10 +#define DEF_SIZE_SMALL_DSETS 10 +#define DEF_SIZE_SMALL_ATTRS 10 + +#define SIZE_SMALL_SECTS 10 #define H5_NFILTERS_IMPL 8 /* Number of currently implemented filters + one to accommodate for user-define filters + one @@ -69,22 +72,22 @@ typedef struct iter_t { unsigned long max_links; /* Maximum # of links to an object */ hsize_t max_fanout; /* Maximum fanout from a group */ - unsigned long num_small_groups[SIZE_SMALL_GROUPS]; /* Size of small groups tracked */ + unsigned long *num_small_groups; /* Size of small groups tracked */ unsigned group_nbins; /* Number of bins for group counts */ unsigned long *group_bins; /* Pointer to array of bins for group counts */ ohdr_info_t group_ohdr_info; /* Object header information for groups */ - hsize_t max_attrs; /* Maximum attributes from a group */ - unsigned long num_small_attrs[SIZE_SMALL_ATTRS]; /* Size of small attributes tracked */ + hsize_t max_attrs; /* Maximum attributes from a group */ + unsigned long *num_small_attrs; /* Size of small attributes tracked */ unsigned attr_nbins; /* Number of bins for attribute counts */ unsigned long *attr_bins; /* Pointer to array of bins for attribute counts */ unsigned max_dset_rank; /* Maximum rank of dataset */ unsigned long dset_rank_count[H5S_MAX_RANK]; /* Number of datasets of each rank */ hsize_t max_dset_dims; /* Maximum dimension size of dataset */ - unsigned long small_dset_dims[SIZE_SMALL_DSETS]; /* Size of dimensions of small datasets tracked */ + unsigned long *small_dset_dims; /* Size of dimensions of small datasets tracked */ unsigned long dset_layouts[H5D_NLAYOUTS]; /* Type of storage for each dataset */ - unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */ + unsigned long dset_comptype[H5_NFILTERS_IMPL]; /* Number of currently implemented filters */ unsigned long dset_ntypes; /* Number of diff. dataset datatypes found */ dtype_info_t *dset_type_info; /* Pointer to dataset datatype information found */ unsigned dset_dim_nbins; /* Number of bins for dataset dimensions */ @@ -134,15 +137,19 @@ static int display_dset_metadata = FALSE; /* display file space info f static int display_object = FALSE; /* not implemented yet */ +/* Initialize threshold for small groups/datasets/attributes */ +static int sgroups_threshold = DEF_SIZE_SMALL_GROUPS; +static int sdsets_threshold = DEF_SIZE_SMALL_DSETS; +static int sattrs_threshold = DEF_SIZE_SMALL_ATTRS; + /* a structure for handling the order command-line parameters come in */ struct handler_t { size_t obj_count; char **obj; }; - -static const char *s_opts ="ADdFfhGgsSTO:V"; -/* e.g. "filemetadata" has to precedue "file"; "groupmetadata" has to precede "group" etc. */ +static const char *s_opts ="Aa:Ddm:FfhGgl:sSTO:V"; +/* e.g. "filemetadata" has to precede "file"; "groupmetadata" has to precede "group" etc. */ static struct long_options l_opts[] = { {"help", no_arg, 'h'}, {"hel", no_arg, 'h'}, @@ -170,6 +177,10 @@ static struct long_options l_opts[] = { {"grou", no_arg, 'g'}, {"gro", no_arg, 'g'}, {"gr", no_arg, 'g'}, + { "links", require_arg, 'l' }, + { "link", require_arg, 'l' }, + { "lin", require_arg, 'l' }, + { "li", require_arg, 'l' }, {"dsetmetadata", no_arg, 'D'}, {"dsetmetadat", no_arg, 'D'}, {"dsetmetada", no_arg, 'D'}, @@ -181,6 +192,9 @@ static struct long_options l_opts[] = { {"dset", no_arg, 'd'}, {"dse", no_arg, 'd'}, {"ds", no_arg, 'd'}, + {"dims", require_arg, 'm'}, + {"dim", require_arg, 'm'}, + {"di", require_arg, 'm'}, {"dtypemetadata", no_arg, 'T'}, {"dtypemetadat", no_arg, 'T'}, {"dtypemetada", no_arg, 'T'}, @@ -212,6 +226,13 @@ static struct long_options l_opts[] = { { "attr", no_arg, 'A' }, { "att", no_arg, 'A' }, { "at", no_arg, 'A' }, + { "numattrs", require_arg, 'a' }, + { "numattr", require_arg, 'a' }, + { "numatt", require_arg, 'a' }, + { "numat", require_arg, 'a' }, + { "numa", require_arg, 'a' }, + { "num", require_arg, 'a' }, + { "nu", require_arg, 'a' }, { "freespace", no_arg, 's' }, { "freespac", no_arg, 's' }, { "freespa", no_arg, 's' }, @@ -237,6 +258,16 @@ leave(int ret) } + +/*------------------------------------------------------------------------- + * Function: usage + * + * Purpose: Compute the ceiling of log_10(x) + * + * Return: >0 on success, 0 on failure + * + *------------------------------------------------------------------------- + */ static void usage(const char *prog) { HDfflush(stdout); @@ -248,11 +279,20 @@ static void usage(const char *prog) HDfprintf(stdout, " -f, --file Print file information\n"); HDfprintf(stdout, " -F, --filemetadata Print file space information for file's metadata\n"); HDfprintf(stdout, " -g, --group Print group information\n"); + HDfprintf(stdout, " -l N, --links=N Set the threshold for the # of links when printing\n"); + HDfprintf(stdout, " information for small groups. N is an integer greater\n"); + HDfprintf(stdout, " than 0. The default threshold is 10.\n"); HDfprintf(stdout, " -G, --groupmetadata Print file space information for groups' metadata\n"); HDfprintf(stdout, " -d, --dset Print dataset information\n"); + HDfprintf(stdout, " -m N, --dims=N Set the threshold for the dimension sizes when printing\n"); + HDfprintf(stdout, " information for small datasets. N is an integer greater\n"); + HDfprintf(stdout, " than 0. The default threshold is 10.\n"); HDfprintf(stdout, " -D, --dsetmetadata Print file space information for datasets' metadata\n"); HDfprintf(stdout, " -T, --dtypemetadata Print datasets' datatype information\n"); HDfprintf(stdout, " -A, --attribute Print attribute information\n"); + HDfprintf(stdout, " -a N, --numattrs=N Set the threshold for the # of attributes when printing\n"); + HDfprintf(stdout, " information for small # of attributes. N is an integer greater\n"); + HDfprintf(stdout, " than 0. The default threshold is 10.\n"); HDfprintf(stdout, " -s, --freespace Print free space information\n"); HDfprintf(stdout, " -S, --summary Print summary of file space information\n"); } @@ -268,8 +308,6 @@ static void usage(const char *prog) * Programmer: Quincey Koziol * Monday, August 22, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ static unsigned @@ -311,7 +349,7 @@ attribute_stats(iter_t *iter, const H5O_info_t *oi) iter->attrs_heap_storage_size += oi->meta_size.attr.heap_size; /* Update small # of attribute count & limits */ - if(oi->num_attrs < SIZE_SMALL_ATTRS) + if(oi->num_attrs <= (hsize_t)sattrs_threshold) (iter->num_small_attrs[(size_t)oi->num_attrs])++; if(oi->num_attrs > iter->max_attrs) iter->max_attrs = oi->num_attrs; @@ -382,8 +420,10 @@ group_stats(iter_t *iter, const char *name, const H5O_info_t *oi) HDassert(ret >= 0); /* Update link stats */ - if(ginfo.nlinks < SIZE_SMALL_GROUPS) + /* Collect statistics for small groups */ + if(ginfo.nlinks < (hsize_t)sgroups_threshold) (iter->num_small_groups[(size_t)ginfo.nlinks])++; + /* Determine maximum link count */ if(ginfo.nlinks > iter->max_fanout) iter->max_fanout = ginfo.nlinks; @@ -514,8 +554,11 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Only gather dim size statistics on 1-D datasets */ if(ndims == 1) { - iter->max_dset_dims = dims[0]; - if(dims[0] < SIZE_SMALL_DSETS) + /* Determine maximum dimension size */ + if(dims[0] > iter->max_dset_dims) + iter->max_dset_dims = dims[0]; + /* Collect statistics for small datasets */ + if(dims[0] < (hsize_t)sdsets_threshold) (iter->small_dset_dims[(size_t)dims[0]])++; /* Add dim count to proper bin */ @@ -871,6 +914,18 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) display_group = TRUE; break; + case 'l': + if(opt_arg) { + sgroups_threshold = HDatoi(opt_arg); + if(sgroups_threshold < 1) { + error_msg("Invalid threshold for small groups\n"); + goto error; + } + } else + error_msg("Missing threshold for small groups\n"); + + break; + case 'D': display_all = FALSE; display_dset_metadata = TRUE; @@ -881,6 +936,18 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) display_dset = TRUE; break; + case 'm': + if(opt_arg) { + sdsets_threshold = HDatoi(opt_arg); + if(sdsets_threshold < 1) { + error_msg("Invalid threshold for small datasets\n"); + goto error; + } + } else + error_msg("Missing threshold for small datasets\n"); + + break; + case 'T': display_all = FALSE; display_dset_dtype_meta = TRUE; @@ -891,6 +958,18 @@ parse_command_line(int argc, const char *argv[], struct handler_t **hand_ret) display_attr = TRUE; break; + case 'a': + if(opt_arg) { + sattrs_threshold = HDatoi(opt_arg); + if(sattrs_threshold < 1) { + error_msg("Invalid threshold for small # of attributes\n"); + goto error; + } + } else + error_msg("Missing threshold for small # of attributes\n"); + + break; + case 's': display_all = FALSE; display_free_sections = TRUE; @@ -967,18 +1046,31 @@ error: static void iter_free(iter_t *iter) { + /* Clear array of bins for group counts */ if(iter->group_bins) { HDfree(iter->group_bins); iter->group_bins = NULL; } /* end if */ + /* Clear array for tracking small groups */ + if(iter->num_small_groups) { + HDfree(iter->num_small_groups); + iter->num_small_groups = NULL; + } /* end if */ + /* Clear array of bins for attribute counts */ if(iter->attr_bins) { HDfree(iter->attr_bins); iter->attr_bins = NULL; } /* end if */ + /* Clear array for tracking small attributes */ + if(iter->num_small_attrs) { + HDfree(iter->num_small_attrs); + iter->num_small_attrs= NULL; + } /* end if */ + /* Clear dataset datatype information found */ if(iter->dset_type_info) { HDfree(iter->dset_type_info); @@ -991,6 +1083,12 @@ iter_free(iter_t *iter) iter->dset_dim_bins = NULL; } /* end if */ + /* Clear array of tracking 1-D small datasets */ + if(iter->small_dset_dims) { + HDfree(iter->small_dset_dims); + iter->small_dset_dims = NULL; + } /* end if */ + /* Clear array of bins for free-space section sizes */ if(iter->sect_bins) { HDfree(iter->sect_bins); @@ -1117,11 +1215,11 @@ print_group_info(const iter_t *iter) unsigned long total; /* Total count for various statistics */ unsigned u; /* Local index variable */ - printf("Small groups:\n"); + printf("Small groups (with 0 to %u links):\n", sgroups_threshold-1); total = 0; - for(u = 0; u < SIZE_SMALL_GROUPS; u++) { + for(u = 0; u < (unsigned)sgroups_threshold; u++) { if(iter->num_small_groups[u] > 0) { - printf("\t# of groups of size %u: %lu\n", u, iter->num_small_groups[u]); + printf("\t# of groups with %u link(s): %lu\n", u, iter->num_small_groups[u]); total += iter->num_small_groups[u]; } /* end if */ } /* end for */ @@ -1130,13 +1228,13 @@ print_group_info(const iter_t *iter) printf("Group bins:\n"); total = 0; if((iter->group_nbins > 0) && (iter->group_bins[0] > 0)) { - printf("\t# of groups of size 0: %lu\n", iter->group_bins[0]); + printf("\t# of groups with 0 link: %lu\n", iter->group_bins[0]); total = iter->group_bins[0]; } /* end if */ power = 1; for(u = 1; u < iter->group_nbins; u++) { if(iter->group_bins[u] > 0) { - printf("\t# of groups of size %lu - %lu: %lu\n", power, (power * 10) - 1, + printf("\t# of groups with %lu - %lu links: %lu\n", power, (power * 10) - 1, iter->group_bins[u]); total += iter->group_bins[u]; } /* end if */ @@ -1207,29 +1305,29 @@ print_dataset_info(const iter_t *iter) printf("1-D Dataset information:\n"); HDfprintf(stdout, "\tMax. dimension size of 1-D datasets: %Hu\n", iter->max_dset_dims); - printf("\tSmall 1-D datasets:\n"); + printf("\tSmall 1-D datasets (with dimension sizes 0 to %u):\n", sdsets_threshold - 1); total = 0; - for(u = 0; u < SIZE_SMALL_DSETS; u++) { + for(u = 0; u < (unsigned)sdsets_threshold; u++) { if(iter->small_dset_dims[u] > 0) { - printf("\t\t# of dataset dimensions of size %u: %lu\n", u, + printf("\t\t# of datasets with dimension sizes %u: %lu\n", u, iter->small_dset_dims[u]); total += iter->small_dset_dims[u]; } /* end if */ } /* end for */ - printf("\t\tTotal small datasets: %lu\n", total); + printf("\t\tTotal # of small datasets: %lu\n", total); /* Protect against no datasets in file */ if(iter->dset_dim_nbins > 0) { printf("\t1-D Dataset dimension bins:\n"); total = 0; if(iter->dset_dim_bins[0] > 0) { - printf("\t\t# of datasets of size 0: %lu\n", iter->dset_dim_bins[0]); + printf("\t\t# of datasets with dimension size 0: %lu\n", iter->dset_dim_bins[0]); total = iter->dset_dim_bins[0]; } /* end if */ power = 1; for(u = 1; u < iter->dset_dim_nbins; u++) { if(iter->dset_dim_bins[u] > 0) { - printf("\t\t# of datasets of size %lu - %lu: %lu\n", power, (power * 10) - 1, + printf("\t\t# of datasets with dimension size %lu - %lu: %lu\n", power, (power * 10) - 1, iter->dset_dim_bins[u]); total += iter->dset_dim_bins[u]; } /* end if */ @@ -1346,8 +1444,6 @@ print_dset_dtype_meta(const iter_t *iter) * Programmer: Vailin Choi * July 12, 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1357,9 +1453,9 @@ print_attr_info(const iter_t *iter) unsigned long total; /* Total count for various statistics */ unsigned u; /* Local index variable */ - printf("Small # of attributes:\n"); + printf("Small # of attributes (objects with 1 to %u attributes):\n", sattrs_threshold); total = 0; - for(u = 1; u < SIZE_SMALL_ATTRS; u++) { + for(u = 1; u <= (unsigned)sattrs_threshold; u++) { if(iter->num_small_attrs[u] > 0) { printf("\t# of objects with %u attributes: %lu\n", u, iter->num_small_attrs[u]); total += iter->num_small_attrs[u]; @@ -1660,6 +1756,16 @@ main(int argc, const char *argv[]) iter.free_hdr = finfo.free.meta_size; } /* end else */ + iter.num_small_groups = (unsigned long *)calloc((size_t)sgroups_threshold, sizeof(unsigned long)); + iter.num_small_attrs = (unsigned long *)calloc((size_t)(sattrs_threshold+1), sizeof(unsigned long)); + iter.small_dset_dims = (unsigned long *)calloc((size_t)sdsets_threshold, sizeof(unsigned long)); + + if(iter.num_small_groups == NULL || iter.num_small_attrs == NULL || iter.small_dset_dims == NULL) { + error_msg("Unable to allocate memory for tracking small groups/datasets/attributes\n"); + h5tools_setstatus(EXIT_FAILURE); + goto done; + } + if((fcpl = H5Fget_create_plist(fid)) < 0) warn_msg("Unable to retrieve file creation property\n"); diff --git a/tools/h5stat/h5stat_gentest.c b/tools/h5stat/h5stat_gentest.c index a7bb4b0..5ad73f7 100644 --- a/tools/h5stat/h5stat_gentest.c +++ b/tools/h5stat/h5stat_gentest.c @@ -16,88 +16,325 @@ /* * Generate the binary hdf5 files for the h5stat tests. * Usage: just execute the program without any arguments will - * generate all the binary hdf5 files in the ./testfiles directory. + * generate all the binary hdf5 files * * If you regenerate the test files (e.g., changing some code, * trying it on a new platform, ...), you need to verify the correctness * of the expected output and update the corresponding *.ddl files. */ - -#include <assert.h> #include "hdf5.h" -#define FILE "h5stat_newgrat.h5" +/* For gen_newgrat_file() */ +#define NEWGRAT_FILE "h5stat_newgrat.h5" #define DATASET_NAME "DATASET_NAME" #define GROUP_NAME "GROUP" #define ATTR_NAME "ATTR" #define NUM_GRPS 35000 #define NUM_ATTRS 100 +/* For gen_threshold_file() */ +#define THRESHOLD_FILE "h5stat_threshold.h5" +#define THRES_ATTR_NAME "attr" +#define THRES_ATTR_GRP_NAME "grp_attr" +#define THRES_DSET_NAME "dset" +#define THRES_NUM 10 +#define THRES_NUM_25 25 + /* - * Generate 1.8 HDF5 file - * with NUM_GRPS groups - * with NUM_ATTRS attributes on the dataset + * Generate HDF5 file with latest format with + * NUM_GRPS groups and NUM_ATTRS attributes for the dataset + * */ -static void gen_file(void) +static void +gen_newgrat_file(const char *fname) { - hid_t fcpl; /* File creation property */ - hid_t fapl; /* File access property */ - hid_t file; /* File id */ - hid_t gid; /* Group id */ - hid_t type_id; /* Datatype id */ - hid_t space_id; /* Dataspace id */ - hid_t attr_id; /* Attribute id */ - hid_t dset_id; /* Dataset id */ - char name[30]; /* Group name */ - char attrname[30]; /* Attribute name */ - int ret; /* Return value */ - int i; /* Local index variable */ - - fapl = H5Pcreate(H5P_FILE_ACCESS); - ret = H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - assert(ret >= 0); + hid_t fcpl; /* File creation property */ + hid_t fapl; /* File access property */ + hid_t fid; /* File id */ + hid_t gid; /* Group id */ + hid_t tid; /* Datatype id */ + hid_t sid; /* Dataspace id */ + hid_t attr_id; /* Attribute id */ + hid_t did; /* Dataset id */ + char name[30]; /* Group name */ + char attrname[30]; /* Attribute name */ + int i; /* Local index variable */ + + /* Get a copy file access property list */ + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto error; + + /* Set to use latest library format */ + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + goto error; + + /* Get a copy of file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + goto error; /* Set file space handling strategy */ - fcpl = H5Pcreate(H5P_FILE_CREATE); - ret = H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0); - assert(ret >= 0); + if(H5Pset_file_space(fcpl, H5F_FILE_SPACE_ALL_PERSIST, (hsize_t)0) < 0) + goto error; + + /* Create file */ + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0) + goto error; - /* Create dataset */ - file = H5Fcreate(FILE, H5F_ACC_TRUNC, fcpl, fapl); + /* Create NUM_GRPS groups in the root group */ for(i = 1; i <= NUM_GRPS; i++) { sprintf(name, "%s%d", GROUP_NAME,i); - gid = H5Gcreate2(file, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Gclose(gid); + if((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Gclose(gid) < 0) + goto error; } /* end for */ /* Create a datatype to commit and use */ - type_id = H5Tcopy(H5T_NATIVE_INT); + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0) + goto error; /* Create dataspace for dataset */ - space_id = H5Screate(H5S_SCALAR); + if((sid = H5Screate(H5S_SCALAR)) < 0) + goto error; + + /* Create dataset */ + if((did = H5Dcreate2(fid, DATASET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; - /* Create dataset */ - dset_id = H5Dcreate2(file, DATASET_NAME, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + /* Create NUM_ATTRS for the dataset */ for(i = 1; i <= NUM_ATTRS; i++) { sprintf(attrname, "%s%d", ATTR_NAME,i); - attr_id = H5Acreate2(dset_id, attrname, type_id, space_id, H5P_DEFAULT, H5P_DEFAULT); - ret = H5Aclose(attr_id); - assert(ret >= 0); + if((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Aclose(attr_id) < 0) + goto error; } /* end for */ - ret = H5Dclose(dset_id); - assert(ret >= 0); - ret = H5Sclose(space_id); - assert(ret >= 0); - ret = H5Tclose(type_id); - assert(ret >= 0); - ret = H5Fclose(file); - assert(ret >= 0); -} + /* Close dataset, dataspace, datatype, file */ + if(H5Dclose(did) < 0) + goto error; + if(H5Sclose(sid) < 0) + goto error; + if(H5Tclose(tid) < 0) + goto error; + if(H5Fclose(fid) < 0) + goto error; + +error: + H5E_BEGIN_TRY { + H5Aclose(attr_id); + H5Dclose(did); + H5Tclose(tid); + H5Sclose(sid); + H5Gclose(gid); + H5Fclose(fid); + } H5E_END_TRY; + +} /* gen_newgrat_file() */ + +/* + * Generate an HDF5 file with groups, datasets, attributes for testing the options: + * -l N (--links=N): Set the threshold for # of links when printing information for small groups. + * -m N (--dims=N): Set the threshold for the # of dimension sizes when printing information for small datasets. + * -a N (--numattrs=N): Set the threshold for the # of attributes when printing information for small # of attributes. + */ +static void +gen_threshold_file(const char *fname) +{ + hid_t fid; /* File ID */ + hid_t sid0, sid1, sid2, sid3, sid4; /* Dataspace IDs */ + hid_t did; /* Dataset ID */ + hid_t attr_id; /* Attribute ID */ + hid_t gid; /* Group ID */ + hsize_t two_dims[] = {2, 5}; /* Dimension array */ + hsize_t one_dims[] = {6}; /* Dimension array */ + hsize_t zero_dims[] = {0}; /* Dimension array */ + char name[30]; /* Name */ + unsigned i; /* Local index variable */ + + /* Create file */ + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create 1-D dataspace with zero dimension size */ + if((sid0 = H5Screate_simple(1, zero_dims, NULL)) < 0) + goto error; + + /* Create 1-D dataspace with non-zero dimension size*/ + if((sid1 = H5Screate_simple(1, one_dims, NULL)) < 0) + goto error; + + /* Create 2-D dataspace */ + if((sid2 = H5Screate_simple(2, two_dims, NULL)) < 0) + goto error; + + /* Create scalar dataspace */ + if((sid3 = H5Screate(H5S_SCALAR)) < 0) + goto error; + + /* Create null dataspace */ + if((sid4 = H5Screate(H5S_NULL)) < 0) + goto error; + + /* Create an attribute for the root group */ + if((attr_id = H5Acreate2(fid, "attr", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Aclose(attr_id) < 0) + goto error; + + /* Create 1-D dataset with zero dimension size for the root group */ + if((did = H5Dcreate2(fid, "zero_dset", H5T_NATIVE_UCHAR, sid0, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create 11 attributes for the dataset */ + for(i = 1; i <= (THRES_NUM+1); i++) { + sprintf(name, "%s%d", THRES_ATTR_NAME,i); + if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Aclose(attr_id) < 0) + goto error; + } + if(H5Dclose(did) < 0) + goto error; + + /* Create dataset with scalar dataspace for the root group */ + if((did = H5Dcreate2(fid, "scalar_dset", H5T_NATIVE_UCHAR, sid3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Dclose(did) < 0) + goto error; + + /* Create dataset with null dataspace for the root group */ + if((did = H5Dcreate2(fid, "null_dset", H5T_NATIVE_UCHAR, sid4, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Dclose(did) < 0) + goto error; + + /* Create 2-D dataset for the root group */ + if((did = H5Dcreate2(fid, "dset", H5T_NATIVE_UCHAR, sid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create 10 attributes for the 2-D dataset */ + for(i = 1; i <= THRES_NUM; i++) { + sprintf(name, "%s%d", THRES_ATTR_NAME,i); + if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + if(H5Aclose(attr_id) < 0) + goto error; + } + if(H5Dclose(did) < 0) + goto error; + + /* Create first group */ + if((gid = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create an attribute for the group */ + if((attr_id = H5Acreate2(gid, "ATTR", H5T_NATIVE_INT, sid3, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Close attribute */ + if(H5Aclose(attr_id) < 0) + goto error; + + /* Create 10 1-D datasets with non-zero dimension size for the group */ + for(i = 1; i <= THRES_NUM; i++) { + /* set up dataset name */ + sprintf(name, "%s%d", THRES_DSET_NAME,i); + + /* Create the dataset */ + if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Close the dataset */ + if(H5Dclose(did) < 0) + goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) + goto error; + + + /* Create second group */ + if((gid = H5Gcreate2(fid, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create 25 attributes for the group */ + for(i = 1; i <= THRES_NUM_25; i++) { + /* Set up attribute name */ + sprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i); + + /* Create the attribute */ + if((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Close the attribute */ + if(H5Aclose(attr_id) < 0) + goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) + goto error; + + /* Create third group */ + if((gid = H5Gcreate2(fid, "group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Create 9 1-D datasets with non-zero dimension size for the group */ + for(i = 1; i < THRES_NUM; i++) { + /* set up dataset name */ + sprintf(name, "%s%d", THRES_DSET_NAME,i); + + /* Create the dataset */ + if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + goto error; + + /* Close the dataset */ + if(H5Dclose(did) < 0) + goto error; + } + + /* Close the group */ + if(H5Gclose(gid) < 0) + goto error; + + + /* Close dataspaces */ + if(H5Sclose(sid0) < 0) + goto error; + if(H5Sclose(sid1) < 0) + goto error; + if(H5Sclose(sid2) < 0) + goto error; + if(H5Sclose(sid3) < 0) + goto error; + if(H5Sclose(sid4) < 0) + goto error; + + /* Close file */ + if(H5Fclose(fid) < 0) + goto error; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid); + H5Aclose(attr_id); + H5Dclose(did); + H5Sclose(sid0); + H5Sclose(sid1); + H5Sclose(sid2); + H5Sclose(sid3); + H5Sclose(sid4); + H5Fclose(fid); + } H5E_END_TRY; + +} /* gen_threshold_file() */ int main(void) { - gen_file(); + gen_newgrat_file(NEWGRAT_FILE); + gen_threshold_file(THRESHOLD_FILE); return 0; } diff --git a/tools/h5stat/testfiles/h5stat_dims1.ddl b/tools/h5stat/testfiles/h5stat_dims1.ddl new file mode 100644 index 0000000..182d31a --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_dims1.ddl @@ -0,0 +1,47 @@ +############################# +Expected output for 'h5stat -gd -m 5 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Small groups (with 0 to 9 links): + # of groups with 0 link(s): 1 + # of groups with 7 link(s): 1 + # of groups with 9 link(s): 1 + Total # of small groups: 3 +Group bins: + # of groups with 0 link: 1 + # of groups with 1 - 9 links: 2 + # of groups with 10 - 99 links: 1 + Total # of groups: 4 +Dataset dimension information: + Max. rank of datasets: 2 + Dataset ranks: + # of dataset with rank 0: 2 + # of dataset with rank 1: 20 + # of dataset with rank 2: 1 +1-D Dataset information: + Max. dimension size of 1-D datasets: 6 + Small 1-D datasets (with dimension sizes 0 to 4): + # of datasets with dimension sizes 0: 1 + Total # of small datasets: 1 + 1-D Dataset dimension bins: + # of datasets with dimension size 0: 1 + # of datasets with dimension size 1 - 9: 19 + Total # of datasets: 20 +Dataset storage information: + Total raw data size: 0 + Total external raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 23 + Dataset layout counts[CHUNKED]: 0 + Number of external files : 0 +Dataset filters information: + Number of datasets with: + NO filter: 23 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 diff --git a/tools/h5stat/testfiles/h5stat_dims2.ddl b/tools/h5stat/testfiles/h5stat_dims2.ddl new file mode 100644 index 0000000..abf3f61 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_dims2.ddl @@ -0,0 +1,38 @@ +############################# +Expected output for 'h5stat -d --di=15 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Dataset dimension information: + Max. rank of datasets: 2 + Dataset ranks: + # of dataset with rank 0: 2 + # of dataset with rank 1: 20 + # of dataset with rank 2: 1 +1-D Dataset information: + Max. dimension size of 1-D datasets: 6 + Small 1-D datasets (with dimension sizes 0 to 14): + # of datasets with dimension sizes 0: 1 + # of datasets with dimension sizes 6: 19 + Total # of small datasets: 20 + 1-D Dataset dimension bins: + # of datasets with dimension size 0: 1 + # of datasets with dimension size 1 - 9: 19 + Total # of datasets: 20 +Dataset storage information: + Total raw data size: 0 + Total external raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 23 + Dataset layout counts[CHUNKED]: 0 + Number of external files : 0 +Dataset filters information: + Number of datasets with: + NO filter: 23 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 diff --git a/tools/h5stat/testfiles/h5stat_err1_dims.ddl b/tools/h5stat/testfiles/h5stat_err1_dims.ddl new file mode 100644 index 0000000..8f0686f --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_err1_dims.ddl @@ -0,0 +1,4 @@ +############################# +Expected output for 'h5stat -d --dims=-1 h5stat_threshold.h5' +############################# +h5stat error: Invalid threshold for small datasets diff --git a/tools/h5stat/testfiles/h5stat_err1_links.ddl b/tools/h5stat/testfiles/h5stat_err1_links.ddl new file mode 100644 index 0000000..07987a2 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_err1_links.ddl @@ -0,0 +1,4 @@ +############################# +Expected output for 'h5stat -l 0 h5stat_threshold.h5' +############################# +h5stat error: Invalid threshold for small groups diff --git a/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl b/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl new file mode 100644 index 0000000..8eea546 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_err1_numattrs.ddl @@ -0,0 +1,4 @@ +############################# +Expected output for 'h5stat -a -2 h5stat_threshold.h5' +############################# +h5stat error: Invalid threshold for small # of attributes diff --git a/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl b/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl new file mode 100644 index 0000000..a1ecb31 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_err2_numattrs.ddl @@ -0,0 +1,4 @@ +############################# +Expected output for 'h5stat --numattrs h5stat_threshold.h5' +############################# +h5stat error: Invalid threshold for small # of attributes diff --git a/tools/h5stat/testfiles/h5stat_filters-d.ddl b/tools/h5stat/testfiles/h5stat_filters-d.ddl index 3cc9071..dae1f06 100644 --- a/tools/h5stat/testfiles/h5stat_filters-d.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-d.ddl @@ -9,10 +9,10 @@ Dataset dimension information: # of dataset with rank 2: 14 1-D Dataset information: Max. dimension size of 1-D datasets: 100 - Small 1-D datasets: - Total small datasets: 0 + Small 1-D datasets (with dimension sizes 0 to 9): + Total # of small datasets: 0 1-D Dataset dimension bins: - # of datasets of size 100 - 999: 1 + # of datasets with dimension size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: Total raw data size: 8659 diff --git a/tools/h5stat/testfiles/h5stat_filters-dT.ddl b/tools/h5stat/testfiles/h5stat_filters-dT.ddl index ae9121d..5c7a4ab 100644 --- a/tools/h5stat/testfiles/h5stat_filters-dT.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-dT.ddl @@ -9,10 +9,10 @@ Dataset dimension information: # of dataset with rank 2: 14 1-D Dataset information: Max. dimension size of 1-D datasets: 100 - Small 1-D datasets: - Total small datasets: 0 + Small 1-D datasets (with dimension sizes 0 to 9): + Total # of small datasets: 0 1-D Dataset dimension bins: - # of datasets of size 100 - 999: 1 + # of datasets with dimension size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: Total raw data size: 8659 diff --git a/tools/h5stat/testfiles/h5stat_filters-g.ddl b/tools/h5stat/testfiles/h5stat_filters-g.ddl index d488b8f..6cb791c 100644 --- a/tools/h5stat/testfiles/h5stat_filters-g.ddl +++ b/tools/h5stat/testfiles/h5stat_filters-g.ddl @@ -2,8 +2,8 @@ Expected output for 'h5stat -g h5stat_filters.h5' ############################# Filename: h5stat_filters.h5 -Small groups: +Small groups (with 0 to 9 links): Total # of small groups: 0 Group bins: - # of groups of size 10 - 99: 1 + # of groups with 10 - 99 links: 1 Total # of groups: 1 diff --git a/tools/h5stat/testfiles/h5stat_filters.ddl b/tools/h5stat/testfiles/h5stat_filters.ddl index ddafd81..0a6733d 100644 --- a/tools/h5stat/testfiles/h5stat_filters.ddl +++ b/tools/h5stat/testfiles/h5stat_filters.ddl @@ -35,10 +35,10 @@ File space information for file metadata (in bytes): Free-space managers: Header: 0 Amount of free space: 0 -Small groups: +Small groups (with 0 to 9 links): Total # of small groups: 0 Group bins: - # of groups of size 10 - 99: 1 + # of groups with 10 - 99 links: 1 Total # of groups: 1 Dataset dimension information: Max. rank of datasets: 2 @@ -47,10 +47,10 @@ Dataset dimension information: # of dataset with rank 2: 14 1-D Dataset information: Max. dimension size of 1-D datasets: 100 - Small 1-D datasets: - Total small datasets: 0 + Small 1-D datasets (with dimension sizes 0 to 9): + Total # of small datasets: 0 1-D Dataset dimension bins: - # of datasets of size 100 - 999: 1 + # of datasets with dimension size 100 - 999: 1 Total # of datasets: 1 Dataset storage information: Total raw data size: 8659 @@ -79,7 +79,7 @@ Dataset datatype information: Count (total/named) = (1/0) Size (desc./elmt) = (14/4) Total dataset datatype count: 15 -Small # of attributes: +Small # of attributes (objects with 1 to 10 attributes): Total # of objects with small # of attributes: 0 Attribute bins: Total # of objects with attributes: 0 diff --git a/tools/h5stat/testfiles/h5stat_help1.ddl b/tools/h5stat/testfiles/h5stat_help1.ddl index 5665b35..d79c99f 100644 --- a/tools/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/h5stat/testfiles/h5stat_help1.ddl @@ -9,10 +9,19 @@ Usage: h5stat [OPTIONS] file -f, --file Print file information -F, --filemetadata Print file space information for file's metadata -g, --group Print group information + -l N, --links=N Set the threshold for the # of links when printing + information for small groups. N is an integer greater + than 0. The default threshold is 10. -G, --groupmetadata Print file space information for groups' metadata -d, --dset Print dataset information + -m N, --dims=N Set the threshold for the dimension sizes when printing + information for small datasets. N is an integer greater + than 0. The default threshold is 10. -D, --dsetmetadata Print file space information for datasets' metadata -T, --dtypemetadata Print datasets' datatype information -A, --attribute Print attribute information + -a N, --numattrs=N Set the threshold for the # of attributes when printing + information for small # of attributes. N is an integer greater + than 0. The default threshold is 10. -s, --freespace Print free space information -S, --summary Print summary of file space information diff --git a/tools/h5stat/testfiles/h5stat_help2.ddl b/tools/h5stat/testfiles/h5stat_help2.ddl index 3fb303a..af48e3a 100644 --- a/tools/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/h5stat/testfiles/h5stat_help2.ddl @@ -9,10 +9,19 @@ Usage: h5stat [OPTIONS] file -f, --file Print file information -F, --filemetadata Print file space information for file's metadata -g, --group Print group information + -l N, --links=N Set the threshold for the # of links when printing + information for small groups. N is an integer greater + than 0. The default threshold is 10. -G, --groupmetadata Print file space information for groups' metadata -d, --dset Print dataset information + -m N, --dims=N Set the threshold for the dimension sizes when printing + information for small datasets. N is an integer greater + than 0. The default threshold is 10. -D, --dsetmetadata Print file space information for datasets' metadata -T, --dtypemetadata Print datasets' datatype information -A, --attribute Print attribute information + -a N, --numattrs=N Set the threshold for the # of attributes when printing + information for small # of attributes. N is an integer greater + than 0. The default threshold is 10. -s, --freespace Print free space information -S, --summary Print summary of file space information diff --git a/tools/h5stat/testfiles/h5stat_links1.ddl b/tools/h5stat/testfiles/h5stat_links1.ddl new file mode 100644 index 0000000..e77a788 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_links1.ddl @@ -0,0 +1,13 @@ +############################# +Expected output for 'h5stat -g -l 8 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Small groups (with 0 to 7 links): + # of groups with 0 link(s): 1 + # of groups with 7 link(s): 1 + Total # of small groups: 2 +Group bins: + # of groups with 0 link: 1 + # of groups with 1 - 9 links: 2 + # of groups with 10 - 99 links: 1 + Total # of groups: 4 diff --git a/tools/h5stat/testfiles/h5stat_links2.ddl b/tools/h5stat/testfiles/h5stat_links2.ddl new file mode 100644 index 0000000..5207343 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_links2.ddl @@ -0,0 +1,107 @@ +############################# +Expected output for 'h5stat --links=8 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +File information + # of unique groups: 4 + # of unique datasets: 23 + # of unique named datatypes: 0 + # of unique links: 0 + # of unique other: 0 + Max. # of links to object: 1 + Max. # of objects in group: 10 +File space information for file metadata (in bytes): + Superblock: 96 + Superblock extension: 0 + User block: 0 + Object headers: (total/unused) + Groups: 3576/0 + Datasets(exclude compact data): 7896/2912 + Datatypes: 0/0 + Groups: + B-tree/List: 3816 + Heap: 744 + Attributes: + B-tree/List: 0 + Heap: 0 + Chunked datasets: + Index: 0 + Datasets: + Heap: 0 + Shared Messages: + Header: 0 + B-tree/List: 0 + Heap: 0 + Free-space managers: + Header: 0 + Amount of free space: 0 +Small groups (with 0 to 7 links): + # of groups with 0 link(s): 1 + # of groups with 7 link(s): 1 + Total # of small groups: 2 +Group bins: + # of groups with 0 link: 1 + # of groups with 1 - 9 links: 2 + # of groups with 10 - 99 links: 1 + Total # of groups: 4 +Dataset dimension information: + Max. rank of datasets: 2 + Dataset ranks: + # of dataset with rank 0: 2 + # of dataset with rank 1: 20 + # of dataset with rank 2: 1 +1-D Dataset information: + Max. dimension size of 1-D datasets: 6 + Small 1-D datasets (with dimension sizes 0 to 9): + # of datasets with dimension sizes 0: 1 + # of datasets with dimension sizes 6: 19 + Total # of small datasets: 20 + 1-D Dataset dimension bins: + # of datasets with dimension size 0: 1 + # of datasets with dimension size 1 - 9: 19 + Total # of datasets: 20 +Dataset storage information: + Total raw data size: 0 + Total external raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 23 + Dataset layout counts[CHUNKED]: 0 + Number of external files : 0 +Dataset filters information: + Number of datasets with: + NO filter: 23 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 +Dataset datatype information: + # of unique datatypes used by datasets: 1 + Dataset datatype #0: + Count (total/named) = (23/0) + Size (desc./elmt) = (14/1) + Total dataset datatype count: 23 +Small # of attributes (objects with 1 to 10 attributes): + # of objects with 1 attributes: 2 + # of objects with 10 attributes: 1 + Total # of objects with small # of attributes: 3 +Attribute bins: + # of objects with 1 - 9 attributes: 2 + # of objects with 10 - 99 attributes: 3 + Total # of objects with attributes: 5 + Max. # of attributes to objects: 25 +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FILE_SPACE_ALL +Summary of file space information: + File metadata: 16128 bytes + Raw data: 0 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 184 bytes +Total space: 16312 bytes diff --git a/tools/h5stat/testfiles/h5stat_links3.ddl b/tools/h5stat/testfiles/h5stat_links3.ddl new file mode 100644 index 0000000..d0071d7 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_links3.ddl @@ -0,0 +1,15 @@ +############################# +Expected output for 'h5stat --links=20 -g h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Small groups (with 0 to 19 links): + # of groups with 0 link(s): 1 + # of groups with 7 link(s): 1 + # of groups with 9 link(s): 1 + # of groups with 10 link(s): 1 + Total # of small groups: 4 +Group bins: + # of groups with 0 link: 1 + # of groups with 1 - 9 links: 2 + # of groups with 10 - 99 links: 1 + Total # of groups: 4 diff --git a/tools/h5stat/testfiles/h5stat_links4.ddl b/tools/h5stat/testfiles/h5stat_links4.ddl new file mode 100644 index 0000000..ca3911c --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_links4.ddl @@ -0,0 +1,11 @@ +############################# +Expected output for 'h5stat -g h5stat_newgrat.h5' +############################# +Filename: h5stat_newgrat.h5 +Small groups (with 0 to 9 links): + # of groups with 0 link(s): 35000 + Total # of small groups: 35000 +Group bins: + # of groups with 0 link: 35000 + # of groups with 10000 - 99999 links: 1 + Total # of groups: 35001 diff --git a/tools/h5stat/testfiles/h5stat_links5.ddl b/tools/h5stat/testfiles/h5stat_links5.ddl new file mode 100644 index 0000000..44ec161 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_links5.ddl @@ -0,0 +1,12 @@ +############################# +Expected output for 'h5stat -g -l 40000 h5stat_newgrat.h5' +############################# +Filename: h5stat_newgrat.h5 +Small groups (with 0 to 39999 links): + # of groups with 0 link(s): 35000 + # of groups with 35001 link(s): 1 + Total # of small groups: 35001 +Group bins: + # of groups with 0 link: 35000 + # of groups with 10000 - 99999 links: 1 + Total # of groups: 35001 diff --git a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl b/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl index 70f9a82..18f91f3 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat-UA.ddl @@ -2,7 +2,7 @@ Expected output for 'h5stat -A h5stat_newgrat.h5' ############################# Filename: h5stat_newgrat.h5 -Small # of attributes: +Small # of attributes (objects with 1 to 10 attributes): Total # of objects with small # of attributes: 0 Attribute bins: # of objects with 100 - 999 attributes: 1 diff --git a/tools/h5stat/testfiles/h5stat_newgrat.ddl b/tools/h5stat/testfiles/h5stat_newgrat.ddl index b93fa17..7d4ef91 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat.ddl +++ b/tools/h5stat/testfiles/h5stat_newgrat.ddl @@ -33,14 +33,14 @@ File space information for file metadata (in bytes): B-tree/List: 0 Heap: 0 Free-space managers: - Header: 1584 - Amount of free space: 6042 -Small groups: - # of groups of size 0: 35000 + Header: 180 + Amount of free space: 132 +Small groups (with 0 to 9 links): + # of groups with 0 link(s): 35000 Total # of small groups: 35000 Group bins: - # of groups of size 0: 35000 - # of groups of size 10000 - 99999: 1 + # of groups with 0 link: 35000 + # of groups with 10000 - 99999 links: 1 Total # of groups: 35001 Dataset dimension information: Max. rank of datasets: 0 @@ -48,8 +48,8 @@ Dataset dimension information: # of dataset with rank 0: 1 1-D Dataset information: Max. dimension size of 1-D datasets: 0 - Small 1-D datasets: - Total small datasets: 0 + Small 1-D datasets (with dimension sizes 0 to 9): + Total # of small datasets: 0 Dataset storage information: Total raw data size: 0 Total external raw data size: 0 @@ -74,7 +74,7 @@ Dataset datatype information: Count (total/named) = (1/0) Size (desc./elmt) = (14/4) Total dataset datatype count: 1 -Small # of attributes: +Small # of attributes (objects with 1 to 10 attributes): Total # of objects with small # of attributes: 0 Attribute bins: # of objects with 100 - 999 attributes: 1 @@ -83,20 +83,15 @@ Attribute bins: Free-space section threshold: 1 bytes Small size free-space sections (< 10 bytes): # of sections of size 1: 1 - # of sections of size 2: 12 - # of sections of size 3: 1 - # of sections of size 7: 1 - # of sections of size 8: 2 - Total # of small size sections: 17 + Total # of small size sections: 1 Free-space section bins: - # of sections of size 1 - 9: 17 - # of sections of size 10 - 99: 49 - # of sections of size 100 - 999: 27 - Total # of sections: 93 + # of sections of size 1 - 9: 1 + # of sections of size 10 - 99: 4 + Total # of sections: 5 File space management strategy: H5F_FILE_SPACE_ALL_PERSIST Summary of file space information: - File metadata: 6363440 bytes + File metadata: 6362036 bytes Raw data: 0 bytes - Amount/Percent of tracked free space: 6042 bytes/0.1% + Amount/Percent of tracked free space: 132 bytes/0.0% Unaccounted space: 0 bytes -Total space: 6369482 bytes +Total space: 6362168 bytes diff --git a/tools/h5stat/testfiles/h5stat_newgrat.h5 b/tools/h5stat/testfiles/h5stat_newgrat.h5 Binary files differindex cb5f47f..c919b71 100644 --- a/tools/h5stat/testfiles/h5stat_newgrat.h5 +++ b/tools/h5stat/testfiles/h5stat_newgrat.h5 diff --git a/tools/h5stat/testfiles/h5stat_nofile.ddl b/tools/h5stat/testfiles/h5stat_nofile.ddl new file mode 100644 index 0000000..cf20995 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_nofile.ddl @@ -0,0 +1,28 @@ +############################# +Expected output for 'h5stat ' +############################# +Usage: h5stat [OPTIONS] file + + OPTIONS + -h, --help Print a usage message and exit + -V, --version Print version number and exit + -f, --file Print file information + -F, --filemetadata Print file space information for file's metadata + -g, --group Print group information + -l N, --links=N Set the threshold for the # of links when printing + information for small groups. N is an integer greater + than 0. The default threshold is 10. + -G, --groupmetadata Print file space information for groups' metadata + -d, --dset Print dataset information + -m N, --dims=N Set the threshold for the dimension sizes when printing + information for small datasets. N is an integer greater + than 0. The default threshold is 10. + -D, --dsetmetadata Print file space information for datasets' metadata + -T, --dtypemetadata Print datasets' datatype information + -A, --attribute Print attribute information + -a N, --numattrs=N Set the threshold for the # of attributes when printing + information for small # of attributes. N is an integer greater + than 0. The default threshold is 10. + -s, --freespace Print free space information + -S, --summary Print summary of file space information +h5stat error: missing file name diff --git a/tools/h5stat/testfiles/h5stat_numattrs1.ddl b/tools/h5stat/testfiles/h5stat_numattrs1.ddl new file mode 100644 index 0000000..86cfcb0 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_numattrs1.ddl @@ -0,0 +1,20 @@ +############################# +Expected output for 'h5stat -AS -a 10 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Small # of attributes (objects with 1 to 10 attributes): + # of objects with 1 attributes: 2 + # of objects with 10 attributes: 1 + Total # of objects with small # of attributes: 3 +Attribute bins: + # of objects with 1 - 9 attributes: 2 + # of objects with 10 - 99 attributes: 3 + Total # of objects with attributes: 5 + Max. # of attributes to objects: 25 +File space management strategy: H5F_FILE_SPACE_ALL +Summary of file space information: + File metadata: 16128 bytes + Raw data: 0 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 184 bytes +Total space: 16312 bytes diff --git a/tools/h5stat/testfiles/h5stat_numattrs2.ddl b/tools/h5stat/testfiles/h5stat_numattrs2.ddl new file mode 100644 index 0000000..5ee3adf --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_numattrs2.ddl @@ -0,0 +1,107 @@ +############################# +Expected output for 'h5stat -a 1 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +File information + # of unique groups: 4 + # of unique datasets: 23 + # of unique named datatypes: 0 + # of unique links: 0 + # of unique other: 0 + Max. # of links to object: 1 + Max. # of objects in group: 10 +File space information for file metadata (in bytes): + Superblock: 96 + Superblock extension: 0 + User block: 0 + Object headers: (total/unused) + Groups: 3576/0 + Datasets(exclude compact data): 7896/2912 + Datatypes: 0/0 + Groups: + B-tree/List: 3816 + Heap: 744 + Attributes: + B-tree/List: 0 + Heap: 0 + Chunked datasets: + Index: 0 + Datasets: + Heap: 0 + Shared Messages: + Header: 0 + B-tree/List: 0 + Heap: 0 + Free-space managers: + Header: 0 + Amount of free space: 0 +Small groups (with 0 to 9 links): + # of groups with 0 link(s): 1 + # of groups with 7 link(s): 1 + # of groups with 9 link(s): 1 + Total # of small groups: 3 +Group bins: + # of groups with 0 link: 1 + # of groups with 1 - 9 links: 2 + # of groups with 10 - 99 links: 1 + Total # of groups: 4 +Dataset dimension information: + Max. rank of datasets: 2 + Dataset ranks: + # of dataset with rank 0: 2 + # of dataset with rank 1: 20 + # of dataset with rank 2: 1 +1-D Dataset information: + Max. dimension size of 1-D datasets: 6 + Small 1-D datasets (with dimension sizes 0 to 9): + # of datasets with dimension sizes 0: 1 + # of datasets with dimension sizes 6: 19 + Total # of small datasets: 20 + 1-D Dataset dimension bins: + # of datasets with dimension size 0: 1 + # of datasets with dimension size 1 - 9: 19 + Total # of datasets: 20 +Dataset storage information: + Total raw data size: 0 + Total external raw data size: 0 +Dataset layout information: + Dataset layout counts[COMPACT]: 0 + Dataset layout counts[CONTIG]: 23 + Dataset layout counts[CHUNKED]: 0 + Number of external files : 0 +Dataset filters information: + Number of datasets with: + NO filter: 23 + GZIP filter: 0 + SHUFFLE filter: 0 + FLETCHER32 filter: 0 + SZIP filter: 0 + NBIT filter: 0 + SCALEOFFSET filter: 0 + USER-DEFINED filter: 0 +Dataset datatype information: + # of unique datatypes used by datasets: 1 + Dataset datatype #0: + Count (total/named) = (23/0) + Size (desc./elmt) = (14/1) + Total dataset datatype count: 23 +Small # of attributes (objects with 1 to 1 attributes): + # of objects with 1 attributes: 2 + Total # of objects with small # of attributes: 2 +Attribute bins: + # of objects with 1 - 9 attributes: 2 + # of objects with 10 - 99 attributes: 3 + Total # of objects with attributes: 5 + Max. # of attributes to objects: 25 +Free-space section threshold: 1 bytes +Small size free-space sections (< 10 bytes): + Total # of small size sections: 0 +Free-space section bins: + Total # of sections: 0 +File space management strategy: H5F_FILE_SPACE_ALL +Summary of file space information: + File metadata: 16128 bytes + Raw data: 0 bytes + Amount/Percent of tracked free space: 0 bytes/0.0% + Unaccounted space: 184 bytes +Total space: 16312 bytes diff --git a/tools/h5stat/testfiles/h5stat_numattrs3.ddl b/tools/h5stat/testfiles/h5stat_numattrs3.ddl new file mode 100644 index 0000000..515b76c --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_numattrs3.ddl @@ -0,0 +1,15 @@ +############################# +Expected output for 'h5stat -A --numattrs=25 h5stat_threshold.h5' +############################# +Filename: h5stat_threshold.h5 +Small # of attributes (objects with 1 to 25 attributes): + # of objects with 1 attributes: 2 + # of objects with 10 attributes: 1 + # of objects with 11 attributes: 1 + # of objects with 25 attributes: 1 + Total # of objects with small # of attributes: 5 +Attribute bins: + # of objects with 1 - 9 attributes: 2 + # of objects with 10 - 99 attributes: 3 + Total # of objects with attributes: 5 + Max. # of attributes to objects: 25 diff --git a/tools/h5stat/testfiles/h5stat_numattrs4.ddl b/tools/h5stat/testfiles/h5stat_numattrs4.ddl new file mode 100644 index 0000000..515a4a9 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_numattrs4.ddl @@ -0,0 +1,11 @@ +############################# +Expected output for 'h5stat -A -a 100 h5stat_newgrat.h5' +############################# +Filename: h5stat_newgrat.h5 +Small # of attributes (objects with 1 to 100 attributes): + # of objects with 100 attributes: 1 + Total # of objects with small # of attributes: 1 +Attribute bins: + # of objects with 100 - 999 attributes: 1 + Total # of objects with attributes: 1 + Max. # of attributes to objects: 100 diff --git a/tools/h5stat/testfiles/h5stat_threshold.h5 b/tools/h5stat/testfiles/h5stat_threshold.h5 Binary files differnew file mode 100644 index 0000000..9f7c8c8 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_threshold.h5 diff --git a/tools/h5stat/testfiles/h5stat_tsohm.ddl b/tools/h5stat/testfiles/h5stat_tsohm.ddl index 6ee8aa8..788421b 100644 --- a/tools/h5stat/testfiles/h5stat_tsohm.ddl +++ b/tools/h5stat/testfiles/h5stat_tsohm.ddl @@ -35,11 +35,11 @@ File space information for file metadata (in bytes): Free-space managers: Header: 0 Amount of free space: 0 -Small groups: - # of groups of size 3: 1 +Small groups (with 0 to 9 links): + # of groups with 3 link(s): 1 Total # of small groups: 1 Group bins: - # of groups of size 1 - 9: 1 + # of groups with 1 - 9 links: 1 Total # of groups: 1 Dataset dimension information: Max. rank of datasets: 2 @@ -47,8 +47,8 @@ Dataset dimension information: # of dataset with rank 2: 3 1-D Dataset information: Max. dimension size of 1-D datasets: 0 - Small 1-D datasets: - Total small datasets: 0 + Small 1-D datasets (with dimension sizes 0 to 9): + Total # of small datasets: 0 Dataset storage information: Total raw data size: 0 Total external raw data size: 0 @@ -73,7 +73,7 @@ Dataset datatype information: Count (total/named) = (3/0) Size (desc./elmt) = (14/8) Total dataset datatype count: 3 -Small # of attributes: +Small # of attributes (objects with 1 to 10 attributes): Total # of objects with small # of attributes: 0 Attribute bins: Total # of objects with attributes: 0 diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index ab97698..f780c97 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -13,7 +13,12 @@ # http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have # access to either file, you may request a copy from help@hdfgroup.org. # -# Tests for the h5dump tool +# Tests for the h5stat tool +# +# Modifcations: +# Vailin Choi; July 2013 +# Add tests for -l, -m, -a options +# srcdir=@srcdir@ @@ -72,12 +77,14 @@ LIST_HDF5_TEST_FILES=" $SRC_H5STAT_TESTFILES/h5stat_filters.h5 $SRC_H5STAT_TESTFILES/h5stat_tsohm.h5 $SRC_H5STAT_TESTFILES/h5stat_newgrat.h5 +$SRC_H5STAT_TESTFILES/h5stat_threshold.h5 " LIST_OTHER_TEST_FILES=" $SRC_H5STAT_TESTFILES/h5stat_help1.ddl $SRC_H5STAT_TESTFILES/h5stat_help2.ddl $SRC_H5STAT_TESTFILES/h5stat_notexist.ddl +$SRC_H5STAT_TESTFILES/h5stat_nofile.ddl $SRC_H5STAT_TESTFILES/h5stat_filters.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl @@ -90,6 +97,21 @@ $SRC_H5STAT_TESTFILES/h5stat_tsohm.ddl $SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl $SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl $SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl +$SRC_H5STAT_TESTFILES/h5stat_err1_links.ddl +$SRC_H5STAT_TESTFILES/h5stat_links1.ddl +$SRC_H5STAT_TESTFILES/h5stat_links2.ddl +$SRC_H5STAT_TESTFILES/h5stat_links3.ddl +$SRC_H5STAT_TESTFILES/h5stat_links4.ddl +$SRC_H5STAT_TESTFILES/h5stat_links5.ddl +$SRC_H5STAT_TESTFILES/h5stat_err1_dims.ddl +$SRC_H5STAT_TESTFILES/h5stat_dims1.ddl +$SRC_H5STAT_TESTFILES/h5stat_dims2.ddl +$SRC_H5STAT_TESTFILES/h5stat_err1_numattrs.ddl +$SRC_H5STAT_TESTFILES/h5stat_err2_numattrs.ddl +$SRC_H5STAT_TESTFILES/h5stat_numattrs1.ddl +$SRC_H5STAT_TESTFILES/h5stat_numattrs2.ddl +$SRC_H5STAT_TESTFILES/h5stat_numattrs3.ddl +$SRC_H5STAT_TESTFILES/h5stat_numattrs4.ddl " # @@ -210,6 +232,7 @@ TOOLTEST h5stat_help1.ddl -h TOOLTEST h5stat_help2.ddl --help # Test when h5stat a file that does not exist TOOLTEST h5stat_notexist.ddl notexist.h5 +TOOLTEST h5stat_nofile.ddl '' # Test file with groups, compressed datasets, user-applied fileters, etc. # h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 @@ -229,6 +252,47 @@ TOOLTEST h5stat_tsohm.ddl h5stat_tsohm.h5 TOOLTEST h5stat_newgrat.ddl h5stat_newgrat.h5 TOOLTEST h5stat_newgrat-UG.ddl -G h5stat_newgrat.h5 TOOLTEST h5stat_newgrat-UA.ddl -A h5stat_newgrat.h5 +# +# Tests for -l (--links) option on h5stat_threshold.h5: +# -l 0 (incorrect threshold value) +# -g -l 8 +# --links=8 +# --links=20 -g +TOOLTEST h5stat_err1_links.ddl -l 0 h5stat_threshold.h5 +TOOLTEST h5stat_links1.ddl -g -l 8 h5stat_threshold.h5 +TOOLTEST h5stat_links2.ddl --links=8 h5stat_threshold.h5 +TOOLTEST h5stat_links3.ddl --links=20 -g h5stat_threshold.h5 +# +# Tests for -l (--links) option on h5stat_newgrat.h5: +# -g +# -g -l 40000 +TOOLTEST h5stat_links4.ddl -g h5stat_newgrat.h5 +TOOLTEST h5stat_links5.ddl -g -l 40000 h5stat_newgrat.h5 +# +# Tests for -m (--dims) option on h5stat_threshold.h5 +# -d --dims=-1 (incorrect threshold value) +# -gd -m 5 +# -d --di=15 +TOOLTEST h5stat_err1_dims.ddl -d --dims=-1 h5stat_threshold.h5 +TOOLTEST h5stat_dims1.ddl -gd -m 5 h5stat_threshold.h5 +TOOLTEST h5stat_dims2.ddl -d --di=15 h5stat_threshold.h5 +# +# Tests for -a option on h5stat_threshold.h5 +# -a -2 (incorrect threshold value) +# --numattrs (without threshold value) +# -AS -a 10 +# -a 1 +# -A --numattrs=25 +TOOLTEST h5stat_err1_numattrs.ddl -a -2 h5stat_threshold.h5 +TOOLTEST h5stat_err2_numattrs.ddl --numattrs h5stat_threshold.h5 +TOOLTEST h5stat_numattrs1.ddl -AS -a 10 h5stat_threshold.h5 +TOOLTEST h5stat_numattrs2.ddl -a 1 h5stat_threshold.h5 +TOOLTEST h5stat_numattrs3.ddl -A --numattrs=25 h5stat_threshold.h5 +# +# Tests for -a option on h5stat_newgrat.h5 +# -A -a 100 +TOOLTEST h5stat_numattrs4.ddl -A -a 100 h5stat_newgrat.h5 +# if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 3e9c43e..7b43d2e 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -36,10 +36,11 @@ hid_t H5tools_ERR_CLS_g = -1; hid_t H5E_tools_g = -1; hid_t H5E_tools_min_id_g = -1; int compound_data; -FILE *rawattrstream; /* should initialize to stdout but gcc moans about it */ -FILE *rawdatastream; /* should initialize to stdout but gcc moans about it */ -FILE *rawoutstream; /* should initialize to stdout but gcc moans about it */ -FILE *rawerrorstream; /* should initialize to stderr but gcc moans about it */ +FILE *rawattrstream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawdatastream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawinstream = NULL; /* should initialize to stdin but gcc moans about it */ +FILE *rawoutstream = NULL; /* should initialize to stdout but gcc moans about it */ +FILE *rawerrorstream = NULL; /* should initialize to stderr but gcc moans about it */ int bin_output; /* binary output */ int bin_form; /* binary form */ int region_output; /* region output */ @@ -74,7 +75,7 @@ static const char *drivernames[]={ /* This enum should match the entries in the above drivers_list since they * are indexes into the drivers_list array. */ -enum { +typedef enum { SEC2_IDX = 0 ,FAMILY_IDX ,SPLIT_IDX @@ -120,6 +121,8 @@ h5tools_init(void) rawattrstream = stdout; if (!rawdatastream) rawdatastream = stdout; + if (!rawinstream) + rawinstream = stdin; if (!rawoutstream) rawoutstream = stdout; if (!rawerrorstream) @@ -172,6 +175,12 @@ h5tools_close(void) else rawdatastream = NULL; } + if (rawinstream && rawinstream != stdin) { + if (fclose(rawinstream)) + perror("closing rawinstream"); + else + rawinstream = NULL; + } if (rawoutstream && rawoutstream != stdout) { if (fclose(rawoutstream)) perror("closing rawoutstream"); @@ -198,6 +207,254 @@ h5tools_close(void) } /*------------------------------------------------------------------------- + * Function: h5tools_set_data_output_file + * + * Purpose: Open fname as the output file for dataset raw data. + * Set rawdatastream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + * Programmer: Albert Cheng, 2000/09/30 + * + * Modifications: + * pvn June, 1, 2006. Add a switch for binary output + * + *------------------------------------------------------------------------- + */ +int +h5tools_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 */ + + if (rawdatastream && rawdatastream != stdout) { + if (HDfclose(rawdatastream)) + HDperror("closing rawdatastream"); + else + rawdatastream = NULL; + } + + /* 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: h5tools_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 + * + *------------------------------------------------------------------------- + */ +int +h5tools_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) { + /* binary output */ + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } + } + else { + if ((f = HDfopen(fname, "w")) != NULL) { + rawattrstream = f; + retvalue = SUCCEED; + } + } + } + else { + rawattrstream = NULL; + retvalue = SUCCEED; + } + + return retvalue; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_set_input_file + * + * Purpose: Open fname as the input file for raw input. + * Set rawinstream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + *------------------------------------------------------------------------- + */ +int +h5tools_set_input_file(const char *fname, int is_bin) +{ + int retvalue = FAIL; + FILE *f; /* temporary holding place for the stream pointer + * so that rawinstream is changed only when succeeded */ + + if (rawinstream && rawinstream != stdin) { + if (HDfclose(rawinstream)) + HDperror("closing rawinstream"); + else + rawinstream = NULL; + } + /* First check if filename is string "NULL" */ + if (fname != NULL) { + /* binary output */ + if (is_bin) { + if ((f = HDfopen(fname, "rb")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } + } + else { + if ((f = HDfopen(fname, "r")) != NULL) { + rawinstream = f; + retvalue = SUCCEED; + } + } + } + else { + rawinstream = NULL; + retvalue = SUCCEED; + } + + return retvalue; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_set_output_file + * + * Purpose: Open fname as the output file for raw output. + * Set rawoutstream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + *------------------------------------------------------------------------- + */ +int +h5tools_set_output_file(const char *fname, int is_bin) +{ + int retvalue = FAIL; + FILE *f; /* temporary holding place for the stream pointer + * so that rawoutstream is changed only when succeeded */ + + if (rawoutstream && rawoutstream != stdout) { + if (HDfclose(rawoutstream)) + HDperror("closing rawoutstream"); + else + rawoutstream = NULL; + } + /* First check if filename is string "NULL" */ + if (fname != NULL) { + /* binary output */ + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } + } + else { + if ((f = HDfopen(fname, "w")) != NULL) { + rawoutstream = f; + retvalue = SUCCEED; + } + } + } + else { + rawoutstream = NULL; + retvalue = SUCCEED; + } + + return retvalue; +} + +/*------------------------------------------------------------------------- + * Function: h5tools_set_error_file + * + * Purpose: Open fname as the error output file for dataset raw error. + * Set rawerrorstream as its file stream. + * + * Return: 0 -- succeeded + * negative -- failed + * + *------------------------------------------------------------------------- + */ +int +h5tools_set_error_file(const char *fname, int is_bin) +{ + int retvalue = FAIL; + FILE *f; /* temporary holding place for the stream pointer + * so that rawerrorstream is changed only when succeeded */ + + if (rawerrorstream && rawerrorstream != stderr) { + if (HDfclose(rawerrorstream)) + HDperror("closing rawerrorstream"); + else + rawerrorstream = NULL; + } + + /* First check if filename is string "NULL" */ + if (fname != NULL) { + /* binary output */ + if (is_bin) { + if ((f = HDfopen(fname, "wb")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } + } + else { + if ((f = HDfopen(fname, "w")) != NULL) { + rawerrorstream = f; + retvalue = SUCCEED; + } + } + } + else { + rawerrorstream = NULL; + retvalue = SUCCEED; + } + + return retvalue; +} + +/*------------------------------------------------------------------------- * Audience: Private * Chapter: H5Tools Library * Purpose: Get a FAPL for a driver @@ -1468,7 +1725,7 @@ render_bin_output_region_blocks(hid_t region_space, hid_t region_id, * hssize_t npoints is the number of points in the region *------------------------------------------------------------------------- */ -static int +int render_bin_output_region_data_points(hid_t region_space, hid_t region_id, FILE *stream, hid_t container, int ndims, hid_t type_id, hssize_t npoints) diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index efadba4..ea6a44f 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -532,6 +532,7 @@ H5TOOLS_DLLVAR int packed_data_length; /* lengtht of packed bits to display H5TOOLS_DLLVAR unsigned long long packed_data_mask; /* mask in which packed bits to display */ H5TOOLS_DLLVAR FILE *rawattrstream; /* output stream for raw attribute data */ H5TOOLS_DLLVAR FILE *rawdatastream; /* output stream for raw data */ +H5TOOLS_DLLVAR FILE *rawinstream; /* input stream for raw input */ H5TOOLS_DLLVAR FILE *rawoutstream; /* output stream for raw output */ H5TOOLS_DLLVAR FILE *rawerrorstream; /* output stream for raw error */ H5TOOLS_DLLVAR int bin_output; /* binary output */ @@ -549,6 +550,11 @@ H5TOOLS_DLLVAR int attr_data_output; /* attribute data output */ /* Definitions of useful routines */ H5TOOLS_DLL void h5tools_init(void); H5TOOLS_DLL void h5tools_close(void); +H5TOOLS_DLL int h5tools_set_data_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_attr_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_input_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_output_file(const char *fname, int is_bin); +H5TOOLS_DLL int h5tools_set_error_file(const char *fname, int is_bin); H5TOOLS_DLL hid_t h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, char *drivername, size_t drivername_len); H5TOOLS_DLL hid_t h5tools_get_native_type(hid_t type); @@ -568,8 +574,6 @@ H5TOOLS_DLL void h5tools_region_simple_prefix(FILE *stream, const h5tool_form h5tools_context_t *ctx, hsize_t elmtno, hsize_t *ptdata, int secnum); H5TOOLS_DLL int render_bin_output(FILE *stream, hid_t container, hid_t tid, void *_mem, hsize_t nelmts); -H5TOOLS_DLL int render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, - hid_t container, int ndims, hid_t type_id, hssize_t nblocks, hsize_t *ptdata); H5TOOLS_DLL hbool_t render_bin_output_region_blocks(hid_t region_space, hid_t region_id, FILE *stream, hid_t container); H5TOOLS_DLL hbool_t render_bin_output_region_points(hid_t region_space, hid_t region_id, diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index cde249c..75d3c67 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -3497,7 +3497,7 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, */ void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx, hid_t oid, const char *attr_name, hid_t attr_id, + h5tools_context_t *ctx, const char *attr_name, hid_t attr_id, int display_index, int display_char) { h5tools_str_t buffer; /* string into which to render */ diff --git a/tools/lib/h5tools_dump.h b/tools/lib/h5tools_dump.h index 86f9f99..061a3db 100644 --- a/tools/lib/h5tools_dump.h +++ b/tools/lib/h5tools_dump.h @@ -52,7 +52,7 @@ H5TOOLS_DLL void h5tools_dump_datatype(FILE *stream, const h5tool_format_t *i H5TOOLS_DLL void h5tools_dump_dataspace(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t space); H5TOOLS_DLL void h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, - h5tools_context_t *ctx/*in,out*/, hid_t oid, const char *attr_name, + h5tools_context_t *ctx/*in,out*/, const char *attr_name, hid_t attr_id, int display_index, int display_char); H5TOOLS_DLL void h5tools_dump_oid(FILE *stream, const h5tool_format_t *info, h5tools_context_t *ctx/*in,out*/, hid_t oid); diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 8455360..58d7959 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -724,22 +724,22 @@ trav_table_add(trav_table_t *table, const char *path, const H5O_info_t *oinfo) { - size_t new; + size_t new_obj; if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ - new = table->nobjs++; - table->objs[new].objno = oinfo ? oinfo->addr : HADDR_UNDEF; - table->objs[new].flags[0] = table->objs[new].flags[1] = 0; - table->objs[new].is_same_trgobj = 0; - table->objs[new].name = (char *)HDstrdup(path); - table->objs[new].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; - table->objs[new].nlinks = 0; - table->objs[new].sizelinks = 0; - table->objs[new].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = oinfo ? oinfo->addr : HADDR_UNDEF; + table->objs[new_obj].flags[0] = table->objs[new_obj].flags[1] = 0; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(path); + table->objs[new_obj].type = oinfo ? (h5trav_type_t)oinfo->type : H5TRAV_TYPE_LINK; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; } /*------------------------------------------------------------------------- @@ -807,23 +807,23 @@ void trav_table_addflags(unsigned *flags, h5trav_type_t type, trav_table_t *table) { - unsigned int new; + unsigned int new_obj; if(table->nobjs == table->size) { table->size = MAX(1, table->size * 2); table->objs = (trav_obj_t *)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); } /* end if */ - new = table->nobjs++; - table->objs[new].objno = 0; - table->objs[new].flags[0] = flags[0]; - table->objs[new].flags[1] = flags[1]; - table->objs[new].is_same_trgobj = 0; - table->objs[new].name = (char *)HDstrdup(name); - table->objs[new].type = type; - table->objs[new].nlinks = 0; - table->objs[new].sizelinks = 0; - table->objs[new].links = NULL; + new_obj = table->nobjs++; + table->objs[new_obj].objno = 0; + table->objs[new_obj].flags[0] = flags[0]; + table->objs[new_obj].flags[1] = flags[1]; + table->objs[new_obj].is_same_trgobj = 0; + table->objs[new_obj].name = (char *)HDstrdup(name); + table->objs[new_obj].type = type; + table->objs[new_obj].nlinks = 0; + table->objs[new_obj].sizelinks = 0; + table->objs[new_obj].links = NULL; } @@ -890,7 +890,11 @@ void trav_table_free( trav_table_t *table ) } static herr_t -trav_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data) +trav_attr(hid_t +#ifndef H5TRAV_PRINT_SPACE +UNUSED +#endif /* H5TRAV_PRINT_SPACE */ +obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, void *op_data) { char *buf; diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index dc98967..8e1003e 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -41,12 +41,6 @@ SET (H5_DEP_EXECUTABLES # CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) #ENDIF (NOT WIN32) -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - IF (BUILD_TESTING) # -------------------------------------------------------------------- # Add the misc test executables @@ -65,272 +59,8 @@ IF (BUILD_TESTING) TARGET_C_PROPERTIES (h5repart_test " " " ") TARGET_LINK_LIBRARIES (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) SET_TARGET_PROPERTIES (h5repart_test PROPERTIES FOLDER tools) - - # -------------------------------------------------------------------- - # Copy all the HDF5 files from the source directory into the test directory - # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_TEST_FILES - family_file00000.h5 - family_file00001.h5 - family_file00002.h5 - family_file00003.h5 - family_file00004.h5 - family_file00005.h5 - family_file00006.h5 - family_file00007.h5 - family_file00008.h5 - family_file00009.h5 - family_file00010.h5 - family_file00011.h5 - family_file00012.h5 - family_file00013.h5 - family_file00014.h5 - family_file00015.h5 - family_file00016.h5 - family_file00017.h5 - ) - - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5repart - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} - ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - - SET (HDF5_MKGRP_TEST_FILES - #h5mkgrp_help.txt - #h5mkgrp_version - h5mkgrp_single.ls - h5mkgrp_single_v.ls - h5mkgrp_single_p.ls - h5mkgrp_single_l.ls - h5mkgrp_several.ls - h5mkgrp_several_v.ls - h5mkgrp_several_p.ls - h5mkgrp_several_l.ls - h5mkgrp_nested_p.ls - h5mkgrp_nested_lp.ls - h5mkgrp_nested_mult_p.ls - h5mkgrp_nested_mult_lp.ls - ) - - # make test dir - FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - - FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") - #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5mkgrp - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} - ) - ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) - - ADD_CUSTOM_COMMAND ( - TARGET h5mkgrp - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt - ) - CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - MACRO (ADD_H5_TEST resultfile resultcode resultoption) - IF (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err - ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) - - ADD_TEST ( - NAME H5MKGRP-${resultfile} - COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN} - ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (HDF5_ENABLE_USING_MEMCHECKER) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) - ADD_TEST ( - NAME H5MKGRP-${resultfile}-h5ls - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" - -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_MASK_MOD=true" - -D "TEST_REFERENCE=${resultfile}.ls" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) - - MACRO (ADD_H5_CMP resultfile resultcode) - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) - ELSE (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP_CMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err - ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - ADD_TEST ( - NAME H5MKGRP_CMP-${resultfile} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp>" - -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${resultfile}.out" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_REFERENCE=${resultfile}.txt" - -P "${HDF5_RESOURCES_DIR}/runTest.cmake" - ) - SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - ENDMACRO (ADD_H5_CMP resultfile resultcode) - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # Remove any output file left over from previous test run - ADD_TEST ( - NAME H5REPART-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - fst_family00000.h5 - scd_family00000.h5 - scd_family00001.h5 - scd_family00002.h5 - scd_family00003.h5 - family_to_sec2.h5 - ) - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5REPART-clearall-objects") - - # repartition family member size to 20,000 bytes. - ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) - - # repartition family member size to 5 KB. - ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) - - # convert family file to sec2 file of 20,000 bytes - ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) - SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) - - # test the output files repartitioned above. - ADD_TEST (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) - SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) - - SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} - h5repart_test - ) - - IF (HDF5_ENABLE_USING_MEMCHECKER) - ADD_TEST ( - NAME H5MKGRP-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5mkgrp_help.out - h5mkgrp_help.out.err - h5mkgrp_version.out - h5mkgrp_version.out.err - h5mkgrp_single.h5 - h5mkgrp_single.out - h5mkgrp_single.out.err - h5mkgrp_single_v.h5 - h5mkgrp_single_v.out - h5mkgrp_single_v.out.err - h5mkgrp_single_p.h5 - h5mkgrp_single_p.out - h5mkgrp_single_p.out.err - h5mkgrp_single_l.h5 - h5mkgrp_single_l.out - h5mkgrp_single_l.out.err - h5mkgrp_several.h5 - h5mkgrp_several.out - h5mkgrp_several.out.err - h5mkgrp_several_v.h5 - h5mkgrp_several_v.out - h5mkgrp_several_v.out.err - h5mkgrp_several_p.h5 - h5mkgrp_several_p.out - h5mkgrp_several_p.out.err - h5mkgrp_several_l.h5 - h5mkgrp_several_l.out - h5mkgrp_several_l.out.err - h5mkgrp_nested_p.h5 - h5mkgrp_nested_p.out - h5mkgrp_nested_p.out.err - h5mkgrp_nested_lp.h5 - h5mkgrp_nested_lp.out - h5mkgrp_nested_lp.out.err - h5mkgrp_nested_mult_p.h5 - h5mkgrp_nested_mult_p.out - h5mkgrp_nested_mult_p.out.err - h5mkgrp_nested_mult_lp.h5 - h5mkgrp_nested_mult_lp.out - h5mkgrp_nested_mult_lp.out.err - ) - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - IF (NOT "${last_test}" STREQUAL "") - SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - ENDIF (NOT "${last_test}" STREQUAL "") - SET (last_test "H5MKGRP-clearall-objects") - ENDIF (HDF5_ENABLE_USING_MEMCHECKER) - - # Check that help & version is displayed properly - ADD_H5_CMP (h5mkgrp_help 0 "-h") - ADD_H5_CMP (h5mkgrp_version 0 "-V") - - # Create single group at root level - ADD_H5_TEST (h5mkgrp_single 0 "" single) - ADD_H5_TEST (h5mkgrp_single_v 0 "-v" single) - ADD_H5_TEST (h5mkgrp_single_p 0 "-p" single) - ADD_H5_TEST (h5mkgrp_single_l 0 "-l" latest) - - # Create several groups at root level - ADD_H5_TEST (h5mkgrp_several 0 "" one two) - ADD_H5_TEST (h5mkgrp_several_v 0 "-v" one two) - ADD_H5_TEST (h5mkgrp_several_p 0 "-p" one two) - ADD_H5_TEST (h5mkgrp_several_l 0 "-l" one two) - # Create various nested groups - ADD_H5_TEST (h5mkgrp_nested_p 0 "-p" /one/two) - ADD_H5_TEST (h5mkgrp_nested_lp 0 "-lp" /one/two) - ADD_H5_TEST (h5mkgrp_nested_mult_p 0 "-p" /one/two /three/four) - ADD_H5_TEST (h5mkgrp_nested_mult_lp 0 "-lp" /one/two /three/four) + INCLUDE (CMakeTests.cmake) ENDIF (BUILD_TESTING) ############################################################################## diff --git a/tools/misc/CMakeTests.cmake b/tools/misc/CMakeTests.cmake new file mode 100644 index 0000000..cc9c5e2 --- /dev/null +++ b/tools/misc/CMakeTests.cmake @@ -0,0 +1,272 @@ + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + # -------------------------------------------------------------------- + # Copy all the HDF5 files from the source directory into the test directory + # -------------------------------------------------------------------- + SET (HDF5_REFERENCE_TEST_FILES + family_file00000.h5 + family_file00001.h5 + family_file00002.h5 + family_file00003.h5 + family_file00004.h5 + family_file00005.h5 + family_file00006.h5 + family_file00007.h5 + family_file00008.h5 + family_file00009.h5 + family_file00010.h5 + family_file00011.h5 + family_file00012.h5 + family_file00013.h5 + family_file00014.h5 + family_file00015.h5 + family_file00016.h5 + family_file00017.h5 + ) + + FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") + #MESSAGE (STATUS " Copying ${h5_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5repart + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} + ) + ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + SET (HDF5_MKGRP_TEST_FILES + #h5mkgrp_help.txt + #h5mkgrp_version + h5mkgrp_single.ls + h5mkgrp_single_v.ls + h5mkgrp_single_p.ls + h5mkgrp_single_l.ls + h5mkgrp_several.ls + h5mkgrp_several_v.ls + h5mkgrp_several_p.ls + h5mkgrp_several_l.ls + h5mkgrp_nested_p.ls + h5mkgrp_nested_lp.ls + h5mkgrp_nested_mult_p.ls + h5mkgrp_nested_mult_lp.ls + ) + + # make test dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + + FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${h5_mkgrp_file}") + #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5mkgrp + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file} ${dest} + ) + ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + + ADD_CUSTOM_COMMAND ( + TARGET h5mkgrp + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_help.txt ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_help.txt + ) + CONFIGURE_FILE (${PROJECT_SOURCE_DIR}/testfiles/h5mkgrp_version.txt.in ${PROJECT_BINARY_DIR}/testfiles/h5mkgrp_version.txt @ONLY) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + MACRO (ADD_H5_TEST resultfile resultcode resultoption) + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + + ADD_TEST ( + NAME H5MKGRP-${resultfile} + COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN} + ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (HDF5_ENABLE_USING_MEMCHECKER) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) + ADD_TEST ( + NAME H5MKGRP-${resultfile}-h5ls + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" + -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_MOD=true" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5MKGRP-${resultfile}-h5ls PROPERTIES DEPENDS H5MKGRP-${resultfile}) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) + + MACRO (ADD_H5_CMP resultfile resultcode) + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) + ELSE (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP_CMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.h5 + ${resultfile}.out + ${resultfile}.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + ADD_TEST ( + NAME H5MKGRP_CMP-${resultfile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.txt" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + SET_TESTS_PROPERTIES (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + ENDMACRO (ADD_H5_CMP resultfile resultcode) + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # Remove any output file left over from previous test run + ADD_TEST ( + NAME H5REPART-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + fst_family00000.h5 + scd_family00000.h5 + scd_family00001.h5 + scd_family00002.h5 + scd_family00003.h5 + family_to_sec2.h5 + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPART-clearall-objects") + + # repartition family member size to 20,000 bytes. + ADD_TEST (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart> -m 20000 family_file%05d.h5 fst_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_20K PROPERTIES DEPENDS H5REPART-clearall-objects) + + # repartition family member size to 5 KB. + ADD_TEST (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart> -m 5k family_file%05d.h5 scd_family%05d.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects) + + # convert family file to sec2 file of 20,000 bytes + ADD_TEST (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + SET_TESTS_PROPERTIES (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects) + + # test the output files repartitioned above. + ADD_TEST (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) + SET_TESTS_PROPERTIES (H5REPART-h5repart_test PROPERTIES DEPENDS H5REPART-clearall-objects DEPENDS H5REPART-h5repart_20K DEPENDS H5REPART-h5repart_5K DEPENDS H5REPART-h5repart_sec2) + + SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} + h5repart_test + ) + + IF (HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5MKGRP-clearall-objects + COMMAND ${CMAKE_COMMAND} + -E remove + h5mkgrp_help.out + h5mkgrp_help.out.err + h5mkgrp_version.out + h5mkgrp_version.out.err + h5mkgrp_single.h5 + h5mkgrp_single.out + h5mkgrp_single.out.err + h5mkgrp_single_v.h5 + h5mkgrp_single_v.out + h5mkgrp_single_v.out.err + h5mkgrp_single_p.h5 + h5mkgrp_single_p.out + h5mkgrp_single_p.out.err + h5mkgrp_single_l.h5 + h5mkgrp_single_l.out + h5mkgrp_single_l.out.err + h5mkgrp_several.h5 + h5mkgrp_several.out + h5mkgrp_several.out.err + h5mkgrp_several_v.h5 + h5mkgrp_several_v.out + h5mkgrp_several_v.out.err + h5mkgrp_several_p.h5 + h5mkgrp_several_p.out + h5mkgrp_several_p.out.err + h5mkgrp_several_l.h5 + h5mkgrp_several_l.out + h5mkgrp_several_l.out.err + h5mkgrp_nested_p.h5 + h5mkgrp_nested_p.out + h5mkgrp_nested_p.out.err + h5mkgrp_nested_lp.h5 + h5mkgrp_nested_lp.out + h5mkgrp_nested_lp.out.err + h5mkgrp_nested_mult_p.h5 + h5mkgrp_nested_mult_p.out + h5mkgrp_nested_mult_p.out.err + h5mkgrp_nested_mult_lp.h5 + h5mkgrp_nested_mult_lp.out + h5mkgrp_nested_mult_lp.out.err + ) + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5MKGRP-clearall-objects") + ENDIF (HDF5_ENABLE_USING_MEMCHECKER) + + # Check that help & version is displayed properly + ADD_H5_CMP (h5mkgrp_help 0 "-h") + ADD_H5_CMP (h5mkgrp_version 0 "-V") + + # Create single group at root level + ADD_H5_TEST (h5mkgrp_single 0 "" single) + ADD_H5_TEST (h5mkgrp_single_v 0 "-v" single) + ADD_H5_TEST (h5mkgrp_single_p 0 "-p" single) + ADD_H5_TEST (h5mkgrp_single_l 0 "-l" latest) + + # Create several groups at root level + ADD_H5_TEST (h5mkgrp_several 0 "" one two) + ADD_H5_TEST (h5mkgrp_several_v 0 "-v" one two) + ADD_H5_TEST (h5mkgrp_several_p 0 "-p" one two) + ADD_H5_TEST (h5mkgrp_several_l 0 "-l" one two) + + # Create various nested groups + ADD_H5_TEST (h5mkgrp_nested_p 0 "-p" /one/two) + ADD_H5_TEST (h5mkgrp_nested_lp 0 "-lp" /one/two) + ADD_H5_TEST (h5mkgrp_nested_mult_p 0 "-p" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_mult_lp 0 "-lp" /one/two /three/four) diff --git a/tools/misc/h5mkgrp.c b/tools/misc/h5mkgrp.c index b9fb588..8dee706 100644 --- a/tools/misc/h5mkgrp.c +++ b/tools/misc/h5mkgrp.c @@ -115,7 +115,7 @@ usage: h5mkgrp [OPTIONS] FILE GROUP...\n\ *------------------------------------------------------------------------- */ static int -parse_command_line(int argc, const char *argv[], param_t *params) +parse_command_line(int argc, const char *argv[], param_t *parms) { int opt; /* Option from command line */ size_t curr_group; /* Current group name to copy */ @@ -136,17 +136,17 @@ parse_command_line(int argc, const char *argv[], param_t *params) /* Create objects with the latest version of the format */ case 'l': - params->latest = TRUE; + parms->latest = TRUE; break; /* Create parent groups */ case 'p': - params->parents = TRUE; + parms->parents = TRUE; break; /* Verbose output */ case 'v': - params->verbose = TRUE; + parms->verbose = TRUE; break; /* Display version */ @@ -169,7 +169,7 @@ parse_command_line(int argc, const char *argv[], param_t *params) } /* end if */ /* Retrieve file name */ - params->fname = HDstrdup(argv[opt_ind]); + parms->fname = HDstrdup(argv[opt_ind]); opt_ind++; /* Check for group(s) to be created */ @@ -180,24 +180,24 @@ parse_command_line(int argc, const char *argv[], param_t *params) } /* end if */ /* Allocate space for the group name pointers */ - params->ngroups = (argc - opt_ind); - params->groups = HDmalloc(params->ngroups * sizeof(char *)); + parms->ngroups = (argc - opt_ind); + parms->groups = HDmalloc(parms->ngroups * sizeof(char *)); /* Retrieve the group names */ curr_group = 0; while(opt_ind < argc) { - params->groups[curr_group] = HDstrdup(argv[opt_ind]); + parms->groups[curr_group] = HDstrdup(argv[opt_ind]); curr_group++; opt_ind++; } /* end while */ #ifdef QAK -HDfprintf(stderr, "params->parents = %t\n", params->parents); -HDfprintf(stderr, "params->verbose = %t\n", params->verbose); -HDfprintf(stderr, "params->fname = '%s'\n", params->fname); -HDfprintf(stderr, "params->ngroups = %Zu\n", params->ngroups); -for(curr_group = 0; curr_group < params->ngroups; curr_group++) - HDfprintf(stderr, "params->group[%Zu] = '%s'\n", curr_group, params->groups[curr_group]); +HDfprintf(stderr, "parms->parents = %t\n", parms->parents); +HDfprintf(stderr, "parms->verbose = %t\n", parms->verbose); +HDfprintf(stderr, "parms->fname = '%s'\n", parms->fname); +HDfprintf(stderr, "parms->ngroups = %Zu\n", parms->ngroups); +for(curr_group = 0; curr_group < parms->ngroups; curr_group++) + HDfprintf(stderr, "parms->group[%Zu] = '%s'\n", curr_group, parms->groups[curr_group]); #endif /* QAK */ return(0); diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index d41dfc9..07f6bfd 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -301,7 +301,7 @@ main (int argc, char *argv[]) n = blk_size; if (dst_is_family) n = (size_t)MIN((off_t)n, dst_size-dst_offset); if (left_overs) { - n = (size_t)MIN (n, left_overs); + n = (size_t)MIN ((off_t)n, left_overs); left_overs -= n; need_write = FALSE; } else if (src_offset<src_act_size) { diff --git a/tools/testfiles/h5dump-help.txt b/tools/testfiles/h5dump-help.txt index b735b18..2a59a32 100644 --- a/tools/testfiles/h5dump-help.txt +++ b/tools/testfiles/h5dump-help.txt @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,3 +125,11 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + diff --git a/tools/testfiles/tall-7.ddl b/tools/testfiles/tall-7.ddl new file mode 100644 index 0000000..f0ad5ea --- /dev/null +++ b/tools/testfiles/tall-7.ddl @@ -0,0 +1,9 @@ +HDF5 "tall.h5" { +ATTRIBUTE "attr1" { + DATATYPE H5T_STD_I8BE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + DATA { + (0): 97, 98, 99, 100, 101, 102, 103, 104, 105, 0 + } +} +} diff --git a/tools/testfiles/tall-7N.ddl b/tools/testfiles/tall-7N.ddl new file mode 100644 index 0000000..cba5774 --- /dev/null +++ b/tools/testfiles/tall-7N.ddl @@ -0,0 +1,17 @@ +HDF5 "tall.h5" { +ATTRIBUTE "attr1" { + DATATYPE H5T_STD_I8BE + DATASPACE SIMPLE { ( 10 ) / ( 10 ) } + DATA { + (0): 97, 98, 99, 100, 101, 102, 103, 104, 105, 0 + } +} +ATTRIBUTE "attr1" { + DATATYPE H5T_STD_I8BE + DATASPACE SIMPLE { ( 27 ) / ( 27 ) } + DATA { + (0): 49, 115, 116, 32, 97, 116, 116, 114, 105, 98, 117, 116, 101, 32, 111, + (15): 102, 32, 100, 115, 101, 116, 49, 46, 49, 46, 49, 0 + } +} +} diff --git a/tools/testfiles/tnofilename-with-packed-bits.ddl b/tools/testfiles/tnofilename-with-packed-bits.ddl index e8d6d84..1ad1249 100644 --- a/tools/testfiles/tnofilename-with-packed-bits.ddl +++ b/tools/testfiles/tnofilename-with-packed-bits.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: missing file name diff --git a/tools/testfiles/tpbitsIncomplete.ddl b/tools/testfiles/tpbitsIncomplete.ddl index 06c5613..1468ad1 100644 --- a/tools/testfiles/tpbitsIncomplete.ddl +++ b/tools/testfiles/tpbitsIncomplete.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Bad mask list(0,2,2,1,0,2,2,) diff --git a/tools/testfiles/tpbitsLengthExceeded.ddl b/tools/testfiles/tpbitsLengthExceeded.ddl index ffd9910..557f2a7 100644 --- a/tools/testfiles/tpbitsLengthExceeded.ddl +++ b/tools/testfiles/tpbitsLengthExceeded.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Packed Bit offset+length value(65) too large. Max is 64 diff --git a/tools/testfiles/tpbitsLengthPositive.ddl b/tools/testfiles/tpbitsLengthPositive.ddl index a54812b..342e4e8 100644 --- a/tools/testfiles/tpbitsLengthPositive.ddl +++ b/tools/testfiles/tpbitsLengthPositive.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Packed Bit length value(0) must be positive. diff --git a/tools/testfiles/tpbitsMaxExceeded.ddl b/tools/testfiles/tpbitsMaxExceeded.ddl index 1a8dd11..eb569d2 100644 --- a/tools/testfiles/tpbitsMaxExceeded.ddl +++ b/tools/testfiles/tpbitsMaxExceeded.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Too many masks requested (max. 8). Mask list(0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1) diff --git a/tools/testfiles/tpbitsOffsetExceeded.ddl b/tools/testfiles/tpbitsOffsetExceeded.ddl index 7527131..a00b561 100644 --- a/tools/testfiles/tpbitsOffsetExceeded.ddl +++ b/tools/testfiles/tpbitsOffsetExceeded.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Packed Bit offset value(64) must be between 0 and 63 diff --git a/tools/testfiles/tpbitsOffsetNegative.ddl b/tools/testfiles/tpbitsOffsetNegative.ddl index 21b573d..aa6e79b 100644 --- a/tools/testfiles/tpbitsOffsetNegative.ddl +++ b/tools/testfiles/tpbitsOffsetNegative.ddl @@ -1,35 +1,33 @@ usage: h5dump [OPTIONS] files OPTIONS -h, --help Print a usage message and exit + -V, --version Print version number and exit +--------------- File Options --------------- -n, --contents Print a list of the file contents and exit Optional value 1 also prints attributes. -B, --superblock Print the content of the super block -H, --header Print the header only; no data is displayed - -A, --onlyattr Print the header and value of attributes - Optional value 0 suppresses printing attributes. - -i, --object-ids Print the object ids - -r, --string Print 1-byte integer datasets as ASCII - -e, --escape Escape non printing characters - -V, --version Print version number and exit + -f D, --filedriver=D Specify which driver to open the file with + -o F, --output=F Output raw data into file F + -b B, --binary=B Binary file output, of form B + -O F, --ddl=F Output ddl text into file F + Do not use filename F to suppress ddl display +--------------- Object Options --------------- -a P, --attribute=P Print the specified attribute If an attribute name contains a slash (/), escape the slash with a preceding backslash (\). (See example section below.) -d P, --dataset=P Print the specified dataset - -y, --noindex Do not print array indices with the data - -p, --properties Print dataset filters, storage layout and fill value - -f D, --filedriver=D Specify which driver to open the file with -g P, --group=P Print the specified group and all members -l P, --soft-link=P Print the value(s) of the specified soft link - -o F, --output=F Output raw data into file F - -b B, --binary=B Binary file output, of form B -t P, --datatype=P Print the specified named datatype - -w N, --width=N Set the number of columns of output. A value of 0 (zero) - sets the number of columns to the maximum (65535). - Default width is 80 columns. - -m T, --format=T Set the floating point output format - -q Q, --sort_by=Q Sort groups and attributes by index Q - -z Z, --sort_order=Z Sort groups and attributes by order Z + -N P, --any_path=P Print any attribute, dataset, group, datatype, or link that matches P + P can be the absolute path or just a relative path. + -A, --onlyattr Print the header and value of attributes + Optional value 0 suppresses printing attributes. +--------------- Object Property Options --------------- + -i, --object-ids Print the object ids + -p, --properties Print dataset filters, storage layout and fill value -M L, --packedbits=L Print packed bits as unsigned integers, using mask format L for an integer dataset specified with option -d. L is a list of offset,length values, @@ -37,19 +35,29 @@ usage: h5dump [OPTIONS] files the data value and length is the number of bits of the mask. -R, --region Print dataset pointed by region references +--------------- Formatting Options --------------- + -e, --escape Escape non printing characters + -r, --string Print 1-byte integer datasets as ASCII + -y, --noindex Do not print array indices with the data + -m T, --format=T Set the floating point output format + -q Q, --sort_by=Q Sort groups and attributes by index Q + -z Z, --sort_order=Z Sort groups and attributes by order Z + --enable-error-stack Prints messages from the HDF5 error stack as they + occur. + --no-compact-subset Disable compact form of subsetting and allow the use + of "[" in dataset names. + -w N, --width=N Set the number of columns of output. A value of 0 (zero) + sets the number of columns to the maximum (65535). + Default width is 80 columns. +--------------- XML Options --------------- -x, --xml Output in XML using Schema -u, --use-dtd Output in XML using DTD -D U, --xml-dtd=U Use the DTD or schema at U -X S, --xml-ns=S (XML Schema) Use qualified names n the XML ":": no namespace, default: "hdf5:" E.g., to dump a file called `-f', use h5dump -- -f - --enable-error-stack Prints messages from the HDF5 error stack as they - occur. - --no-compact-subset Disable compact form of subsetting and allow the use - of "[" in dataset names. - -O F, --ddl=F Output ddl text into file F - Do not use filename F to suppress ddl display +--------------- Subsetting Options --------------- Subsetting is available by using the following options with a dataset attribute. Subsetting is done by selecting a hyperslab from the data. Thus, the options mirror those for performing a hyperslab selection. @@ -65,20 +73,13 @@ usage: h5dump [OPTIONS] files number of dimensions in the dataspace being queried (Alternate compact form of subsetting is described in the Reference Manual) +--------------- Option Argument Conventions --------------- D - is the file driver to use in opening the file. Acceptable values are "sec2", "family", "split", "multi", "direct", and "stream". Without the file driver flag, the file will be opened with each driver in turn and in the order specified above until one driver succeeds in opening the file. - These are the letters that are appended to the file name(without .h5) when opening - names for the split(m,r) and multi(s,b,r,g,l,o) drivers. They are: - m: All meta data when using the split driver. - s: The userblock, superblock, and driver info block - b: B-tree nodes - r: Dataset raw data - g: Global heap - l: local heap (object names) - o: object headers + See examples below for family, split, and multi driver special file name usage. F - is a filename. P - is the full path from the root group to the object. @@ -93,7 +94,7 @@ usage: h5dump [OPTIONS] files Q - is the sort index type. It can be "creation_order" or "name" (default) Z - is the sort order type. It can be "descending" or "ascending" (default) - Examples: +--------------- Examples --------------- 1) Attribute foo of the group /bar_none in file quux.h5 @@ -124,4 +125,12 @@ usage: h5dump [OPTIONS] files h5dump -d /foo -f split splitfile + 7) Dataset foo in multi files mf-s.h5, mf-b.h5, mf-r.h5, mf-g.h5, mf-l.h5 and mf-o.h5 + + h5dump -d /foo -f multi mf + + 8) Dataset foo in family files fam00000.h5 fam00001.h5 and fam00002.h5 + + h5dump -d /foo -f family fam%05d.h5 + h5dump error: Bad mask list(-1,1) |