summaryrefslogtreecommitdiffstats
path: root/tools/test
diff options
context:
space:
mode:
Diffstat (limited to 'tools/test')
-rw-r--r--tools/test/h5copy/CMakeLists.txt28
-rw-r--r--tools/test/h5copy/CMakeTests.cmake124
-rw-r--r--tools/test/h5copy/h5copygentest.c114
-rw-r--r--tools/test/h5copy/testfiles/h5copy_misc1.err1
-rw-r--r--tools/test/h5copy/testfiles/h5copy_misc1.out1
-rw-r--r--tools/test/h5copy/testh5copy.sh.in16
-rw-r--r--tools/test/h5diff/CMakeLists.txt28
-rw-r--r--tools/test/h5diff/CMakeTests.cmake205
-rw-r--r--tools/test/h5diff/h5diff_plugin.sh.in87
-rw-r--r--tools/test/h5diff/h5diffgentest.c470
-rw-r--r--tools/test/h5diff/testfiles/dangling_link.err (renamed from tools/test/h5diff/testfiles/h5diff_459_ERR.err)0
-rw-r--r--tools/test/h5diff/testfiles/h5diff_454_ERR.err4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_454_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_455_ERR.err4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_455_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_457_ERR.err4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_457_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_458_ERR.err4
-rw-r--r--tools/test/h5diff/testfiles/h5diff_458_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_459_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_600.txt1
-rw-r--r--tools/test/h5diff/testfiles/h5diff_601_ERR.txt6
-rw-r--r--tools/test/h5diff/testfiles/h5diff_udfail.err12
-rw-r--r--tools/test/h5diff/testfiles/h5diff_udfail.txt1
-rw-r--r--tools/test/h5diff/testh5diff.sh.in6
-rw-r--r--tools/test/h5dump/CMakeLists.txt56
-rw-r--r--tools/test/h5dump/CMakeTests.cmake673
-rw-r--r--tools/test/h5dump/CMakeTestsPBITS.cmake145
-rw-r--r--tools/test/h5dump/CMakeTestsVDS.cmake111
-rw-r--r--tools/test/h5dump/CMakeTestsXML.cmake173
-rw-r--r--tools/test/h5dump/CMakeVFDTests.cmake91
-rw-r--r--tools/test/h5dump/errfiles/filter_fail.err19
-rw-r--r--tools/test/h5dump/errfiles/tall-1.err26
-rw-r--r--tools/test/h5dump/errfiles/tall-2A.err26
-rw-r--r--tools/test/h5dump/errfiles/tall-2A0.err26
-rw-r--r--tools/test/h5dump/errfiles/tall-2B.err26
-rw-r--r--tools/test/h5dump/errfiles/tarray1_big.err33
-rw-r--r--tools/test/h5dump/errfiles/tattr-3.err13
-rw-r--r--tools/test/h5dump/errfiles/tattrregR.err22
-rw-r--r--tools/test/h5dump/errfiles/tcomp-3.err19
-rw-r--r--tools/test/h5dump/errfiles/tdataregR.err22
-rw-r--r--tools/test/h5dump/errfiles/tdset-2.err36
-rw-r--r--tools/test/h5dump/errfiles/textlink.err52
-rw-r--r--tools/test/h5dump/errfiles/textlinkfar.err39
-rw-r--r--tools/test/h5dump/errfiles/textlinksrc.err39
-rw-r--r--tools/test/h5dump/errfiles/tgroup-2.err19
-rw-r--r--tools/test/h5dump/errfiles/torderlinks1.err26
-rw-r--r--tools/test/h5dump/errfiles/torderlinks2.err26
-rw-r--r--tools/test/h5dump/errfiles/tperror.err36
-rw-r--r--tools/test/h5dump/errfiles/tslink-D.err25
-rw-r--r--tools/test/h5dump/h5dumpgentest.c98
-rw-r--r--tools/test/h5dump/testh5dump.sh.in61
-rw-r--r--tools/test/h5dump/testh5dumppbits.sh.in4
-rw-r--r--tools/test/h5format_convert/CMakeLists.txt19
-rw-r--r--tools/test/h5format_convert/CMakeTests.cmake261
-rw-r--r--tools/test/h5format_convert/h5fc_gentest.c357
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_d_file-d.ddl25
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_d_file.ddl1
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_d_file.ddl.err1
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_dname.ddl1
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_dname.err1
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl.err (renamed from tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl)0
-rw-r--r--tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl.err (renamed from tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl)0
-rw-r--r--tools/test/h5format_convert/testh5fc.sh.in60
-rw-r--r--tools/test/h5import/CMakeLists.txt11
-rw-r--r--tools/test/h5import/CMakeTests.cmake260
-rw-r--r--tools/test/h5import/h5importtest.c168
-rw-r--r--tools/test/h5jam/CMakeLists.txt28
-rw-r--r--tools/test/h5jam/CMakeTests.cmake84
-rw-r--r--tools/test/h5jam/getub.c2
-rw-r--r--tools/test/h5jam/h5jamgentest.c6
-rw-r--r--tools/test/h5jam/tellub.c8
-rw-r--r--tools/test/h5ls/CMakeLists.txt44
-rw-r--r--tools/test/h5ls/CMakeTests.cmake200
-rw-r--r--tools/test/h5ls/CMakeTestsVDS.cmake82
-rw-r--r--tools/test/h5ls/errfiles/nosuchfile.err1
-rw-r--r--tools/test/h5ls/errfiles/textlinksrc-nodangle-1.err2
-rw-r--r--tools/test/h5ls/errfiles/tgroup-1.err2
-rw-r--r--tools/test/h5ls/testh5ls.sh.in11
-rw-r--r--tools/test/h5repack/CMakeLists.txt113
-rw-r--r--tools/test/h5repack/CMakeTests.cmake653
-rw-r--r--tools/test/h5repack/CMakeVFDTests.cmake104
-rw-r--r--tools/test/h5repack/Makefile.am5
-rw-r--r--tools/test/h5repack/h5repack.sh.in129
-rw-r--r--tools/test/h5repack/h5repackgentest.c340
-rw-r--r--tools/test/h5repack/h5repacktst.c170
-rw-r--r--tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl6
-rw-r--r--tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl4
-rw-r--r--tools/test/h5repack/testfiles/h5repack-help.txt81
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le.h5bin0 -> 2336 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le_ex-0.datbin0 -> 288 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_f32le_ex.h5bin0 -> 1464 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d.h5bin0 -> 2096 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.datbin0 -> 24 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5bin0 -> 1504 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d.h5bin0 -> 2304 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.datbin0 -> 256 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5bin0 -> 1472 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d.h5bin0 -> 4096 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.datbin0 -> 2048 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5bin0 -> 1472 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst29
-rw-r--r--tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl14
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be.h5bin0 -> 2304 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.datbin0 -> 64 bytes
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat1
-rw-r--r--tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5bin0 -> 1608 bytes
-rw-r--r--tools/test/h5repack/testh5repack_detect_szip.c4
-rw-r--r--tools/test/h5stat/CMakeLists.txt6
-rw-r--r--tools/test/h5stat/CMakeTests.cmake81
-rw-r--r--tools/test/h5stat/h5stat_gentest.c326
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_dims.err (renamed from tools/test/h5stat/testfiles/h5stat_err1_dims.ddl)0
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_links.err (renamed from tools/test/h5stat/testfiles/h5stat_err1_links.ddl)0
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err1_numattrs.err (renamed from tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl)0
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err2_numattrs.err (renamed from tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl)0
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_old_fill.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_old_fill.err1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_old_layout.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_old_layout.err1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_refcount.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_err_refcount.err1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help1.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_help2.ddl10
-rw-r--r--tools/test/h5stat/testfiles/h5stat_nofile.ddl11
-rw-r--r--tools/test/h5stat/testfiles/h5stat_nofile.err1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_notexist.ddl1
-rw-r--r--tools/test/h5stat/testfiles/h5stat_notexist.err1
-rw-r--r--tools/test/h5stat/testh5stat.sh.in36
-rw-r--r--tools/test/misc/CMakeLists.txt50
-rw-r--r--tools/test/misc/CMakeTestsClear.cmake354
-rw-r--r--tools/test/misc/CMakeTestsMkgrp.cmake124
-rw-r--r--tools/test/misc/CMakeTestsRepart.cmake57
-rw-r--r--tools/test/misc/h5clear_gentest.c140
-rw-r--r--tools/test/misc/h5perf_gentest.c666
-rw-r--r--tools/test/misc/repart_test.c21
-rw-r--r--tools/test/misc/talign.c34
-rw-r--r--tools/test/misc/testfiles/h5clear_missing_file.ddl1
-rw-r--r--tools/test/misc/testfiles/h5clear_missing_file.err1
-rw-r--r--tools/test/misc/testfiles/h5clear_no_mdc_image.err (renamed from tools/test/misc/testfiles/h5clear_no_mdc_image.ddl)0
-rw-r--r--tools/test/misc/testfiles/h5clear_open_fail.err (renamed from tools/test/misc/testfiles/h5clear_open_fail.ddl)0
-rw-r--r--tools/test/misc/testh5clear.sh.in72
-rw-r--r--tools/test/misc/testh5repart.sh.in6
-rw-r--r--tools/test/misc/vds/CMakeLists.txt11
-rw-r--r--tools/test/perform/CMakeLists.txt133
-rw-r--r--tools/test/perform/CMakeTests.cmake61
-rw-r--r--tools/test/perform/Makefile.am4
-rw-r--r--tools/test/perform/chunk_cache.c405
-rw-r--r--tools/test/perform/iopipe.c14
-rw-r--r--tools/test/perform/overhead.c6
-rw-r--r--tools/test/perform/perf.c33
-rw-r--r--tools/test/perform/perf_meta.c28
-rw-r--r--tools/test/perform/pio_engine.c137
-rw-r--r--tools/test/perform/pio_perf.c344
-rw-r--r--tools/test/perform/pio_standalone.c110
-rw-r--r--tools/test/perform/pio_standalone.h2
-rw-r--r--tools/test/perform/sio_engine.c125
-rw-r--r--tools/test/perform/sio_perf.c254
-rw-r--r--tools/test/perform/sio_standalone.c119
-rw-r--r--tools/test/perform/sio_standalone.h2
-rw-r--r--tools/test/perform/zip_perf.c6
163 files changed, 5305 insertions, 4883 deletions
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt
index a71a12a..1130ea7 100644
--- a/tools/test/h5copy/CMakeLists.txt
+++ b/tools/test/h5copy/CMakeLists.txt
@@ -4,29 +4,29 @@ project (HDF5_TOOLS_TEST_H5COPY C)
# --------------------------------------------------------------------
# Add the h5copy test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5copygentest ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/h5copygentest.c)
- target_include_directories(h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5copygentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5copygentest STATIC)
target_link_libraries (h5copygentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
+ #add_test (NAME h5copygentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copygentest>)
endif ()
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5COPY_TOOL_PLUGIN_LIB_CORENAME "dynlibcopy")
+ set (H5COPY_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5COPY_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5COPY_TOOL_PLUGIN_LIB_TARGET ${H5COPY_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_copy.c)
+ target_include_directories (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5COPY_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5COPY_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5COPY_TOOL_PLUGIN_LIB_TARGET} ${H5COPY_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -34,12 +34,12 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5COPY_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5COPY_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5COPY_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake
index 924ade1..b0d1615 100644
--- a/tools/test/h5copy/CMakeTests.cmake
+++ b/tools/test/h5copy/CMakeTests.cmake
@@ -30,6 +30,7 @@
set (LIST_OTHER_TEST_FILES
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
+ ${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.err
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5.txt
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/tudfilter.h5_ERR.txt
${HDF5_TOOLS_TEST_H5COPY_SOURCE_DIR}/testfiles/h5copy_plugin_fail_ERR.out.h5.txt
@@ -44,6 +45,12 @@
endforeach ()
add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list})
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -51,25 +58,23 @@
##############################################################################
#
- # Perform h5copy according to passing parmeters
+ # Perform h5copy according to passing parameters
#
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
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
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}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -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 "")
+ if (last_test)
set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -77,13 +82,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_F-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -94,18 +99,16 @@
# 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
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -113,13 +116,13 @@
endif ()
# resultcode=2 will cause the test to skip the diff test
- if (NOT "${resultcode}" STREQUAL "2")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -140,18 +143,16 @@
# 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
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY-${testname}-prefill
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test})
endif ()
else ()
@@ -160,17 +161,17 @@
add_test (
NAME H5COPY-${testname}
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -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")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname})
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -181,18 +182,16 @@
# 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
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
endif ()
add_test (
NAME H5COPY_SAME-${testname}-prefill
- COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam}
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test})
endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
@@ -201,17 +200,17 @@
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}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -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")
+ if (NOT ${resultcode} EQUAL 2)
add_test (
NAME H5COPY_SAME-${testname}-DIFF
- COMMAND $<TARGET_FILE:h5diff> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./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")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true")
endif ()
endif ()
@@ -224,32 +223,30 @@
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")
+ add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
# 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
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5
)
add_test (
NAME H5COPY-CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5copy>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>"
-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_ERRREF=./testfiles/${testname}.err"
-D "TEST_MASK=true"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
@@ -262,18 +259,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out.h5
- testfiles/${infile}.out
- testfiles/${infile}.out.err
- testfiles/${testname}.out.h5.out
- testfiles/${testname}.out.h5.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5
)
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5COPY_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -283,12 +275,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5COPY_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -298,6 +292,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
@@ -305,6 +300,7 @@
add_test (
NAME H5COPY_UD-${testname}-DIFF
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -314,6 +310,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname})
@@ -325,18 +322,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY_UD_ERR-${testname}-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}_ERR.out.h5
- testfiles/${infile}_ERR.out
- testfiles/${infile}_ERR.out.err
- testfiles/${testname}_ERR.out.h5.out
- testfiles/${testname}_ERR.out.h5.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5
)
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5COPY_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -347,12 +339,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5COPY_UD_ERR-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>"
-D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -363,6 +357,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
@@ -370,6 +365,7 @@
add_test (
NAME H5COPY_UD_ERR-${testname}-DIFF
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
@@ -379,6 +375,7 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname})
@@ -403,8 +400,7 @@
# Remove any output file left over from previous test run
add_test (
NAME H5COPY-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
simple.out.h5
chunk.out.h5
compact.out.h5
@@ -437,11 +433,9 @@
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 "")
+ if (last_test)
set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5COPY-clearall-objects")
diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c
index 9f5d916..a3acdae 100644
--- a/tools/test/h5copy/h5copygentest.c
+++ b/tools/test/h5copy/h5copygentest.c
@@ -261,7 +261,7 @@ static void gent_named_vl(hid_t loc_id)
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
/* close */
- H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf);
+ H5Treclaim(tid,sid,H5P_DEFAULT,buf);
H5Sclose(sid);
H5Dclose(did);
H5Tclose(tid);
@@ -314,7 +314,7 @@ static void gent_nested_vl(hid_t loc_id)
H5Dwrite(did, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
/* close */
- H5Dvlen_reclaim(tid2,sid,H5P_DEFAULT,buf);
+ H5Treclaim(tid2,sid,H5P_DEFAULT,buf);
H5Sclose(sid);
H5Dclose(did);
H5Tclose(tid1);
@@ -326,7 +326,7 @@ static void gent_nested_vl(hid_t loc_id)
* Function: gent_att_compound_vlstr
*
* Purpose: Generate a dataset and a group.
- * Both has an attribute with a compound datatype consisting
+ * Both has an attribute with a compound datatype consisting
* of a variable length string
*
*-------------------------------------------------------------------------
@@ -337,15 +337,15 @@ static void gent_att_compound_vlstr(hid_t loc_id)
int i;
const char *v;
} s1;
- hsize_t dim[1] = {1}; /* Dimension size */
- hid_t sid = -1; /* Dataspace ID */
- hid_t tid = -1; /* Datatype ID */
- hid_t aid = -1; /* Attribute ID */
- hid_t did = -1; /* Dataset ID */
- hid_t gid = -1; /* Group ID */
- hid_t vl_str_tid = -1; /* Variable length datatype ID */
- hid_t cmpd_tid = -1; /* Compound datatype ID */
- hid_t null_sid = -1; /* Null dataspace ID */
+ hsize_t dim[1] = {1}; /* Dimension size */
+ hid_t sid = -1; /* Dataspace ID */
+ hid_t tid = -1; /* Datatype ID */
+ hid_t aid = -1; /* Attribute ID */
+ hid_t did = -1; /* Dataset ID */
+ hid_t gid = -1; /* Group ID */
+ hid_t vl_str_tid = -1; /* Variable length datatype ID */
+ hid_t cmpd_tid = -1; /* Compound datatype ID */
+ hid_t null_sid = -1; /* Null dataspace ID */
s1 buf; /* Buffer */
buf.i = 9;
@@ -509,7 +509,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -517,7 +517,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -525,7 +525,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -538,7 +538,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -547,14 +547,14 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -562,7 +562,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims2, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -570,7 +570,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -578,7 +578,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -618,7 +618,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid = H5Screate_simple (2, dims2, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -627,7 +627,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid2 = H5Dcreate2 (loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -636,7 +636,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -645,7 +645,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_elements (sid, H5S_SELECT_SET, 4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -654,7 +654,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -663,7 +663,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_hyperslab (sid, H5S_SELECT_SET, start, stride, count, block);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -672,7 +672,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -683,7 +683,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -692,7 +692,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid1 = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid1 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -701,7 +701,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -725,30 +725,30 @@ out:
*------------------------------------------------------------------------*/
static void Test_Obj_Copy(void)
{
- hid_t fid = -1; /* File id */
- hid_t fapl_new = (-1); /* File access property id */
- unsigned new_format; /* New format or old format */
+ hid_t fid = -1; /* File id */
+ hid_t fapl_new = (-1); /* File access property id */
+ unsigned new_format; /* New format or old format */
if((fapl_new = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "Error: H5Pcreate failed.\n");
+ HDfprintf(stderr, "Error: H5Pcreate failed.\n");
goto out;
}
if(H5Pset_libver_bounds(fapl_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
- fprintf(stderr, "Error: H5Pset_libver_bounds failed.\n");
+ HDfprintf(stderr, "Error: H5Pset_libver_bounds failed.\n");
goto out;
}
/* Test with old & new format groups */
for(new_format = FALSE; new_format <= TRUE; new_format++) {
-
+
/* Set the FAPL for the type of format */
/* Create source file */
if(new_format)
- fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
- else
- fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new);
+ else
+ fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if(fid < 0) {
- fprintf(stderr, "Error: H5Fcreate failed.\n");
+ HDfprintf(stderr, "Error: H5Fcreate failed.\n");
goto out;
}
@@ -756,7 +756,7 @@ static void Test_Obj_Copy(void)
gent_empty_group(fid);
gent_nested_datasets(fid);
gent_nested_group(fid);
- gent_att_compound_vlstr(fid);
+ gent_att_compound_vlstr(fid);
H5Fclose(fid);
fid = (-1);
@@ -786,19 +786,19 @@ static void Test_Ref_Copy(void)
fid = H5Fcreate (HDF_FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2);
goto out;
}
/* add object reference */
status = gen_obj_ref(fid);
if (status < 0)
- fprintf(stderr, "Failed to generate object reference.\n");
+ HDfprintf(stderr, "Failed to generate object reference.\n");
/* add region reference */
status = gen_region_ref(fid);
if (status < 0)
- fprintf(stderr, "Failed to generate region reference.\n");
+ HDfprintf(stderr, "Failed to generate region reference.\n");
out:
/*-----------------------------------------------------------------------
@@ -829,7 +829,7 @@ static herr_t gen_extlink_trg(hid_t loc_id)
gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -845,7 +845,7 @@ static herr_t gen_extlink_trg(hid_t loc_id)
status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -878,7 +878,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -890,7 +890,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -899,7 +899,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -908,7 +908,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -917,7 +917,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -926,7 +926,7 @@ static herr_t gen_extlink_src(hid_t loc_id)
status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -953,26 +953,26 @@ static void Test_Extlink_Copy(void)
fid1 = H5Fcreate (HDF_EXT_SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE);
goto out;
}
fid2 = H5Fcreate (HDF_EXT_TRG_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0)
{
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE);
goto out;
}
/* add links to source external link file */
status = gen_extlink_src(fid1);
if (status < 0)
- fprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE);
+ HDfprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE);
/* add objs to target external link file */
status = gen_extlink_trg(fid2);
if (status < 0)
- fprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE);
+ HDfprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE);
out:
/*-----------------------------------------------------------------------
diff --git a/tools/test/h5copy/testfiles/h5copy_misc1.err b/tools/test/h5copy/testfiles/h5copy_misc1.err
new file mode 100644
index 0000000..2c2c867
--- /dev/null
+++ b/tools/test/h5copy/testfiles/h5copy_misc1.err
@@ -0,0 +1 @@
+h5copy error: group </g1> doesn't exist. Use -p to create parent groups.
diff --git a/tools/test/h5copy/testfiles/h5copy_misc1.out b/tools/test/h5copy/testfiles/h5copy_misc1.out
index 1624f2b..1c7181b 100644
--- a/tools/test/h5copy/testfiles/h5copy_misc1.out
+++ b/tools/test/h5copy/testfiles/h5copy_misc1.out
@@ -1,3 +1,2 @@
Copying file <./testfiles/h5copytst.h5> and object </simple> to file <./testfiles/h5copy_misc1.out.h5> and object </g1/g2/simple>
Error in copy...Exiting
-h5copy error: group </g1> doesn't exist. Use -p to create parent groups.
diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in
index 203bfef..2440ca4 100644
--- a/tools/test/h5copy/testh5copy.sh.in
+++ b/tools/test/h5copy/testh5copy.sh.in
@@ -60,6 +60,7 @@ $SRC_H5COPY_TESTFILES/h5copy_extlinks_trg.h5
# List of expect files that will be copied over to local test dir
LIST_OTHER_TEST_FILES="
$SRC_H5COPY_TESTFILES/h5copy_misc1.out
+$SRC_H5COPY_TESTFILES/h5copy_misc1.err
"
H5COPY=../../src/h5copy/h5copy # The tool name
@@ -396,6 +397,7 @@ CMP_OUTPUT()
TOOLTEST_FAIL()
{
expectout="$TESTDIR/$1"
+ expecterr="$TESTDIR/`basename $1 .out`.err"
actualout="$TESTDIR/$1.actualout"
actualerr="$TESTDIR/$1.actualerr"
actualout_sav=${actualout}-sav
@@ -426,10 +428,7 @@ TOOLTEST_FAIL()
echo " PASSED"
# Verifying output text from h5copy
if [ "$expectout" != "SKIP" ]; then
- # combine stderr to stdout to compare the output at once.
- # We may seperate stdout and stderr later.
- cat $actualerr >> $actualout
- CMP_OUTPUT $expectout $actualout
+ CMP_OUTPUT $expecterr $actualerr
fi
else
echo "*FAILED*"
@@ -505,22 +504,21 @@ fi
TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename
echo "Test copying empty, 'full' & 'nested' groups"
-if test $USE_FILTER_DEFLATE = "yes" ; then
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty
-fi
+if test $USE_FILTER_DEFLATE = "yes" ; then
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested
+fi
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr
-if test $USE_FILTER_DEFLATE = "yes" ; then
echo "Test copying dataset within group in source file to group in destination"
TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group
+if test $USE_FILTER_DEFLATE = "yes" ; then
echo "Test copying & renaming group"
TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename
-fi
-
echo "Test copying 'full' group hierarchy into group in destination file"
TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets
+fi
echo "Test copying objects into group hier. that doesn't exist yet in destination file"
TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple
diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt
index c0aac36..cb4397f 100644
--- a/tools/test/h5diff/CMakeLists.txt
+++ b/tools/test/h5diff/CMakeLists.txt
@@ -4,29 +4,29 @@ project (HDF5_TOOLS_TEST_H5DIFF C)
# --------------------------------------------------------------------
# Add the h5diff and test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5diffgentest ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/h5diffgentest.c)
- target_include_directories(h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5diffgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5diffgentest STATIC)
target_link_libraries (h5diffgentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
+ #add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diffgentest>)
endif ()
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
if (BUILD_SHARED_LIBS)
- set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
- set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
- set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5DIFF_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
+ set (H5DIFF_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DIFF_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5DIFF_TOOL_PLUGIN_LIB_TARGET ${H5DIFF_TOOL_PLUGIN_LIB_CORENAME})
- add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
- target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
- target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
- H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_diff.c)
+ target_include_directories (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5DIFF_TOOL_PLUGIN_LIB_TARGET} ${H5DIFF_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
# make plugins dir
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
@@ -34,12 +34,12 @@ if (BUILD_SHARED_LIBS)
# Copy plugin library to a plugins folder
#-----------------------------------------------------------------------------
add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
+ TARGET ${H5DIFF_TOOL_PLUGIN_LIB_TARGET}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
+ "$<TARGET_FILE:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DIFF_TOOL_PLUGIN_LIB_TARGET}>"
)
endif ()
diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake
index e06f069..57bcd12 100644
--- a/tools/test/h5diff/CMakeTests.cmake
+++ b/tools/test/h5diff/CMakeTests.cmake
@@ -168,21 +168,12 @@
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454_ERR.err
+ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/dangling_link.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455_ERR.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457_ERR.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458_ERR.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459_ERR.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt
@@ -238,7 +229,6 @@
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_63.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt
- ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601_ERR.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt
@@ -293,6 +283,7 @@
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8625.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_8639.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ud.txt
+ ${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.err
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_udfail.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v1.txt
${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/h5diff_v2.txt
@@ -333,7 +324,14 @@
#
# Overwrite system dependent files (Windows) and not VS2015
#
+ set (COPY_WINDOWS_FILES false)
+ if (MINGW)
+ set (COPY_WINDOWS_FILES true)
+ endif ()
if (WIN32 AND MSVC_VERSION LESS 1900)
+ set (COPY_WINDOWS_FILES true)
+ endif ()
+ if (COPY_WINDOWS_FILES)
foreach (h5_tstfiles ${LIST_WIN_TEST_FILES})
get_filename_component(fname "${h5_tstfiles}" NAME)
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files")
@@ -352,6 +350,12 @@
endif ()
add_custom_target(h5diff_files ALL COMMENT "Copying files needed by h5diff tests" DEPENDS ${h5diff_files_list})
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
##############################################################################
##############################################################################
### T H E T E S T S M A C R O S ###
@@ -361,30 +365,20 @@
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})
+ add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN})
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -393,79 +387,29 @@
-D "TEST_APPEND=EXIT CODE:"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects)
+ if (last_test)
+ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
if (H5_HAVE_PARALLEL)
ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN})
endif ()
endmacro ()
- macro (ADD_H5_ERR_TEST resultfile resultcode)
- # If using memchecker add tests without using scripts
- if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DIFF_ERR-${resultfile} COMMAND $<TARGET_FILE:h5diff> --enable-error-stack ${ARGN})
- set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${resultcode}" STREQUAL "0")
- set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES WILL_FAIL "true")
- endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
- else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF_ERR-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}_ERR.out
- testfiles/${resultfile}_ERR.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DIFF_ERR-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- add_test (
- NAME H5DIFF_ERR-${resultfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
- -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}_ERR.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}_ERR.txt"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_APPEND=EXIT CODE:"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5DIFF_ERR-${resultfile} PROPERTIES DEPENDS H5DIFF_ERR-${resultfile}-clear-objects)
- endif ()
- set (last_test "H5DIFF_ERR-${resultfile}")
- endmacro ()
-
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 ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN})
- set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
- if (NOT "${resultcode}" STREQUAL "0")
- set_tests_properties (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
+ add_test (NAME MPI_TEST_H5DIFF-${resultfile} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ph5diff> ${MPIEXEC_POSTFLAGS} ${ARGN})
+ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles")
+ if (${resultcode})
+ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ if (last_test)
+ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME PH5DIFF-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- PAR/testfiles/${resultfile}.out
- PAR/testfiles/${resultfile}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (PH5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
- NAME PH5DIFF-${resultfile}
+ NAME MPI_TEST_H5DIFF-${resultfile}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${MPIEXEC_EXECUTABLE};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_PREFLAGS};$<TARGET_FILE:ph5diff>;${MPIEXEC_POSTFLAGS}"
-D "TEST_ARGS:STRING=${ARGN}"
@@ -479,25 +423,20 @@
-D "TEST_SORT_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (PH5DIFF-${resultfile} PROPERTIES DEPENDS PH5DIFF-${resultfile}-clear-objects)
- set (last_test "PH5DIFF-${resultfile}")
+ if (last_test)
+ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test})
+ endif ()
+ set (last_test "MPI_TEST_H5DIFF-${resultfile}")
endif ()
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
- if ("${resultcode}" STREQUAL "2")
+ if (${resultcode} EQUAL 2)
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
@@ -507,12 +446,14 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
else ()
add_test (
NAME H5DIFF_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
@@ -522,57 +463,13 @@
-D "TEST_APPEND=EXIT CODE:"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects)
- endif ()
- endmacro ()
-
- macro (ADD_H5_UD_ERR_TEST testname resultcode resultfile)
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DIFF_UD_ERR-${testname}-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}_ERR.out
- testfiles/${resultfile}_ERR.out.err
- )
- if ("${resultcode}" STREQUAL "2")
- add_test (
- NAME H5DIFF_UD_ERR-${testname}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
- -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}_ERR.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}_ERR.txt"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_APPEND=EXIT CODE:"
- -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
- -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- else ()
- add_test (
- NAME H5DIFF_UD_ERR-${testname}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
- -D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${resultfile}_ERR.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}_ERR.txt"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_APPEND=EXIT CODE:"
- -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
- -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
+ if (last_test)
+ set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
- set_tests_properties (H5DIFF_UD_ERR-${testname} PROPERTIES DEPENDS H5DIFF_UD_ERR-${testname}-clearall-objects)
endif ()
endmacro ()
@@ -798,26 +695,16 @@
h5diff_453.out.err
h5diff_454.out
h5diff_454.out.err
- h5diff_454_ERR.out
- h5diff_454_ERR.out.err
h5diff_455.out
h5diff_455.out.err
- h5diff_455_ERR.out
- h5diff_455_ERR.out.err
h5diff_456.out
h5diff_456.out.err
h5diff_457.out
h5diff_457.out.err
- h5diff_457_ERR.out
- h5diff_457_ERR.out.err
h5diff_458.out
h5diff_458.out.err
- h5diff_458_ERR.out
- h5diff_458_ERR.out.err
h5diff_459.out
h5diff_459.out.err
- h5diff_459_ERR.out
- h5diff_459_ERR.out.err
h5diff_465.out
h5diff_465.out.err
h5diff_466.out
@@ -922,8 +809,6 @@
h5diff_600.out.err
h5diff_601.out
h5diff_601.out.err
- h5diff_601_ERR.out
- h5diff_601_ERR.out.err
h5diff_603.out
h5diff_603.out.err
h5diff_604.out
@@ -1034,7 +919,7 @@
h5diff_vlstr.out.err
)
set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5DIFF-clearall-objects")
@@ -1181,7 +1066,6 @@ 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)
-ADD_H5_ERR_TEST (h5diff_601 2 ${FILE1} ${FILE1} nono_obj)
# ##############################################################################
# # -d
@@ -1481,26 +1365,21 @@ ADD_H5_TEST (h5diff_453 2 --follow-symlinks -v --no-dangling-links ${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)
-ADD_H5_ERR_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)
-ADD_H5_ERR_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)
-ADD_H5_ERR_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)
-ADD_H5_ERR_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)
-ADD_H5_ERR_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)
diff --git a/tools/test/h5diff/h5diff_plugin.sh.in b/tools/test/h5diff/h5diff_plugin.sh.in
index 212f5d6..341cba5 100644
--- a/tools/test/h5diff/h5diff_plugin.sh.in
+++ b/tools/test/h5diff/h5diff_plugin.sh.in
@@ -62,6 +62,7 @@ LIST_HDF5_TEST_FILES="
$SRC_H5DIFF_TESTFILES/tudfilter.h5
$SRC_H5DIFF_TESTFILES/tudfilter2.h5
$SRC_H5DIFF_TESTFILES/h5diff_ud.txt
+$SRC_H5DIFF_TESTFILES/h5diff_udfail.err
$SRC_H5DIFF_TESTFILES/h5diff_udfail.txt
"
@@ -204,7 +205,7 @@ VERIFY() {
TOOLTEST() {
expect="$TESTDIR/$1"
actual="$TESTDIR/`basename $1 .txt`.out"
- actual_err="$TESTDIR/`basename $1 .txt`.err"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -287,6 +288,90 @@ TOOLTEST() {
rm -f $actual_sorted $expect_sorted
fi
}
+# Same as TOOLSET except only err file checked
+TOOLTEST_ERR() {
+ expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .txt`.err"
+ actual="$TESTDIR/`basename $1 .txt`.out"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+ shift
+ if test -n "$pmode"; then
+ RUNCMD=$RUNPARALLEL
+ else
+ RUNCMD=$RUNSERIAL
+ fi
+
+ # Run test.
+ TESTING $H5DIFF $@
+ (
+ #echo "#############################"
+ #echo "Expected output for '$H5DIFF $@'"
+ #echo "#############################"
+ cd $TESTDIR
+ eval $ENVCMD $RUNCMD $H5DIFF_BIN "$@"
+ ) >$actual 2>$actual_err
+ EXIT_CODE=$?
+ # save actual and actual_err in case they are needed later.
+ cp $actual $actual_sav
+ STDOUT_FILTER $actual
+ cp $actual_err $actual_err_sav
+ STDERR_FILTER $actual_err
+ # don't add exit code check in pmode, as it causes failure. (exit code
+ # is from mpirun not tool)
+ # if any problem occurs relate to an exit code, it will be caught in
+ # serial mode, so the test is fullfilled.
+ if test $h5haveexitcode = 'yes' -a -z "$pmode"; then
+ echo "EXIT CODE: $EXIT_CODE" >> $actual
+ fi
+
+ if [ ! -f $expect ]; then
+ # Create the expect file if it doesn't yet exist.
+ echo " CREATED"
+ cp $actual $expect
+ echo " Expected result (*.ddl) missing"
+ nerrors="`expr $nerrors + 1`"
+ elif $CMP $expect_err $actual_err; then
+ echo " PASSED"
+ elif test $h5haveexitcode = 'yes' -a -z "$pmode"; then
+ echo "*FAILED*"
+ echo " Expected result ($expect_err) differs from actual result ($actual_err)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_err |sed 's/^/ /'
+ else
+ # parallel mode output are often of different ordering from serial
+ # output. If the sorted expect_err and actual_err files compare the same,
+ # it is safe to assume the actual output match the expected file.
+ expect_sorted=expect_sorted
+ actual_sorted=actual_sorted
+ sort $expect_err -o $expect_sorted
+ sort $actual_err -o $actual_sorted
+ mv $expect_sorted.noexit $expect_sorted
+ if $CMP $expect_sorted $actual_sorted; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ if test yes = "$verbose"; then
+ echo "====Expected result ($expect_sorted) differs from actual result ($actual_sorted)"
+ $DIFF $expect_sorted $actual_sorted |sed 's/^/ /'
+ echo "====The actual output ($actual_sav)"
+ sed 's/^/ /' < $actual_sav
+ echo "====The actual stderr ($actual_err_sav)"
+ sed 's/^/ /' < $actual_err_sav
+ echo "====End of actual stderr ($actual_err_sav)"
+ echo ""
+ fi
+ fi
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err $actual_sav $actual_err_sav
+ rm -f $actual_sorted $expect_sorted
+ fi
+}
##############################################################################
### T H E T E S T S
diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c
index 4f92cae..c711013 100644
--- a/tools/test/h5diff/h5diffgentest.c
+++ b/tools/test/h5diff/h5diffgentest.c
@@ -310,11 +310,11 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/* create the empty file */
if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "empty file (%s) creation failed.\n", fname3);
+ HDfprintf(stderr, "empty file (%s) creation failed.\n", fname3);
goto out;
}
if (H5Fclose(fid1) < 0) {
- fprintf(stderr, "empty file (%s) close failed.\n", fname3);
+ HDfprintf(stderr, "empty file (%s) close failed.\n", fname3);
goto out;
}
@@ -1065,7 +1065,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
* Create file1
*-----------------------------------------------------------------------*/
if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1075,28 +1075,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
*/
f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_gid4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1107,13 +1107,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f1_sid = H5Screate_simple(1, dset_dims, NULL);
f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f1_did == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1124,7 +1124,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f1_tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1133,7 +1133,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
* Create file2
*-----------------------------------------------------------------------*/
if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1143,28 +1143,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
*/
f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_gid4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1175,13 +1175,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f2_sid = H5Screate_simple(1, dset_dims, NULL);
f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (f2_did == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1192,7 +1192,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2)
f2_tid = H5Tcopy(H5T_NATIVE_INT);
status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1423,7 +1423,7 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1433,7 +1433,7 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1441,7 +1441,7 @@ static int test_link_name(const char *fname1)
H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1451,14 +1451,14 @@ static int test_link_name(const char *fname1)
*------------------------------------------------------------------------*/
status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1498,7 +1498,7 @@ static int test_soft_links(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1508,7 +1508,7 @@ static int test_soft_links(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1519,21 +1519,21 @@ static int test_soft_links(const char *fname1)
/* file1 */
status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -1544,42 +1544,42 @@ static int test_soft_links(const char *fname1)
/* file 1 */
status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1619,7 +1619,7 @@ static int test_linked_softlinks(const char *fname1)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1629,21 +1629,21 @@ static int test_linked_softlinks(const char *fname1)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1654,20 +1654,20 @@ static int test_linked_softlinks(const char *fname1)
/* file1 */
status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -1679,84 +1679,84 @@ static int test_linked_softlinks(const char *fname1)
* file 1 */
status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1801,7 +1801,7 @@ static int test_external_links(const char *fname1, const char *fname2)
/* source file */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1809,7 +1809,7 @@ static int test_external_links(const char *fname1, const char *fname2)
/* target file */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1821,14 +1821,14 @@ static int test_external_links(const char *fname1, const char *fname2)
* target file */
gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1839,21 +1839,21 @@ static int test_external_links(const char *fname1, const char *fname2)
* target file */
status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -1865,42 +1865,42 @@ static int test_external_links(const char *fname1, const char *fname2)
/* source file */
status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1945,7 +1945,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* source file */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -1953,7 +1953,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* target file */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1964,7 +1964,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
/* target file */
gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -1976,14 +1976,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* target file */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -1995,14 +1995,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* target file */
status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2014,21 +2014,21 @@ static int test_ext2soft_links(const char *fname1, const char *fname2)
* source file */
status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2158,14 +2158,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2176,14 +2176,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2191,14 +2191,14 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2209,28 +2209,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file 1 */
status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2238,28 +2238,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file 2 */
status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2270,28 +2270,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2299,28 +2299,28 @@ static int test_dangle_links(const char *fname1, const char *fname2)
/* file2 */
status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2361,14 +2361,14 @@ static int test_group_recurse(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2379,28 +2379,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid10_f1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2408,28 +2408,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid11_f2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2440,21 +2440,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2462,21 +2462,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2487,54 +2487,54 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -2542,54 +2542,54 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -2600,28 +2600,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file 1 */
status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2629,28 +2629,28 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file 2 */
status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2661,21 +2661,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -2683,21 +2683,21 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file2 */
status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2709,14 +2709,14 @@ static int test_group_recurse(const char *fname1, const char *fname2)
/* file1 */
status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1);
status = FAIL;
goto out;
}
/* file2 */
status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -2790,28 +2790,28 @@ static int test_group_recurse2(void)
*------------------------------------------------------------------------*/
grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -2886,7 +2886,7 @@ static int test_group_recurse2(void)
/* link to dset1 */
status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -2910,7 +2910,7 @@ static int test_group_recurse2(void)
*/
grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp4 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3);
status = FAIL;
goto out;
}
@@ -2944,14 +2944,14 @@ static int test_group_recurse2(void)
*/
grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
@@ -2975,7 +2975,7 @@ static int test_group_recurse2(void)
*/
status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2);
status = FAIL;
goto out;
}
@@ -2996,7 +2996,7 @@ static int test_group_recurse2(void)
*/
grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (grp1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT);
status = FAIL;
goto out;
}
@@ -3020,7 +3020,7 @@ static int test_group_recurse2(void)
/* link to dset1 */
status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1);
status = FAIL;
goto out;
}
@@ -3030,7 +3030,7 @@ static int test_group_recurse2(void)
*/
status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1);
+ HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1);
status = FAIL;
goto out;
}
@@ -3083,14 +3083,14 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3101,7 +3101,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3110,7 +3110,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3121,21 +3121,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3143,21 +3143,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3204,14 +3204,14 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3222,7 +3222,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3230,7 +3230,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file2 */
gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3239,7 +3239,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid3 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3250,21 +3250,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3272,21 +3272,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3332,14 +3332,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
*------------------------------------------------------------------------*/
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
status = FAIL;
goto out;
}
@@ -3350,7 +3350,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file1 */
gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3361,14 +3361,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file1 */
status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname1);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1);
status = FAIL;
goto out;
}
@@ -3376,7 +3376,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2)
/* file2 */
status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname2);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2);
status = FAIL;
goto out;
}
@@ -3698,7 +3698,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
if (is_file_new == 1) {
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3706,7 +3706,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
else {
fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3717,7 +3717,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3727,7 +3727,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL);
if (sid_vlen_str < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3735,7 +3735,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_vlen_str = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_vlen_str, H5T_VARIABLE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3745,7 +3745,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL);
if (sid_fixlen_str < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3753,7 +3753,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_fixlen_str = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3763,7 +3763,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL);
if (sid_vlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3771,7 +3771,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3779,7 +3779,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
/* Create the array data type for the string array */
tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array);
if (tid_vlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3789,7 +3789,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL);
if (sid_fixlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3797,14 +3797,14 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1);
status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1);
status = FAIL;
goto out;
}
/* Create the array data type for the string array */
tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array);
if (tid_fixlen_str_array < 0) {
- fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3814,7 +3814,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
*------------------------------------------------------------------------*/
sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL);
if (sid_comp < 0) {
- fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3928,7 +3928,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3938,7 +3938,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3948,7 +3948,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3958,7 +3958,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3968,7 +3968,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3978,7 +3978,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3988,7 +3988,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -3998,7 +3998,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -4014,7 +4014,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int
status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1);
status = FAIL;
goto out;
}
@@ -4136,14 +4136,14 @@ static int test_enums(const char *fname)
enum_val = 0;
status = H5Tenum_insert(tid, "YIN", &enum_val);
if (status < 0) {
- fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
+ HDfprintf(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);
+ HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4154,13 +4154,13 @@ static int test_enums(const char *fname)
status = write_dset(fid, 1, &dims, "dset1", tid, data1);
if (status < 0) {
- fprintf(stderr, "Error: %s> write_dset failed.\n", fname);
+ HDfprintf(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);
+ HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4403,7 +4403,7 @@ static void test_comps_vlen(const char * fname, const char *dset, const char *at
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/* ----------------
@@ -4537,7 +4537,7 @@ static void test_comps_array_vlen(const char * fname, const char *dset, const ch
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/*-------------------
@@ -4680,7 +4680,7 @@ static void test_comps_vlen_arry(const char * fname, const char *dset, const cha
assert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid_cmpd1, sid_dset, H5P_DEFAULT, wdata);
assert(ret >= 0);
/* ----------------
@@ -4794,7 +4794,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
*------------------------------------------------------------------------*/
fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4804,14 +4804,14 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
*------------------------------------------------------------------------*/
gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid1 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
status = FAIL;
goto out;
}
gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid2 < 0) {
- fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
+ HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname);
status = FAIL;
goto out;
}
@@ -4824,13 +4824,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* dset1 */
if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
status = FAIL;
goto out;
}
if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
status = FAIL;
goto out;
}
@@ -4839,7 +4839,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* dset2 */
status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname);
goto out;
}
@@ -4849,13 +4849,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
/* ---------
* dset1 */
if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
- fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1");
status = FAIL;
goto out;
}
if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) {
- fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
+ HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1");
status = FAIL;
goto out;
}
@@ -4875,7 +4875,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs)
* dset2 */
status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3);
if (status == FAIL) {
- fprintf(stderr, "Error: %s> write_dset failed\n", fname);
+ HDfprintf(stderr, "Error: %s> write_dset failed\n", fname);
goto out;
}
@@ -5085,14 +5085,14 @@ static void test_objs_strings(const char *fname1, const char *fname2)
/* file1 */
fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid1 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1);
goto out;
}
/* file2 */
fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fid2 < 0) {
- fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
+ HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2);
goto out;
}
@@ -5446,7 +5446,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -5712,7 +5712,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6108,7 +6108,7 @@ void write_attr_strings(hid_t loc_id, const char* dset_name, hid_t fid, int make
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6434,7 +6434,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -6702,7 +6702,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -7100,7 +7100,7 @@ void write_attr_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -7395,7 +7395,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -7580,7 +7580,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -7759,7 +7759,7 @@ void write_dset_in(hid_t loc_id, const char* dset_name, hid_t fid, int make_diff
did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
assert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
assert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.err b/tools/test/h5diff/testfiles/dangling_link.err
index 82802a1..82802a1 100644
--- a/tools/test/h5diff/testfiles/h5diff_459_ERR.err
+++ b/tools/test/h5diff/testfiles/dangling_link.err
diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.err b/tools/test/h5diff/testfiles/h5diff_454_ERR.err
deleted file mode 100644
index 82802a1..0000000
--- a/tools/test/h5diff/testfiles/h5diff_454_ERR.err
+++ /dev/null
@@ -1,4 +0,0 @@
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt b/tools/test/h5diff/testfiles/h5diff_454_ERR.txt
deleted file mode 100644
index 4501071..0000000
--- a/tools/test/h5diff/testfiles/h5diff_454_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Warning: </softlink_noexist> is a dangling link.
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.err b/tools/test/h5diff/testfiles/h5diff_455_ERR.err
deleted file mode 100644
index 82802a1..0000000
--- a/tools/test/h5diff/testfiles/h5diff_455_ERR.err
+++ /dev/null
@@ -1,4 +0,0 @@
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt b/tools/test/h5diff/testfiles/h5diff_455_ERR.txt
deleted file mode 100644
index 4501071..0000000
--- a/tools/test/h5diff/testfiles/h5diff_455_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Warning: </softlink_noexist> is a dangling link.
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.err b/tools/test/h5diff/testfiles/h5diff_457_ERR.err
deleted file mode 100644
index 82802a1..0000000
--- a/tools/test/h5diff/testfiles/h5diff_457_ERR.err
+++ /dev/null
@@ -1,4 +0,0 @@
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt b/tools/test/h5diff/testfiles/h5diff_457_ERR.txt
deleted file mode 100644
index 9d73750..0000000
--- a/tools/test/h5diff/testfiles/h5diff_457_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Warning: </ext_link_noexist1> is a dangling link.
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.err b/tools/test/h5diff/testfiles/h5diff_458_ERR.err
deleted file mode 100644
index 82802a1..0000000
--- a/tools/test/h5diff/testfiles/h5diff_458_ERR.err
+++ /dev/null
@@ -1,4 +0,0 @@
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
diff --git a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt b/tools/test/h5diff/testfiles/h5diff_458_ERR.txt
deleted file mode 100644
index b084914..0000000
--- a/tools/test/h5diff/testfiles/h5diff_458_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Warning: </ext_link_noexist2> is a dangling link.
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt b/tools/test/h5diff/testfiles/h5diff_459_ERR.txt
deleted file mode 100644
index 9d73750..0000000
--- a/tools/test/h5diff/testfiles/h5diff_459_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Warning: </ext_link_noexist1> is a dangling link.
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): treat dangling link as error
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_600.txt b/tools/test/h5diff/testfiles/h5diff_600.txt
index f3b346a..13d627c 100644
--- a/tools/test/h5diff/testfiles/h5diff_600.txt
+++ b/tools/test/h5diff/testfiles/h5diff_600.txt
@@ -142,5 +142,4 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[ obj2]]
Use h5diff file1 file1 /g1/dset1 /g1/dset2 to compare
'/g1/dset1' and '/g1/dset2' in the same file
-h5diff error: missing file names
EXIT CODE: 1
diff --git a/tools/test/h5diff/testfiles/h5diff_601_ERR.txt b/tools/test/h5diff/testfiles/h5diff_601_ERR.txt
deleted file mode 100644
index b58124a..0000000
--- a/tools/test/h5diff/testfiles/h5diff_601_ERR.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Object </nono_obj> could not be found in <h5diff_basic1.h5>
-H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
- #000: (file name) line (number) in h5diff(): Error: Object could not be found
- major: Failure in tools library
- minor: error in function
-EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_udfail.err b/tools/test/h5diff/testfiles/h5diff_udfail.err
new file mode 100644
index 0000000..d51de38
--- /dev/null
+++ b/tools/test/h5diff/testfiles/h5diff_udfail.err
@@ -0,0 +1,12 @@
+
+file1 file2
+---------------------------------------
+ x x /
+ x x /dynlibud
+
+group : </> and </>
+0 differences found
+dataset: </dynlibud> and </dynlibud>
+0 differences found
+Warning: dataset </dynlibud> cannot be read, user defined filter is not available
+EXIT CODE: 2
diff --git a/tools/test/h5diff/testfiles/h5diff_udfail.txt b/tools/test/h5diff/testfiles/h5diff_udfail.txt
index d51de38..e6000fc 100644
--- a/tools/test/h5diff/testfiles/h5diff_udfail.txt
+++ b/tools/test/h5diff/testfiles/h5diff_udfail.txt
@@ -8,5 +8,4 @@ group : </> and </>
0 differences found
dataset: </dynlibud> and </dynlibud>
0 differences found
-Warning: dataset </dynlibud> cannot be read, user defined filter is not available
EXIT CODE: 2
diff --git a/tools/test/h5diff/testh5diff.sh.in b/tools/test/h5diff/testh5diff.sh.in
index c464f94..557d2ff 100644
--- a/tools/test/h5diff/testh5diff.sh.in
+++ b/tools/test/h5diff/testh5diff.sh.in
@@ -226,6 +226,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_451.txt
$SRC_H5DIFF_TESTFILES/h5diff_452.txt
$SRC_H5DIFF_TESTFILES/h5diff_453.txt
$SRC_H5DIFF_TESTFILES/h5diff_454.txt
+$SRC_H5DIFF_TESTFILES/dangling_link.err
$SRC_H5DIFF_TESTFILES/h5diff_455.txt
$SRC_H5DIFF_TESTFILES/h5diff_456.txt
$SRC_H5DIFF_TESTFILES/h5diff_457.txt
@@ -286,6 +287,7 @@ $SRC_H5DIFF_TESTFILES/h5diff_62.txt
$SRC_H5DIFF_TESTFILES/h5diff_63.txt
$SRC_H5DIFF_TESTFILES/h5diff_600.txt
$SRC_H5DIFF_TESTFILES/h5diff_601.txt
+$SRC_H5DIFF_TESTFILES/h5diff_601_ERR.err
$SRC_H5DIFF_TESTFILES/h5diff_603.txt
$SRC_H5DIFF_TESTFILES/h5diff_604.txt
$SRC_H5DIFF_TESTFILES/h5diff_605.txt
@@ -462,8 +464,9 @@ TESTING() {
#
TOOLTEST() {
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .txt`.err"
actual="$TESTDIR/`basename $1 .txt`.out"
- actual_err="$TESTDIR/`basename $1 .txt`.err"
+ actual_err="$TESTDIR/`basename $1 .txt`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -488,7 +491,6 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
# don't add exit code check in pmode, as it causes failure. (exit code
# is from mpirun not tool)
# if any problem occurs relate to an exit code, it will be caught in
diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt
index 4c409e8..38f4118 100644
--- a/tools/test/h5dump/CMakeLists.txt
+++ b/tools/test/h5dump/CMakeLists.txt
@@ -4,41 +4,43 @@ project (HDF5_TOOLS_TEST_H5DUMP C)
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
-set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdump")
-set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
-set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
-
-add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
-target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
-target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
-
-# make plugins dir
-file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
-#-----------------------------------------------------------------------------
-# Copy plugin library to a plugins folder
-#-----------------------------------------------------------------------------
-add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
-)
+if (BUILD_SHARED_LIBS)
+ set (H5DUMP_TOOL_PLUGIN_LIB_CORENAME "dynlibdump")
+ set (H5DUMP_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5DUMP_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5DUMP_TOOL_PLUGIN_LIB_TARGET ${H5DUMP_TOOL_PLUGIN_LIB_CORENAME})
+
+ add_library (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_dump.c)
+ target_include_directories (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5DUMP_TOOL_PLUGIN_LIB_TARGET} ${H5DUMP_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${H5DUMP_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${H5DUMP_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5DUMP_TOOL_PLUGIN_LIB_TARGET}>"
+ )
+endif ()
# --------------------------------------------------------------------
# Add the h5dump test executable
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5dumpgentest ${HDF5_TOOLS_TEST_H5DUMP_SOURCE_DIR}/h5dumpgentest.c)
- target_include_directories(h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5dumpgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5dumpgentest STATIC)
- target_link_libraries (h5dumpgentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>)
+ #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dumpgentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake
index eedb432..6299821 100644
--- a/tools/test/h5dump/CMakeTests.cmake
+++ b/tools/test/h5dump/CMakeTests.cmake
@@ -320,6 +320,7 @@
${HDF5_TOOLS_DIR}/testfiles/tvlenstr_array.h5
${HDF5_TOOLS_DIR}/testfiles/tvlstr.h5
${HDF5_TOOLS_DIR}/testfiles/tvms.h5
+ ${HDF5_TOOLS_DIR}/testfiles/t128bit_float.h5
${HDF5_TOOLS_DIR}/testfiles/zerodim.h5
)
set (HDF5_ERROR_REFERENCE_TEST_FILES
@@ -361,12 +362,7 @@
endforeach ()
foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES})
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file} TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}")
- else ()
- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
- endif ()
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files")
endforeach ()
foreach (tst_other_file ${HDF5_REFERENCE_FILES})
@@ -387,9 +383,10 @@
# --------------------------------------------------------------------
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files")
- if (WIN32)
- file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
- file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF)
+ #file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM)
+ #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}")
else ()
HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files")
endif ()
@@ -401,31 +398,27 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
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})
+ add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5DUMP-${testname}")
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/std/h5dump-${testname}.out
- testfiles/std/h5dump-${testname}.out.err
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=h5dump-${testname}.out"
@@ -433,7 +426,9 @@
-D "TEST_REFERENCE=h5dump-${testname}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects)
+ if (last_test)
+ set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test})
+ endif ()
endif ()
endmacro ()
@@ -454,28 +449,25 @@
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})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.bin
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin
)
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -490,28 +482,25 @@
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})
+ add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-N-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}-N.bin
- ${resultfile}-N.out
- ${resultfile}-N.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin
)
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}-N.out"
@@ -526,28 +515,25 @@
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})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.txt
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt
)
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -556,42 +542,41 @@
-P "${HDF_RESOURCES_EXT_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})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${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 ()
endif ()
endmacro ()
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})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --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")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test})
endif ()
else ()
add_test (
NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -600,20 +585,20 @@
-P "${HDF_RESOURCES_EXT_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)
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-${resultfile}-output-cmp
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${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 --ignore-eol ${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 ()
endif ()
endmacro ()
@@ -621,41 +606,33 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-output-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove ${resultfile}.txt
+ 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}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${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})
+ if(NOT CMAKE_VERSION VERSION_LESS "3.14.0")
+ add_test (
+ NAME H5DUMP-output-cmp-${resultfile}
+ COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${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 ()
endif ()
endmacro ()
macro (ADD_H5_MASK_TEST resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -664,65 +641,61 @@
-D "TEST_MASK_ERROR=true"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
- macro (ADD_H5ERR_MASK_TEST resultfile resultcode)
+ macro (ADD_H5_GREP_TEST resultfile resultcode result_check)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
add_test (
- NAME H5DUMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
+ NAME H5DUMP-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -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=${result_check}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5ERR_MASK_TEST resultfile resultcode result_errcheck)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-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 "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
- macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode envvar envval)
+ macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode result_errcheck envvar envval)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-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_ERRREF=${result_errcheck}"
-D "TEST_ENV_VAR:STRING=${envvar}"
-D "TEST_ENV_VALUE:STRING=${envval}"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
@@ -731,17 +704,16 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5DUMP-IMPORT-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${resultfile}.bin
${resultfile}.h5
- ${conffile}.out
)
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${conffile}.out"
@@ -750,10 +722,10 @@
-P "${HDF_RESOURCES_EXT_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)
+ add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE: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)
+ add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE: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 ()
@@ -761,19 +733,11 @@
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std")
add_test (
NAME H5DUMP_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -781,9 +745,9 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects)
endif ()
endmacro ()
@@ -793,368 +757,6 @@
##############################################################################
##############################################################################
- 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
- non_existing.out
- non_existing.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
- tbitnopaque_be.out
- tbitnopaque_be.out.err
- tbitnopaque_le.out
- tbitnopaque_le.out.err
- tboot1.out
- tboot1.out.err
- tboot2.out
- tboot2.out.err
- tboot2A.out
- tboot2A.out.err
- tboot2B.out
- tboot2B.out.err
- tchar1.out
- tchar1.out.err
- tchunked.out
- tchunked.out.err
- tcmpdattrintsize.out
- tcmpdattrintsize.out.err
- tcmpdintarray.out
- tcmpdintarray.out.err
- tcmpdints.out
- tcmpdints.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
- tcompound_complex.out
- tcompound_complex.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
- tgrpnullspace.out
- tgrpnullspace.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
- tints4dims.out
- tints4dims.out.err
- tints4dimsBlock2.out
- tints4dimsBlock2.out.err
- tints4dimsBlockEq.out
- tints4dimsBlockEq.out.err
- tints4dimsCount2.out
- tints4dimsCount2.out.err
- tints4dimsCountEq.out
- tints4dimsCountEq.out.err
- tints4dimsStride2.out
- tints4dimsStride2.out.err
- tintsattrs.out
- tintsattrs.out.err
- tintsnodata.out
- tintsnodata.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
- tnbit.out
- tnbit.out.err
- tnestcomp-1.out
- tnestcomp-1.out.err
- tnestedcmpddt.out
- tnestedcmpddt.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
- tno-subset.out
- tno-subset.out.err
- tnullspace.out
- tnullspace.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
- trawdatafile.out
- trawdatafile.out.err
- trawdatafile.txt
- trawssetfile.out
- trawssetfile.out.err
- trawssetfile.txt
- treadfilter.out
- treadfilter.out.err
- treadintfilter.out
- treadintfilter.out.err
- treference.out
- treference.out.err
- tsaf.out
- tsaf.out.err
- tscalarattrintsize.out
- tscalarattrintsize.out.err
- tscalarintattrsize.out
- tscalarintattrsize.out.err
- tscalarintsize.out
- tscalarintsize.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
- tvlenstr_array.out
- tvlenstr_array.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
- zerodim.out
- zerodim.out.err
- )
- 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 ()
- set (last_test "H5DUMP-clearall-objects")
- endif ()
-
ADD_HELP_TEST(help 0 -h)
# test data output redirection
@@ -1199,12 +801,12 @@
# 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)
+ ADD_H5ERR_MASK_TEST (tgroup-2 1 "h5dump error: unable to open group \"/y\"" --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)
+ ADD_H5ERR_MASK_TEST (tdset-2 1 "h5dump error: unable to get link info from \"dset3\"" --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)
@@ -1212,7 +814,7 @@
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)
+ ADD_H5ERR_MASK_TEST (tattr-3 1 "h5dump error: unable to open attribute \"attr\"" --enable-error-stack --header -a /attr2 --attribute=/attr tattr.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 attributes in shared datatype (also in group and dataset)
@@ -1226,7 +828,7 @@
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)
+ ADD_H5ERR_MASK_TEST (tslink-D 0 "component not found" --enable-error-stack -d /slink1 tslink.h5)
# tests for hard links
ADD_H5_TEST (thlink-1 0 --enable-error-stack thlink.h5)
@@ -1243,7 +845,7 @@
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")
+ ADD_H5ERR_MASK_TEST (tcomp-3 0 "object '#6632' doesn't exist" "--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)
ADD_H5_TEST (tcompound_complex2 0 --enable-error-stack tcompound_complex2.h5)
@@ -1259,7 +861,7 @@
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_H5ERR_MASK_TEST (tall-1 0 "unable to open external file, external link file name = 'somefile'" --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)
@@ -1290,7 +892,7 @@
# 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_H5ERR_MASK_TEST (tarray1_big 0 "Undefined reference pointer" --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)
@@ -1319,13 +921,13 @@
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)
+ ADD_H5ERR_MASK_TEST (tall-2A 0 "unable to open external file, external link file name = 'somefile'" --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)
+ ADD_H5ERR_MASK_TEST (tall-2A0 0 "unable to open external file, external link file name = 'somefile'" --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)
+ ADD_H5ERR_MASK_TEST (tall-2B 0 "unable to open external file, external link file name = 'somefile'" --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)
@@ -1354,7 +956,7 @@
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)
+ ADD_H5ERR_MASK_TEST (tperror 1 "h5dump error: unable to get link info from \"bogus\"" --enable-error-stack -p -d bogus tfcontents1.h5)
# test for file contents
ADD_H5_TEST (tcontents 0 --enable-error-stack -n tfcontents1.h5)
@@ -1501,9 +1103,9 @@
# 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 (tdataregR 0 "Undefined reference pointer" --enable-error-stack -R tdatareg.h5)
ADD_H5_TEST (tattrreg 0 --enable-error-stack tattrreg.h5)
- ADD_H5ERR_MASK_TEST (tattrregR 0 -R --enable-error-stack tattrreg.h5)
+ ADD_H5ERR_MASK_TEST (tattrregR 0 "Undefined reference pointer" -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
@@ -1521,21 +1123,21 @@
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)
+ ADD_H5ERR_MASK_TEST (torderlinks1 0 "unable to open external file, external link file name = 'fname'" --enable-error-stack --sort_by=name --sort_order=ascending tfcontents1.h5)
+ ADD_H5ERR_MASK_TEST (torderlinks2 0 "unable to open external file, external link file name = 'fname'" --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)
+ ADD_H5ERR_MASK_TEST (textlinksrc 0 "Too many soft links in path" --enable-error-stack textlinksrc.h5)
+ ADD_H5ERR_MASK_TEST (textlinkfar 0 "Too many soft links in path" --enable-error-stack textlinkfar.h5)
# test for dangling external links
- ADD_H5ERR_MASK_TEST (textlink 0 --enable-error-stack textlink.h5)
+ ADD_H5ERR_MASK_TEST (textlink 0 "unable to open external file, external link file name = 'anotherfile'" --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)
+ ADD_H5ERR_MASK_ENV_TEST (filter_fail 1 "filter plugins disabled" "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)
@@ -1546,7 +1148,22 @@
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
ADD_H5_TEST (err_attr_dspace 1 err_attr_dspace.h5)
+ # test to verify HDFFV-9407: long double full precision
+ ADD_H5_GREP_TEST (t128bit_float 1 "1.123456789012345" -m %.35Lf t128bit_float.h5)
+
##############################################################################
### P L U G I N T E S T S
##############################################################################
-ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5)
+if (BUILD_SHARED_LIBS)
+ ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5)
+endif ()
+
+##############################################################################
+##############################################################################
+### V F D T E S T S ###
+##############################################################################
+##############################################################################
+
+if (HDF5_TEST_VFD)
+ include (CMakeVFDTests.cmake)
+endif ()
diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake
index 4f3ee9f..a6be9ae 100644
--- a/tools/test/h5dump/CMakeTestsPBITS.cmake
+++ b/tools/test/h5dump/CMakeTestsPBITS.cmake
@@ -119,31 +119,29 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
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})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits")
- if (NOT ${resultcode} STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_pbits_test}" STREQUAL "")
+ if (last_pbits_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -151,7 +149,6 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -161,126 +158,6 @@
##############################################################################
##############################################################################
- 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 ()
- set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects")
- endif ()
-
# test failure handling
# Missing file name
ADD_H5_PBITS_TEST (tnofilename-with-packed-bits 1 --enable-error-stack)
diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake
index 922e79e..036609c 100644
--- a/tools/test/h5dump/CMakeTestsVDS.cmake
+++ b/tools/test/h5dump/CMakeTestsVDS.cmake
@@ -115,31 +115,29 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_VDS_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})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- 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/vds")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -147,38 +145,29 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump> ${ARGN})
+ add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN})
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
)
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_PREFIX-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
add_test (
NAME H5DUMP_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -188,35 +177,26 @@
-D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_LAYOUT resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump> -p ${ARGN})
+ add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_vds_test}" STREQUAL "")
+ if (last_vds_test)
set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- 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/vds")
add_test (
NAME H5DUMP-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -224,7 +204,6 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects")
endif ()
endmacro ()
@@ -234,54 +213,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5DUMP_VDS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tvds-1.out
- tvds-1.out.err
- tvds-2.out
- tvds-2.out.err
- tvds-3_1.out
- tvds-3_1.out.err
- tvds-3_2.out
- tvds-3_2.out.err
- tvds-4.out
- tvds-4.out.err
- tvds-5.out
- tvds-5.out.err
- vds-first.out
- vds-first.out.err
- vds-gap1.out
- vds-gap1.out.err
- vds-gap2.out
- vds-gap2.out.err
- tvds_layout-1.out
- tvds_layout-1.out.err
- tvds_layout-2.out
- tvds_layout-2.out.err
- tvds_layout-3_1.out
- tvds_layout-3_1.out.err
- tvds_layout-3_2.out
- tvds_layout-3_2.out.err
- tvds_layout-4.out
- tvds_layout-4.out.err
- tvds_layout-5.out
- tvds_layout-5.out.err
- vds_layout-eiger.out
- vds_layout-eiger.out.err
- vds_layout-maxmin.out
- vds_layout-maxmin.out.err
- )
- set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${last_vds_test}" STREQUAL "")
- set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES DEPENDS ${last_vds_test})
- endif ()
- set (last_VDS_test "H5DUMP_VDS-clearall-objects")
- endif ()
-
# 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.
diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake
index de87d2f..6d73cb1 100644
--- a/tools/test/h5dump/CMakeTestsXML.cmake
+++ b/tools/test/h5dump/CMakeTestsXML.cmake
@@ -160,6 +160,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_XML_SKIP_H5_TEST skipresultfile skipresultcode testtype)
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
@@ -176,28 +182,20 @@
macro (ADD_XML_H5_TEST resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5DUMP_XML-${resultfile} COMMAND $<TARGET_FILE:h5dump> --xml ${ARGN})
+ add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml")
- if (NOT "${resultcode}" STREQUAL "0")
+ if (${resultcode})
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_xml_test}" STREQUAL "")
+ if (last_xml_test)
set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test})
endif ()
else ()
- # Remove any output file left over from previous test run
- 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=--xml;${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -205,7 +203,6 @@
-D "TEST_REFERENCE=${resultfile}.xml"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS H5DUMP_XML-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -215,154 +212,6 @@
##############################################################################
##############################################################################
- 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_be.h5.out
- tbitfields_be.h5.out.err
- tbitfields_le.h5.out
- tbitfields_le.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
- test35.nc.out
- test35.nc.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
- tnullspace.h5.out
- tnullspace.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 ()
- set (last_test "H5DUMP-XML-clearall-objects")
- endif ()
-
########## test XML
ADD_XML_H5_TEST (tall.h5 0 tall.h5)
ADD_XML_H5_TEST (tattr.h5 0 tattr.h5)
diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake
new file mode 100644
index 0000000..0a345ef
--- /dev/null
+++ b/tools/test/h5dump/CMakeVFDTests.cmake
@@ -0,0 +1,91 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+set (VFD_H5DUMP_LIST
+ sec2
+ stdio
+ core
+ core_paged
+ split
+ multi
+ family
+)
+
+if (DIRECT_VFD)
+ set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct)
+endif ()
+
+# --------------------------------------------------------------------
+# Copy all the HDF5 files from the source directory into the test directory
+# --------------------------------------------------------------------
+set (HDF5_VFD_H5DUMP_FILES
+ packedbits
+)
+
+foreach (vfdtest ${VFD_H5DUMP_LIST})
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+ foreach (h5_tfile ${HDF5_VFD_H5DUMP_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.h5" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.h5" "HDF5_VFD_H5DUMP_files")
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.ddl" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.ddl" "HDF5_VFD_H5DUMP_files")
+ endforeach ()
+endforeach ()
+
+add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF5_VFD_H5DUMP tests" DEPENDS ${HDF5_VFD_H5DUMP_files_list})
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
+if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+else ()
+ set (tgt_ext "-shared")
+endif ()
+
+macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${resultfile}.out"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (H5DUMP_VFD-${vfdname}-${resultfile}-h5dump PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
+ endif ()
+endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# Run test with different Virtual File Driver
+foreach (vfd ${VFD_H5DUMP_LIST})
+ # test for signed/unsigned datasets
+ ADD_VFD_H5DUMP_TEST (${vfd} packedbits 0 --enable-error-stack packedbits.h5)
+endforeach ()
diff --git a/tools/test/h5dump/errfiles/filter_fail.err b/tools/test/h5dump/errfiles/filter_fail.err
index a785ea7..07b0aa0 100644
--- a/tools/test/h5dump/errfiles/filter_fail.err
+++ b/tools/test/h5dump/errfiles/filter_fail.err
@@ -2,19 +2,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dread(): can't read data
major: Dataset
minor: Read failed
- #001: (file name) line (number) in H5D__read(): can't read data
+ #001: (file name) line (number) in H5VL_dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #002: (file name) line (number) in H5VL__dataset_read(): dataset read failed
+ major: Virtual Object Layer
+ minor: Read failed
+ #003: (file name) line (number) in H5VL__native_dataset_read(): can't read data
+ major: Dataset
+ minor: Read failed
+ #004: (file name) line (number) in H5D__read(): can't read data
major: Dataset
minor: Read failed
- #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
+ #005: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk
major: Low-level I/O
minor: Read failed
- #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
+ #006: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed
major: Dataset
minor: Filter operation failed
- #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered
+ #007: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered
major: Data filters
minor: Read failed
- #005: (file name) line (number) in H5PL_load(): filter plugins disabled
+ #008: (file name) line (number) in H5PL_load(): filter plugins disabled
major: Plugin for dynamically loaded library
minor: Unable to load metadata into cache
h5dump error: unable to print data
diff --git a/tools/test/h5dump/errfiles/tall-1.err b/tools/test/h5dump/errfiles/tall-1.err
index f4c2d91..84140f2 100644
--- a/tools/test/h5dump/errfiles/tall-1.err
+++ b/tools/test/h5dump/errfiles/tall-1.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2A.err b/tools/test/h5dump/errfiles/tall-2A.err
index f4c2d91..84140f2 100644
--- a/tools/test/h5dump/errfiles/tall-2A.err
+++ b/tools/test/h5dump/errfiles/tall-2A.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2A0.err b/tools/test/h5dump/errfiles/tall-2A0.err
index f4c2d91..84140f2 100644
--- a/tools/test/h5dump/errfiles/tall-2A0.err
+++ b/tools/test/h5dump/errfiles/tall-2A0.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tall-2B.err b/tools/test/h5dump/errfiles/tall-2B.err
index f4c2d91..84140f2 100644
--- a/tools/test/h5dump/errfiles/tall-2B.err
+++ b/tools/test/h5dump/errfiles/tall-2B.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'somefile'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'somefile', temp_file_name = 'somefile'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tarray1_big.err b/tools/test/h5dump/errfiles/tarray1_big.err
index be77711..ff22495 100644
--- a/tools/test/h5dump/errfiles/tarray1_big.err
+++ b/tools/test/h5dump/errfiles/tarray1_big.err
@@ -2,21 +2,48 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
diff --git a/tools/test/h5dump/errfiles/tattr-3.err b/tools/test/h5dump/errfiles/tattr-3.err
index a6aae76..8481acf 100644
--- a/tools/test/h5dump/errfiles/tattr-3.err
+++ b/tools/test/h5dump/errfiles/tattr-3.err
@@ -2,10 +2,19 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Aopen(): unable to open attribute: 'attr'
major: Attribute
minor: Can't open object
- #001: (file name) line (number) in H5A__open(): unable to load attribute info from object header for attribute: 'attr'
+ #001: (file name) line (number) in H5VL_attr_open(): attribute open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__attr_open(): attribute open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_attr_open(): unable to open attribute: 'attr'
+ major: Attribute
+ minor: Can't open object
+ #004: (file name) line (number) in H5A__open(): unable to load attribute info from object header for attribute: 'attr'
major: Attribute
minor: Can't open object
- #002: (file name) line (number) in H5O__attr_open_by_name(): can't locate attribute: 'attr'
+ #005: (file name) line (number) in H5O__attr_open_by_name(): can't locate attribute: 'attr'
major: Attribute
minor: Object not found
h5dump error: unable to open attribute "attr"
diff --git a/tools/test/h5dump/errfiles/tattrregR.err b/tools/test/h5dump/errfiles/tattrregR.err
index d84d5ec..8a1539c 100644
--- a/tools/test/h5dump/errfiles/tattrregR.err
+++ b/tools/test/h5dump/errfiles/tattrregR.err
@@ -2,14 +2,32 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
diff --git a/tools/test/h5dump/errfiles/tcomp-3.err b/tools/test/h5dump/errfiles/tcomp-3.err
index e41e97a..fc59b0b 100644
--- a/tools/test/h5dump/errfiles/tcomp-3.err
+++ b/tools/test/h5dump/errfiles/tcomp-3.err
@@ -2,18 +2,27 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Topen2(): unable to open named datatype
major: Datatype
minor: Can't open object
- #001: (file name) line (number) in H5T__open_name(): not found
+ #001: (file name) line (number) in H5VL_datatype_open(): datatype open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__datatype_open(): datatype open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_datatype_open(): unable to open named datatype
+ major: Datatype
+ minor: Can't open object
+ #004: (file name) line (number) in H5T__open_name(): not found
major: Datatype
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #005: (file name) line (number) in H5G__loc_find_cb(): object '#6632' doesn't exist
+ #008: (file name) line (number) in H5G__loc_find_cb(): object '#6632' doesn't exist
major: Symbol table
minor: Object not found
diff --git a/tools/test/h5dump/errfiles/tdataregR.err b/tools/test/h5dump/errfiles/tdataregR.err
index d84d5ec..8a1539c 100644
--- a/tools/test/h5dump/errfiles/tdataregR.err
+++ b/tools/test/h5dump/errfiles/tdataregR.err
@@ -2,14 +2,32 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Rdereference2(): unable to dereference object
major: References
minor: Can't open object
- #001: (file name) line (number) in H5R__dereference(): Undefined reference pointer
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to dereference object
+ major: References
+ minor: Can't open object
+ #004: (file name) line (number) in H5R__dereference(): Undefined reference pointer
major: Invalid arguments to routine
minor: Bad value
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
diff --git a/tools/test/h5dump/errfiles/tdset-2.err b/tools/test/h5dump/errfiles/tdset-2.err
index e61966f..2d70b35 100644
--- a/tools/test/h5dump/errfiles/tdset-2.err
+++ b/tools/test/h5dump/errfiles/tdset-2.err
@@ -2,35 +2,53 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dopen2(): unable to open dataset
major: Dataset
minor: Can't open object
- #001: (file name) line (number) in H5D__open_name(): not found
+ #001: (file name) line (number) in H5VL_dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_dataset_open(): unable to open dataset
+ major: Dataset
+ minor: Can't open object
+ #004: (file name) line (number) in H5D__open_name(): not found
major: Dataset
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #005: (file name) line (number) in H5G__loc_find_cb(): object 'dset3' doesn't exist
+ #008: (file name) line (number) in H5G__loc_find_cb(): object 'dset3' doesn't exist
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Lget_info(): unable to get link info
major: Links
minor: Can't get value
- #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ #001: (file name) line (number) in H5VL_link_get(): link get failed
+ major: Virtual Object Layer
+ minor: Can't get value
+ #002: (file name) line (number) in H5VL__link_get(): link get failed
+ major: Virtual Object Layer
+ minor: Can't get value
+ #003: (file name) line (number) in H5VL__native_link_get(): unable to get link info
+ major: Links
+ minor: Object not found
+ #004: (file name) line (number) in H5L_get_info(): name doesn't exist
major: Links
minor: Object already exists
- #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #005: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #006: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #004: (file name) line (number) in H5L__get_info_cb(): name doesn't exist
+ #007: (file name) line (number) in H5L__get_info_cb(): name doesn't exist
major: Links
minor: Object not found
h5dump error: unable to get link info from "dset3"
diff --git a/tools/test/h5dump/errfiles/textlink.err b/tools/test/h5dump/errfiles/textlink.err
index 4a5f545..3f77f38 100644
--- a/tools/test/h5dump/errfiles/textlink.err
+++ b/tools/test/h5dump/errfiles/textlink.err
@@ -2,55 +2,67 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'filename'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'filename'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'filename', temp_file_name = 'filename'
- major: File accessibilty
- minor: Unable to open file
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'anotherfile'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'anotherfile'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'anotherfile', temp_file_name = 'anotherfile'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/textlinkfar.err b/tools/test/h5dump/errfiles/textlinkfar.err
index 1f9241a..8245291 100644
--- a/tools/test/h5dump/errfiles/textlinkfar.err
+++ b/tools/test/h5dump/errfiles/textlinkfar.err
@@ -2,49 +2,58 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open object
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
- #008: (file name) line (number) in H5O_open_name(): object not found
+ #011: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #009: (file name) line (number) in H5G_loc_find(): can't find object
+ #012: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #010: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #013: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #011: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #014: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
+ #015: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
major: Links
minor: Link traversal failure
- #013: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
+ #016: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
major: Symbol table
minor: Object not found
- #014: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #017: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #015: (file name) line (number) in H5G__traverse_slink_cb(): component not found
+ #018: (file name) line (number) in H5G__traverse_slink_cb(): component not found
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
diff --git a/tools/test/h5dump/errfiles/textlinksrc.err b/tools/test/h5dump/errfiles/textlinksrc.err
index 1f9241a..8245291 100644
--- a/tools/test/h5dump/errfiles/textlinksrc.err
+++ b/tools/test/h5dump/errfiles/textlinksrc.err
@@ -2,49 +2,58 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open object
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open object
major: Links
minor: Can't open object
- #008: (file name) line (number) in H5O_open_name(): object not found
+ #011: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #009: (file name) line (number) in H5G_loc_find(): can't find object
+ #012: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #010: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #013: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #011: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #014: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #012: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
+ #015: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
major: Links
minor: Link traversal failure
- #013: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
+ #016: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
major: Symbol table
minor: Object not found
- #014: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #017: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #015: (file name) line (number) in H5G__traverse_slink_cb(): component not found
+ #018: (file name) line (number) in H5G__traverse_slink_cb(): component not found
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
diff --git a/tools/test/h5dump/errfiles/tgroup-2.err b/tools/test/h5dump/errfiles/tgroup-2.err
index 715f2d2..27557f3 100644
--- a/tools/test/h5dump/errfiles/tgroup-2.err
+++ b/tools/test/h5dump/errfiles/tgroup-2.err
@@ -2,19 +2,28 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Gopen2(): unable to open group
major: Symbol table
minor: Can't open object
- #001: (file name) line (number) in H5G__open_name(): group not found
+ #001: (file name) line (number) in H5VL_group_open(): group open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__group_open(): group open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_group_open(): unable to open group
+ major: Symbol table
+ minor: Can't open object
+ #004: (file name) line (number) in H5G__open_name(): group not found
major: Symbol table
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #005: (file name) line (number) in H5G__loc_find_cb(): object 'y' doesn't exist
+ #008: (file name) line (number) in H5G__loc_find_cb(): object 'y' doesn't exist
major: Symbol table
minor: Object not found
h5dump error: unable to open group "/y"
diff --git a/tools/test/h5dump/errfiles/torderlinks1.err b/tools/test/h5dump/errfiles/torderlinks1.err
index 648906b..caeef27 100644
--- a/tools/test/h5dump/errfiles/torderlinks1.err
+++ b/tools/test/h5dump/errfiles/torderlinks1.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/torderlinks2.err b/tools/test/h5dump/errfiles/torderlinks2.err
index 648906b..caeef27 100644
--- a/tools/test/h5dump/errfiles/torderlinks2.err
+++ b/tools/test/h5dump/errfiles/torderlinks2.err
@@ -2,27 +2,33 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Oopen(): unable to open object
major: Object header
minor: Can't open object
- #001: (file name) line (number) in H5O_open_name(): object not found
+ #001: (file name) line (number) in H5VL_object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__object_open(): object open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_object_open(): unable to open object by name
+ major: Object header
+ minor: Can't open object
+ #004: (file name) line (number) in H5O_open_name(): object not found
major: Object header
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): user-defined link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
+ #009: (file name) line (number) in H5G__traverse_ud(): traversal callback returned invalid ID
major: Symbol table
minor: Unable to find atom information (already closed?)
- #007: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
+ #010: (file name) line (number) in H5L__extern_traverse(): unable to open external file, external link file name = 'fname'
major: Links
minor: Unable to open file
- #008: (file name) line (number) in H5F_prefix_open_file(): unable to open file, file name = 'fname', temp_file_name = 'fname'
- major: File accessibilty
- minor: Unable to open file
diff --git a/tools/test/h5dump/errfiles/tperror.err b/tools/test/h5dump/errfiles/tperror.err
index 733b652..b0b908b 100644
--- a/tools/test/h5dump/errfiles/tperror.err
+++ b/tools/test/h5dump/errfiles/tperror.err
@@ -2,35 +2,53 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dopen2(): unable to open dataset
major: Dataset
minor: Can't open object
- #001: (file name) line (number) in H5D__open_name(): not found
+ #001: (file name) line (number) in H5VL_dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_dataset_open(): unable to open dataset
+ major: Dataset
+ minor: Can't open object
+ #004: (file name) line (number) in H5D__open_name(): not found
major: Dataset
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #005: (file name) line (number) in H5G__loc_find_cb(): object 'bogus' doesn't exist
+ #008: (file name) line (number) in H5G__loc_find_cb(): object 'bogus' doesn't exist
major: Symbol table
minor: Object not found
HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Lget_info(): unable to get link info
major: Links
minor: Can't get value
- #001: (file name) line (number) in H5L_get_info(): name doesn't exist
+ #001: (file name) line (number) in H5VL_link_get(): link get failed
+ major: Virtual Object Layer
+ minor: Can't get value
+ #002: (file name) line (number) in H5VL__link_get(): link get failed
+ major: Virtual Object Layer
+ minor: Can't get value
+ #003: (file name) line (number) in H5VL__native_link_get(): unable to get link info
+ major: Links
+ minor: Object not found
+ #004: (file name) line (number) in H5L_get_info(): name doesn't exist
major: Links
minor: Object already exists
- #002: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #005: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #006: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #004: (file name) line (number) in H5L__get_info_cb(): name doesn't exist
+ #007: (file name) line (number) in H5L__get_info_cb(): name doesn't exist
major: Links
minor: Object not found
h5dump error: unable to get link info from "bogus"
diff --git a/tools/test/h5dump/errfiles/tslink-D.err b/tools/test/h5dump/errfiles/tslink-D.err
index de0705e..e650a33 100644
--- a/tools/test/h5dump/errfiles/tslink-D.err
+++ b/tools/test/h5dump/errfiles/tslink-D.err
@@ -2,27 +2,36 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dopen2(): unable to open dataset
major: Dataset
minor: Can't open object
- #001: (file name) line (number) in H5D__open_name(): not found
+ #001: (file name) line (number) in H5VL_dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #002: (file name) line (number) in H5VL__dataset_open(): dataset open failed
+ major: Virtual Object Layer
+ minor: Can't open object
+ #003: (file name) line (number) in H5VL__native_dataset_open(): unable to open dataset
+ major: Dataset
+ minor: Can't open object
+ #004: (file name) line (number) in H5D__open_name(): not found
major: Dataset
minor: Object not found
- #002: (file name) line (number) in H5G_loc_find(): can't find object
+ #005: (file name) line (number) in H5G_loc_find(): can't find object
major: Symbol table
minor: Object not found
- #003: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #006: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #004: (file name) line (number) in H5G__traverse_real(): special link traversal failed
+ #007: (file name) line (number) in H5G__traverse_real(): special link traversal failed
major: Links
minor: Link traversal failure
- #005: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
+ #008: (file name) line (number) in H5G__traverse_special(): symbolic link traversal failed
major: Links
minor: Link traversal failure
- #006: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
+ #009: (file name) line (number) in H5G__traverse_slink(): unable to follow symbolic link
major: Symbol table
minor: Object not found
- #007: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #010: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #008: (file name) line (number) in H5G__traverse_slink_cb(): component not found
+ #011: (file name) line (number) in H5G__traverse_slink_cb(): component not found
major: Symbol table
minor: Object not found
diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c
index 4ef63e5..ad70770 100644
--- a/tools/test/h5dump/h5dumpgentest.c
+++ b/tools/test/h5dump/h5dumpgentest.c
@@ -563,7 +563,7 @@ gent_attribute(void)
dims[0] = 24;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "attribute of root group");
+ HDsprintf(buf, "attribute of root group");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1373,7 +1373,7 @@ static void gent_all(void)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1404,7 +1404,7 @@ static void gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "1st attribute of dset1.1.1");
+ HDsprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1412,7 +1412,7 @@ static void gent_all(void)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "2nd attribute of dset1.1.1");
+ HDsprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -1608,7 +1608,7 @@ gent_many(void)
dims[0] = 10;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_CHAR, buf);
H5Sclose(space2);
H5Aclose(attr);
@@ -1889,7 +1889,7 @@ static void gent_str2(void)
int i;
- char buf[LENSTR+10];
+ char buf[LENSTR+20];
char buf2[3*LENSTR2];
hsize_t sdim;
@@ -1927,9 +1927,9 @@ static void gent_str2(void)
dims[0] = 3;
space2 = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(&(buf2[0*LENSTR2]), "0123456789");
- sprintf(&(buf2[1*LENSTR2]), "abcdefghij");
- sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ");
+ HDsprintf(&(buf2[0*LENSTR2]), "0123456789");
+ HDsprintf(&(buf2[1*LENSTR2]), "abcdefghij");
+ HDsprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ");
H5Awrite(attr, fxdlenstr2, buf2);
H5Sclose(space2);
H5Tclose(fxdlenstr2);
@@ -1941,7 +1941,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1954,7 +1954,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1974,7 +1974,7 @@ static void gent_str2(void)
for(i = 0;(hsize_t) i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -1988,7 +1988,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf)+1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2007,7 +2007,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2021,7 +2021,7 @@ static void gent_str2(void)
for(i = 0; (hsize_t)i < sdim; i++) {
start[0] = (hsize_t)i;
- sprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
+ HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i);
H5Tset_size(memtype, HDstrlen(buf) + 1);
H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block);
H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf);
@@ -2624,7 +2624,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset1.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2651,7 +2651,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset2.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2674,7 +2674,7 @@ static void gent_vldatatypes(void)
dset = H5Dcreate2(file, "Dataset3.0", type, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, &adata);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(type, space, H5P_DEFAULT, &adata);
+ ret = H5Treclaim(type, space, H5P_DEFAULT, &adata);
HDassert(ret >= 0);
ret = H5Dclose(dset);
@@ -2704,14 +2704,14 @@ gent_vldatatypes2(void)
for(i = 0; i < SPACE1_DIM1; i++) {
wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t));
if(wdata[i].p == NULL) {
- printf("Cannot allocate memory for VL data! i=%u\n", i);
+ HDprintf("Cannot allocate memory for VL data! i=%u\n", i);
return;
} /* end if */
wdata[i].len = i + 1;
for(t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) {
t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned));
if(t1->p == NULL) {
- printf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
+ HDprintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
} /* end if */
t1->len=j+1;
@@ -2740,7 +2740,7 @@ gent_vldatatypes2(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2811,7 +2811,7 @@ static void gent_vldatatypes3(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid2, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid2, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2878,7 +2878,7 @@ static void gent_vldatatypes4(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -2942,7 +2942,7 @@ static void gent_vldatatypes5(void)
ret = H5Dclose(dataset);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
ret = H5Tclose(tid1);
@@ -3385,7 +3385,7 @@ static void gent_array6(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -3454,7 +3454,7 @@ static void gent_array7(void)
HDassert(ret >= 0);
/* Reclaim the write VL data */
- ret = H5Dvlen_reclaim(tid1, sid1, H5P_DEFAULT, wdata);
+ ret = H5Treclaim(tid1, sid1, H5P_DEFAULT, wdata);
HDassert(ret >= 0);
/* Close Dataset */
@@ -3763,9 +3763,9 @@ void gent_multi(void)
for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
memb_map[mt] = mt;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
- /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/
+ /*HDprintf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/
memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10);
}
memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER;
@@ -3804,7 +3804,7 @@ static void gent_large_objname(void)
group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
for(i = 0; i < 50; ++i) {
- sprintf(grp_name, "this_is_a_large_group_name%d", i);
+ HDsprintf(grp_name, "this_is_a_large_group_name%d", i);
group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
H5Gclose(group2);
}
@@ -4054,7 +4054,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4165,7 +4165,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf52);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4298,7 +4298,7 @@ static void write_attr_in(hid_t loc_id,
aid = H5Acreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT);
status = H5Awrite(aid, tid, buf53);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
HDassert(status >= 0);
status = H5Aclose(aid);
status = H5Tclose(tid);
@@ -4496,7 +4496,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf5);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -4606,7 +4606,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen2D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf52);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -4745,7 +4745,7 @@ static void write_dset_in(hid_t loc_id,
did = H5Dcreate2(loc_id, "vlen3D", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
status = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53);
HDassert(status >= 0);
- status = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53);
+ status = H5Treclaim(tid, sid, H5P_DEFAULT, buf53);
HDassert(status >= 0);
status = H5Dclose(did);
status = H5Tclose(tid);
@@ -5966,7 +5966,7 @@ static void gent_fvalues(void)
did = H5Dcreate2(fid, "fill_vlen", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
ret = H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf3);
HDassert(ret >= 0);
- ret = H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf3);
+ ret = H5Treclaim(tid, sid, H5P_DEFAULT, buf3);
HDassert(ret >= 0);
ret = H5Dclose(did);
ret = H5Tclose(tid);
@@ -6275,7 +6275,7 @@ static int gent_ldouble(void)
return 0;
error:
- printf("error !\n");
+ HDprintf("error !\n");
return -1;
}
@@ -6438,7 +6438,7 @@ gent_bigdims(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Sclose(f_sid);
@@ -6630,7 +6630,7 @@ gent_group_creation_order(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Pclose(gcpl_id);
@@ -6899,7 +6899,7 @@ gent_attr_creation_order(void)
return;
out:
- printf("Error.....\n");
+ HDprintf("Error.....\n");
H5E_BEGIN_TRY {
H5Gclose(gid);
H5Dclose(did);
@@ -7532,16 +7532,6 @@ gent_nodata(void)
{
hid_t fid, dataset, space;
hsize_t dims[2];
- uint8_t dsetu8[F66_XDIM][F66_YDIM8], valu8bits;
- uint16_t dsetu16[F66_XDIM][F66_YDIM16], valu16bits;
- uint32_t dsetu32[F66_XDIM][F66_YDIM32], valu32bits;
- uint64_t dsetu64[F66_XDIM][F66_YDIM64], valu64bits;
- int8_t dset8[F66_XDIM][F66_YDIM8], val8bits;
- int16_t dset16[F66_XDIM][F66_YDIM16], val16bits;
- int32_t dset32[F66_XDIM][F66_YDIM32], val32bits;
- int64_t dset64[F66_XDIM][F66_YDIM64], val64bits;
- double dsetdbl[F66_XDIM][F66_YDIM8];
- unsigned int i, j;
fid = H5Fcreate(FILE87, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
@@ -9529,15 +9519,13 @@ gent_intattrscalars(void)
}
/*-------------------------------------------------------------------------
- * Function: gent_packedbits
+ * Function: gent_intsattrs
*
- * Purpose: Generate a file to be used in the h5dump packed bits tests.
+ * Purpose: Generate a file to be used in the h5dump tests.
* Four datasets of 1, 2, 4 and 8 bytes of unsigned int types are created.
* Four more datasets of 1, 2, 4 and 8 bytes of signed int types are created.
* Fill them with raw data such that no bit will be all zero in a dataset.
* A dummy dataset of double type is created for failure test.
- * Created: Albert Cheng, 2010/5/10.
- * Modified: Allen Byrne, 2011/1/5 Use file to test Signed/Unsigned datatypes
*-------------------------------------------------------------------------
*/
static void
@@ -10574,7 +10562,7 @@ static void gent_null_space_group(void)
*-------------------------------------------------------------------------
*/
static void
-gent_err_attr_dspace()
+gent_err_attr_dspace(void)
{
hid_t fid = -1; /* File identifier */
hid_t fcpl = -1; /* File access property list */
diff --git a/tools/test/h5dump/testh5dump.sh.in b/tools/test/h5dump/testh5dump.sh.in
index 42e4b07..141715c 100644
--- a/tools/test/h5dump/testh5dump.sh.in
+++ b/tools/test/h5dump/testh5dump.sh.in
@@ -34,13 +34,16 @@ H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary
RM='rm -rf'
CMP='cmp'
DIFF='diff -c'
+GREP='grep'
CP='cp'
DIRNAME='dirname'
LS='ls'
AWK='awk'
# Skip plugin module to test missing filter
-ENVCMD="env HDF5_PLUGIN_PRELOAD=::"
+# Also reset the VOL connector to only use the native connector, because of the
+# error stack checking. QAK - 2019/03/09
+ENVCMD="env HDF5_PLUGIN_PRELOAD=:: HDF5_VOL_CONNECTOR=native"
WORDS_BIGENDIAN="@WORDS_BIGENDIAN@"
@@ -81,6 +84,7 @@ $SRC_H5DUMP_TESTFILES/charsets.h5
$SRC_H5DUMP_TESTFILES/file_space.h5
$SRC_H5DUMP_TESTFILES/filter_fail.h5
$SRC_H5DUMP_TESTFILES/packedbits.h5
+$SRC_H5DUMP_TESTFILES/t128bit_float.h5
$SRC_H5DUMP_TESTFILES/taindices.h5
$SRC_H5DUMP_TESTFILES/tall.h5
$SRC_H5DUMP_TESTFILES/tarray1.h5
@@ -490,7 +494,6 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -534,7 +537,6 @@ TOOLTEST2() {
cd $TESTDIR
$RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -593,7 +595,6 @@ TOOLTEST2A() {
cd $TESTDIR
$RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -660,7 +661,6 @@ TOOLTEST2B() {
cd $TESTDIR
$RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
- cat $actual_err >> $actual
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
@@ -717,7 +717,6 @@ TOOLTEST3() {
-e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
- cat $actual_ext >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -759,7 +758,7 @@ TOOLTEST4() {
TESTING $DUMPER $@
(
cd $TESTDIR
- $RUNSERIAL $DUMPER_BIN "$@"
+ $ENVCMD $RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
# save actual and actual_err in case they are needed later.
@@ -776,7 +775,6 @@ TOOLTEST4() {
-e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
- #cat $actual_ext >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -842,7 +840,6 @@ TOOLTEST5() {
-e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
- #cat $actual_ext >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -886,7 +883,6 @@ TOOLTEST_HELP() {
cd $TESTDIR
$RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
- cat $actual_err >> $actual
if [ ! -f $expectdata ]; then
# Create the expect data file if it doesn't yet exist.
@@ -909,6 +905,42 @@ TOOLTEST_HELP() {
}
+# Call the h5dump tool and grep for a value
+# txttype ERRTXT greps test error output, otherwise greps test output
+GREPTEST()
+{
+ txttype=$1
+ expectdata=$2
+ actual=$TESTDIR/$3
+ actual_err="$TESTDIR/`basename $3 .ddl`.oerr"
+ shift
+ shift
+ shift
+
+ # Run test.
+ TESTING $DUMPER -p $@
+ (
+ cd $TESTDIR
+ $ENVCMD $RUNSERIAL $DUMPER_BIN -p "$@"
+ ) >$actual 2>$actual_err
+ if [[ "$txttype" = "ERRTXT" ]]; then
+ $GREP "$expectdata" $actual_err > /dev/null
+ else
+ $GREP "$expectdata" $actual > /dev/null
+ fi
+ if [ $? -eq 0 ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ rm -f $actual $actual_err
+ fi
+}
+
# Print a "SKIP" message
SKIP() {
TESTING $DUMPER $@
@@ -1111,7 +1143,7 @@ TOOLTEST tvlenstr_array.ddl --enable-error-stack tvlenstr_array.h5
# test for files with array data
TOOLTEST tarray1.ddl --enable-error-stack tarray1.h5
# # added for bug# 2092 - tarray1_big.h
-TOOLTEST4 tarray1_big.ddl --enable-error-stack -R tarray1_big.h5
+GREPTEST ERRTXT "Undefined reference pointer" tarray1_big.ddl --enable-error-stack -R tarray1_big.h5
TOOLTEST tarray2.ddl --enable-error-stack tarray2.h5
TOOLTEST tarray3.ddl --enable-error-stack tarray3.h5
TOOLTEST tarray4.ddl --enable-error-stack tarray4.h5
@@ -1319,9 +1351,9 @@ fi
# test for dataset region references
TOOLTEST tdatareg.ddl --enable-error-stack tdatareg.h5
-TOOLTEST4 tdataregR.ddl --enable-error-stack -R tdatareg.h5
+GREPTEST ERRTXT "Undefined reference pointer" tdataregR.ddl --enable-error-stack -R tdatareg.h5
TOOLTEST tattrreg.ddl --enable-error-stack tattrreg.h5
-TOOLTEST4 tattrregR.ddl --enable-error-stack -R tattrreg.h5
+GREPTEST ERRTXT "Undefined reference pointer" tattrregR.ddl --enable-error-stack -R tattrreg.h5
TOOLTEST2 tbinregR.exp --enable-error-stack -d /Dataset1 -s 0 -R -y -o tbinregR.txt tdatareg.h5
# Clean up text output files
@@ -1369,6 +1401,9 @@ TOOLTEST3 non_existing.ddl --enable-error-stack tgroup.h5 non_existing.h5
# test to verify HDFFV-10333: error similar to H5O_attr_decode in the jira issue
TOOLTEST err_attr_dspace.ddl err_attr_dspace.h5
+# test to verify HDFFV-9407: long double full precision
+GREPTEST OUTTXT "1.123456789012345" t128bit_float.ddl -m %.35Lf t128bit_float.h5
+
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5dump/testh5dumppbits.sh.in b/tools/test/h5dump/testh5dumppbits.sh.in
index 9cf5c99..febce2c 100644
--- a/tools/test/h5dump/testh5dumppbits.sh.in
+++ b/tools/test/h5dump/testh5dumppbits.sh.in
@@ -235,7 +235,6 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -278,7 +277,6 @@ TOOLTEST2() {
cd $TESTDIR
$RUNSERIAL $DUMPER_BIN "$@"
) >$actual 2>$actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -348,7 +346,6 @@ TOOLTEST3() {
-e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
- cat $actual_ext >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
@@ -406,7 +403,6 @@ TOOLTEST4() {
-e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \
-e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \
$actual_err > $actual_ext
- #cat $actual_ext >> $actual
if [ ! -f $expect ]; then
# Create the expect file if it doesn't yet exist.
diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt
index 170ba4c..55d5623 100644
--- a/tools/test/h5format_convert/CMakeLists.txt
+++ b/tools/test/h5format_convert/CMakeLists.txt
@@ -5,19 +5,24 @@ project (HDF5_TOOLS_TEST_H5FC C)
# Add the h5format_convert test executables
# --------------------------------------------------------------------
add_executable (h5fc_chk_idx ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_chk_idx.c)
-target_include_directories(h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5fc_chk_idx STATIC)
-target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5fc_chk_idx PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5fc_chk_idx STATIC)
+ target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5fc_chk_idx SHARED)
+ target_link_libraries (h5fc_chk_idx PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5fc_chk_idx PROPERTIES FOLDER tools)
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5fc_gentest ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/h5fc_gentest.c)
- target_include_directories(h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5fc_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5fc_gentest STATIC)
- target_link_libraries (h5fc_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_link_libraries (h5fc_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5fc_gentest COMMAND $<TARGET_FILE:h5fc_gentest>)
+ #add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_gentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake
index 2240813..398866c 100644
--- a/tools/test/h5format_convert/CMakeTests.cmake
+++ b/tools/test/h5format_convert/CMakeTests.cmake
@@ -22,10 +22,8 @@
set (HDF5_REFERENCE_FILES
h5fc_help.ddl
h5fc_nooption.ddl
- h5fc_nonexistfile.ddl
h5fc_d_file.ddl
h5fc_dname.ddl
- h5fc_nonexistdset_file.ddl
h5fc_v_non_chunked.ddl
h5fc_v_bt1.ddl
h5fc_v_ndata_bt1.ddl
@@ -49,6 +47,12 @@
h5fc_v_err.ddl
h5fc_v_err.ddl.err
)
+ set (HDF5_REFERENCE_ERR_FILES
+ h5fc_d_file.ddl.err
+ h5fc_dname.err
+ h5fc_nonexistfile.ddl.err
+ h5fc_nonexistdset_file.ddl.err
+ )
set (HDF5_REFERENCE_TEST_FILES
h5fc_non_v3.h5
h5fc_edge_v3.h5
@@ -78,6 +82,10 @@
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${ddl_file}" "${PROJECT_BINARY_DIR}/testfiles/${ddl_file}" "h5fc_files")
endforeach ()
+ foreach (h5_file ${HDF5_REFERENCE_ERR_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5fc_files")
+ endforeach ()
+
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5fc_files")
endforeach ()
@@ -89,36 +97,39 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_OUTPUT testname resultfile resultcode testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/outtmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
- if (NOT "${testfile}" STREQUAL "")
+ if (${testfile})
add_test (
NAME H5FC-${testname}-${testfile}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
)
set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}-${testfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};outtmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
-D "TEST_EXPECT=${resultcode}"
-D "TEST_REFERENCE=${resultfile}"
+ -D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
@@ -127,7 +138,8 @@
add_test (
NAME H5FC-${testname}-NA
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -141,59 +153,68 @@
endif ()
endmacro ()
- macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode testfile)
+ macro (ADD_H5_NOERR_OUTPUT testname resultfile resultcode testfile)
# If using memchecker add tests without using scripts
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/outtmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
- if (NOT "${testfile}" STREQUAL "")
- add_test (
- NAME H5FC-${testname}-${testfile}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
- )
- set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
- add_test (
- NAME H5FC-${testname}-${testfile}
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
- -D "TEST_ARGS=${ARGN};outtmp.h5"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${testname}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
- set (last_test "H5FC-${testname}-${testfile}")
- else ()
- add_test (
- NAME H5FC-${testname}-NA
- COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
- -D "TEST_ARGS=${ARGN}"
- -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
- -D "TEST_OUTPUT=${testname}.out"
- -D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}"
- -D "TEST_ERRREF=${resultfile}.err"
- -D "TEST_MASK_ERROR=true"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
- )
- set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
- set (last_test "H5FC-${testname}-NA")
+ add_test (
+ NAME H5FC-${testname}-${testfile}-tmpfile
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ )
+ set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
+ add_test (
+ NAME H5FC-${testname}-${testfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_ARGS=${ARGN};outtmp.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
+ set (last_test "H5FC-${testname}-${testfile}")
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_MASK_OUTPUT testname resultfile resultcode result_errcheck testfile)
+ # If using memchecker add tests without using scripts
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5FC-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5
+ )
+ if (last_test)
+ set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
+ add_test (
+ NAME H5FC-${testname}-${testfile}-tmpfile
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5
+ )
+ set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
+ add_test (
+ NAME H5FC-${testname}-${testfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
+ -D "TEST_ARGS=${ARGN};outtmp.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
+ )
+ set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile")
+ set (last_test "H5FC-${testname}-${testfile}")
endif ()
endmacro ()
@@ -202,25 +223,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/tmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/tmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/tmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -238,7 +255,7 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC_CHECK_IDX-${testname}
- COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/tmp.h5" "${ARGN}"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/tmp.h5 ${ARGN}
)
set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}")
endif ()
@@ -249,25 +266,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/chktmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/chktmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -278,7 +291,7 @@
set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile")
add_test (
NAME H5FC_CHECK_IDX-${testname}
- COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/chktmp.h5" "${ARGN}"
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/chktmp.h5 ${ARGN}
)
set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}")
set (last_test "H5FC_CHECK_IDX-${testname}")
@@ -286,31 +299,25 @@
endmacro ()
macro (ADD_H5_H5DUMP_CHECK testname)
- # If using memchecker add tests without using scripts
+ # If using memchecker skip tests
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5FC-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ./testfiles/dmptmp.h5
- ./testfiles/${testname}.out
- ./testfiles/${testname}.out.err
- ./testfiles/${testname}_chk.out
- ./testfiles/${testname}_chk.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/dmptmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
endif ()
add_test (
NAME H5FC-${testname}-tmpfile
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5
)
set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects")
add_test (
NAME H5FC-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>"
-D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}.out"
@@ -322,7 +329,8 @@
add_test (
NAME H5FC_CHECK_DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=testfiles/${testname}_chk.out"
@@ -345,66 +353,13 @@
# Remove any output file left over from previous test run
add_test (
NAME H5FC-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5fc_help.out
- h5fc_help.out.err
- h5fc_nooption.out
- h5fc_nooption.out.err
- h5fc_nonexistfile.out
- h5fc_nonexistfile.out.err
- h5fc_d_file.out
- h5fc_d_file.out.err
- h5fc_d_file-d.out
- h5fc_d_file-d.out.err
- h5fc_dname.out
- h5fc_dname.out.err
- h5fc_nonexistdset_file.out
- h5fc_nonexistdset_file.out.err
- h5fc_v_non_chunked.out
- h5fc_v_non_chunked.out.err
- h5fc_v_bt1.out
- h5fc_v_bt1.out.err
- h5fc_v_ndata_bt1.out
- h5fc_v_ndata_bt1.out.err
- h5fc_v_all.out
- h5fc_v_all.out.err
- h5fc_v_n_1d.out
- h5fc_v_n_1d.out.err
- h5fc_v_n_all.out
- h5fc_v_n_all.out.err
- h5fc_ext1_i.out
- h5fc_ext1_i.out.err
- h5fc_ext1_s.out
- h5fc_ext1_s.out.err
- h5fc_ext1_f.out
- h5fc_ext1_f.out.err
- h5fc_ext2_if.out
- h5fc_ext2_if.out.err
- h5fc_ext2_is.out
- h5fc_ext2_is.out.err
- h5fc_ext2_sf.out
- h5fc_ext2_sf.out.err
- h5fc_ext3_isf.out
- h5fc_ext3_isf.out.err
- old_h5fc_ext1_i.out
- old_h5fc_ext1_i.out.err
- old_h5fc_ext1_s.out
- old_h5fc_ext1_s.out.err
- old_h5fc_ext1_f.out
- old_h5fc_ext1_f.out.err
- old_h5fc_ext2_if.out
- old_h5fc_ext2_is.out.err
- old_h5fc_ext2_is.out
- old_h5fc_ext2_sf.out.err
- old_h5fc_ext3_isf.out
- old_h5fc_ext3_isf.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove
outtmp.h5
tmp.h5
chktmp.h5
dmptmp.h5
)
- if (NOT "${last_test}" STREQUAL "")
+ if (last_test)
set_tests_properties (H5FC-clearall-objects PROPERTIES DEPENDS ${last_test})
endif ()
set (last_test "H5FC-clearall-objects")
@@ -433,22 +388,22 @@
# h5format_convert -d /GROUP/DSET_BT2 --verbose old_h5fc_ext_none.h5 (verbose, bt1 dataset)
# h5format_convert -d /DSET_NDATA_BT2 -v -n old_h5fc_ext_none.h5 (verbose, noop, bt1+nodata dataset)
# h5format_convert -v old_h5fc_ext_none.h5 (verbose, all datasets)
- ADD_H5_OUTPUT (h5fc_v_non_chunked h5fc_v_non_chunked.ddl 0 old_h5fc_ext_none.h5 -d /DSET_CONTIGUOUS -v)
- ADD_H5_OUTPUT (h5fc_v_bt1 h5fc_v_bt1.ddl 0 old_h5fc_ext_none.h5 -d /GROUP/DSET_BT2 --verbose)
- ADD_H5_OUTPUT (h5fc_v_ndata_bt1 h5fc_v_ndata_bt1.ddl 0 old_h5fc_ext_none.h5 -d /DSET_NDATA_BT2 -v -n)
- ADD_H5_OUTPUT (h5fc_v_all h5fc_v_all.ddl 0 old_h5fc_ext_none.h5 -v)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_non_chunked h5fc_v_non_chunked.ddl 0 old_h5fc_ext_none.h5 -d /DSET_CONTIGUOUS -v)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_bt1 h5fc_v_bt1.ddl 0 old_h5fc_ext_none.h5 -d /GROUP/DSET_BT2 --verbose)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_ndata_bt1 h5fc_v_ndata_bt1.ddl 0 old_h5fc_ext_none.h5 -d /DSET_NDATA_BT2 -v -n)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_all h5fc_v_all.ddl 0 old_h5fc_ext_none.h5 -v)
#
#
#
# h5format_convert -d /DSET_EA -v -n h5fc_ext_none.h5 (verbose, noop, one ea dataset)
# h5format_convert -v -n h5fc_non_v3.h5 (verbose, noop, all datasets)
- ADD_H5_OUTPUT (h5fc_v_n_1d h5fc_v_n_1d.ddl 0 h5fc_ext_none.h5 -d /DSET_EA -v -n)
- ADD_H5_OUTPUT (h5fc_v_n_all h5fc_v_n_all.ddl 0 h5fc_non_v3.h5 -v -n)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_n_1d h5fc_v_n_1d.ddl 0 h5fc_ext_none.h5 -d /DSET_EA -v -n)
+ ADD_H5_NOERR_OUTPUT (h5fc_v_n_all h5fc_v_n_all.ddl 0 h5fc_non_v3.h5 -v -n)
#
#
#
# h5format_convert -v h5fc_err_level.h5 (error encountered in converting the dataset)
- ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 h5fc_err_level.h5 -v)
+ ADD_H5_MASK_OUTPUT (h5fc_v_err h5fc_v_err.ddl 1 "h5format_convert error: unable to downgrade dataset \"/DSET_ERR\"" h5fc_err_level.h5 -v)
#
#
#
diff --git a/tools/test/h5format_convert/h5fc_gentest.c b/tools/test/h5format_convert/h5fc_gentest.c
index 8c873be..b482dee 100644
--- a/tools/test/h5format_convert/h5fc_gentest.c
+++ b/tools/test/h5format_convert/h5fc_gentest.c
@@ -14,7 +14,7 @@
/*
* Generate the binary hdf5 files for the h5format_convert tests.
* Usage: just execute the program without any arguments will
- * generate all the binary hdf5 files
+ * 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
@@ -24,71 +24,71 @@
#include "hdf5.h"
#include "H5private.h"
-#define NON_V3_FILE "h5fc_non_v3.h5"
-#define EDGE_V3_FILE "h5fc_edge_v3.h5"
-#define ERR_LEVEL_FILE "h5fc_err_level.h5"
+#define NON_V3_FILE "h5fc_non_v3.h5"
+#define EDGE_V3_FILE "h5fc_edge_v3.h5"
+#define ERR_LEVEL_FILE "h5fc_err_level.h5"
const char *FILENAME[] = {
- "h5fc_ext1_i.h5", /* 0 */
- "h5fc_ext1_s.h5", /* 1 */
- "h5fc_ext1_f.h5", /* 2 */
- "h5fc_ext2_is.h5", /* 3 */
- "h5fc_ext2_if.h5", /* 4 */
- "h5fc_ext2_sf.h5", /* 5 */
- "h5fc_ext3_isf.h5", /* 6 */
- "h5fc_ext_none.h5", /* 7 */
+ "h5fc_ext1_i.h5", /* 0 */
+ "h5fc_ext1_s.h5", /* 1 */
+ "h5fc_ext1_f.h5", /* 2 */
+ "h5fc_ext2_is.h5", /* 3 */
+ "h5fc_ext2_if.h5", /* 4 */
+ "h5fc_ext2_sf.h5", /* 5 */
+ "h5fc_ext3_isf.h5", /* 6 */
+ "h5fc_ext_none.h5", /* 7 */
NULL
};
-#define GROUP "GROUP"
+#define GROUP "GROUP"
-#define DSET_COMPACT "DSET_COMPACT"
-#define DSET_CONTIGUOUS "DSET_CONTIGUOUS"
+#define DSET_COMPACT "DSET_COMPACT"
+#define DSET_CONTIGUOUS "DSET_CONTIGUOUS"
-#define DSET_EA "DSET_EA"
-#define DSET_NDATA_EA "DSET_NDATA_EA"
-#define DSET_BT2 "DSET_BT2"
-#define DSET_NDATA_BT2 "DSET_NDATA_BT2"
-#define DSET_FA "DSET_FA"
-#define DSET_NDATA_FA "DSET_NDATA_FA"
-#define DSET_NONE "DSET_NONE"
-#define DSET_NDATA_NONE "DSET_NDATA_NONE"
+#define DSET_EA "DSET_EA"
+#define DSET_NDATA_EA "DSET_NDATA_EA"
+#define DSET_BT2 "DSET_BT2"
+#define DSET_NDATA_BT2 "DSET_NDATA_BT2"
+#define DSET_FA "DSET_FA"
+#define DSET_NDATA_FA "DSET_NDATA_FA"
+#define DSET_NONE "DSET_NONE"
+#define DSET_NDATA_NONE "DSET_NDATA_NONE"
-#define DSET_EDGE "DSET_EDGE"
-#define DSET_ERR "DSET_ERR"
+#define DSET_EDGE "DSET_EDGE"
+#define DSET_ERR "DSET_ERR"
#define ISTORE_IK 64
-#define ISTORE_ERR 1
+#define ISTORE_ERR 1
#define NUM 500
/*
- * Function: gen_non()
+ * Function: gen_non()
*
* Create a file with SWMR write+non-latest-format--this will result in v3 superbock+latest version support:
- * 1) 1 chunked dataset with extensible array chunk indexing type (without data)
- * 2) 1 chunked dataset with version 2 B-tree chunk indexing type (with data)
+ * 1) 1 chunked dataset with extensible array chunk indexing type (without data)
+ * 2) 1 chunked dataset with version 2 B-tree chunk indexing type (with data)
* Re-open the file with write+non-latest-format and create:
- * 3) 1 chunked dataset with version 2 B-tree chunk indexing type (without data)
- * 4) 1 chunked dataset with extensible array indexing type (with data)
- * 5) 1 compact and 1 contiguous datasets
+ * 3) 1 chunked dataset with version 2 B-tree chunk indexing type (without data)
+ * 4) 1 chunked dataset with extensible array indexing type (with data)
+ * 5) 1 compact and 1 contiguous datasets
*/
static void
gen_non(const char *fname)
{
- hid_t fid = -1; /* file id */
- hid_t fcpl = -1; /* file creation property list */
- hid_t gid = -1; /* group id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did1 = -1, did2 = -1; /* dataset id */
- hsize_t dims1[1] = {10}; /* dataset dimension */
- hsize_t dims2[2] = {4, 6}; /* dataset dimension */
- hsize_t max_dims[2]; /* maximum dataset dimension */
- hsize_t c_dims[2] = {2, 3}; /* chunk dimension */
- int i; /* local index variable */
- int buf[24]; /* data buffer */
+ hid_t fid = -1; /* file id */
+ hid_t fcpl = -1; /* file creation property list */
+ hid_t gid = -1; /* group id */
+ hid_t sid = -1; /* space id */
+ hid_t dcpl = -1; /* dataset creation property id */
+ hid_t did1 = -1, did2 = -1; /* dataset id */
+ hsize_t dims1[1] = {10}; /* dataset dimension */
+ hsize_t dims2[2] = {4, 6}; /* dataset dimension */
+ hsize_t max_dims[2]; /* maximum dataset dimension */
+ hsize_t c_dims[2] = {2, 3}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[24]; /* data buffer */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
goto error;
@@ -115,7 +115,7 @@ gen_non(const char *fname)
if(H5Pset_chunk(dcpl, 2, c_dims) < 0)
goto error;
- /*
+ /*
* Create a chunked dataset with extensible array chunk indexing type (without data)
*/
@@ -135,7 +135,7 @@ gen_non(const char *fname)
if(H5Dclose(did1) < 0)
goto error;
- /*
+ /*
* Create a chunked dataset with version 2 B-tree chunk indexing type (with data)
*/
@@ -226,7 +226,7 @@ gen_non(const char *fname)
if(H5Dclose(did2) < 0)
goto error;
- /*
+ /*
* Create a compact dataset in the group
*/
@@ -251,7 +251,7 @@ gen_non(const char *fname)
if(H5Sclose(sid) < 0)
goto error;
- /*
+ /*
* Create a contiguous dataset with (2d with data) in the file
*/
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
@@ -278,9 +278,9 @@ gen_non(const char *fname)
goto error;
if(H5Gclose(gid) < 0)
- goto error;
+ goto error;
if(H5Pclose(fcpl) < 0)
- goto error;
+ goto error;
if(H5Fclose(fid) < 0)
goto error;
@@ -298,24 +298,24 @@ error:
} /* gen_non() */
/*
- * Function: gen_edge()
+ * Function: gen_edge()
*
* Create a file with write+latest-format--this will result in v3 superblock+latest version support:
- * A dataset: chunked, filtered, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS enabled
- * (i.e. the dataset does not filter partial edge chunks)
+ * A dataset: chunked, filtered, H5D_CHUNK_DONT_FILTER_PARTIAL_CHUNKS enabled
+ * (i.e. the dataset does not filter partial edge chunks)
*/
static void
gen_edge(const char *fname)
{
- hid_t fid = -1; /* file id */
- hid_t fapl = -1; /* file access property list */
- hid_t sid = -1; /* dataspace id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did = -1; /* dataset id */
- hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */
- hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */
- float buf[12][6]; /* Buffer for writing data */
- int i, j; /* local index variable */
+ hid_t fid = -1; /* file id */
+ hid_t fapl = -1; /* file access property list */
+ hid_t sid = -1; /* dataspace id */
+ hid_t dcpl = -1; /* dataset creation property id */
+ hid_t did = -1; /* dataset id */
+ hsize_t dims2[2] = {12, 6}; /* Dataset dimensions */
+ hsize_t c_dims[2] = {5, 5}; /* Chunk dimensions */
+ float buf[12][6]; /* Buffer for writing data */
+ int i, j; /* local index variable */
/* Create a new format file */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -377,37 +377,37 @@ error:
/*
- * Function: gen_err_level()
+ * Function: gen_err_level()
*
* Generate a file to test the situtation described in HDFFV-9434:
- * Exceed the limit of v1-btree level
+ * Exceed the limit of v1-btree level
*
- * Create a file with H5Pset_istore_k(fcpl, 1).
- * Create a chunked dataset with extensible array chunk index and
- * appends many chunks to the dataset.
+ * Create a file with H5Pset_istore_k(fcpl, 1).
+ * Create a chunked dataset with extensible array chunk index and
+ * appends many chunks to the dataset.
*
- * When h5format_convert tries to convert the dataset with
- * extensive array index in the file to v1-btree chunk index,
- * it will insert the dataset chunks to the v1-btree chunk index.
- * The tree will split quickly due to the 'K' value of 1 and the
- * tree level will eventually hit the maximum: 2^8(256).
+ * When h5format_convert tries to convert the dataset with
+ * extensive array index in the file to v1-btree chunk index,
+ * it will insert the dataset chunks to the v1-btree chunk index.
+ * The tree will split quickly due to the 'K' value of 1 and the
+ * tree level will eventually hit the maximum: 2^8(256).
*/
static void
gen_err_level(const char *fname)
{
- hid_t fid = -1; /* file ID */
- hid_t fapl = -1; /* file access property list */
- hid_t fcpl = -1; /* file creation property list */
- hid_t sid = -1; /* dataspace id */
- hid_t dcpl = -1; /* dataset creation property list */
- hid_t did = -1; /* dataset ID */
- hid_t fsid = -1; /* file dataspace ID */
- hid_t msid = -1; /* memory dataspace ID */
- unsigned char *buf = NULL; /* buffer for data */
- hsize_t dims[2] = {0, 1}; /* dataset dimension sizes */
- hsize_t max_dims[2] = {1, H5S_UNLIMITED}; /* dataset maximum dimension sizes */
- hsize_t chunk_dims[2] = {1, 1}; /* chunk dimension sizes */
- int n = 0; /* local index variable */
+ hid_t fid = -1; /* file ID */
+ hid_t fapl = -1; /* file access property list */
+ hid_t fcpl = -1; /* file creation property list */
+ hid_t sid = -1; /* dataspace id */
+ hid_t dcpl = -1; /* dataset creation property list */
+ hid_t did = -1; /* dataset ID */
+ hid_t fsid = -1; /* file dataspace ID */
+ hid_t msid = -1; /* memory dataspace ID */
+ unsigned char *buf = NULL; /* buffer for data */
+ hsize_t dims[2] = {0, 1}; /* dataset dimension sizes */
+ hsize_t max_dims[2] = {1, H5S_UNLIMITED}; /* dataset maximum dimension sizes */
+ hsize_t chunk_dims[2] = {1, 1}; /* chunk dimension sizes */
+ int n = 0; /* local index variable */
/* Create a new format file */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -440,6 +440,8 @@ gen_err_level(const char *fname)
goto error;
/* Closing */
+ if(H5Pclose(fcpl) < 0)
+ goto error;
if(H5Pclose(dcpl) < 0)
goto error;
if(H5Sclose(sid) < 0)
@@ -459,50 +461,51 @@ gen_err_level(const char *fname)
/* Loop through appending 1 element at a time */
for(n = 0; n < NUM; n++) {
- hsize_t start[2] = {0, 0};
- hsize_t count[2] = {1, 1};
- hsize_t extent[2] = {0, 0};
-
- start[0] = 0;
- start[1] = (hsize_t)n;
- extent[0] = 1;
- extent[1] = (hsize_t)(n + 1);
-
- /* Set current dimension sizes for the dataset */
- if(H5Dset_extent(did, extent) < 0)
- goto error;
-
- /* Set up memory dataspace */
- if((msid = H5Screate_simple(2, count, NULL)) < 0)
- goto error;
-
- /* Get file dataspace */
- if((fsid = H5Dget_space(did)) < 0)
- goto error;
-
- if((H5Sselect_hyperslab(fsid, H5S_SELECT_SET, start, NULL, count, NULL)) < 0)
- goto error;
-
- /* Write to the dataset */
- if(H5Dwrite(did, H5T_NATIVE_UCHAR, msid, fsid, H5P_DEFAULT, buf) < 0)
- goto error;
-
- if(H5Sclose(fsid) < 0)
- goto error;
- if(H5Sclose(msid) < 0)
- goto error;
+ hsize_t start[2] = {0, 0};
+ hsize_t count[2] = {1, 1};
+ hsize_t extent[2] = {0, 0};
+
+ start[0] = 0;
+ start[1] = (hsize_t)n;
+ extent[0] = 1;
+ extent[1] = (hsize_t)(n + 1);
+
+ /* Set current dimension sizes for the dataset */
+ if(H5Dset_extent(did, extent) < 0)
+ goto error;
+
+ /* Set up memory dataspace */
+ if((msid = H5Screate_simple(2, count, NULL)) < 0)
+ goto error;
+
+ /* Get file dataspace */
+ if((fsid = H5Dget_space(did)) < 0)
+ goto error;
+
+ if((H5Sselect_hyperslab(fsid, H5S_SELECT_SET, start, NULL, count, NULL)) < 0)
+ goto error;
+
+ /* Write to the dataset */
+ if(H5Dwrite(did, H5T_NATIVE_UCHAR, msid, fsid, H5P_DEFAULT, buf) < 0)
+ goto error;
+
+ if(H5Sclose(fsid) < 0)
+ goto error;
+ if(H5Sclose(msid) < 0)
+ goto error;
}
/* Closing */
if(H5Dclose(did) < 0)
- goto error;
+ goto error;
if(H5Fclose(fid) < 0)
- goto error;
+ goto error;
if(H5Pclose(fapl) < 0)
- goto error;
- if(buf) free(buf);
+ goto error;
error:
+ if(buf)
+ free(buf);
H5E_BEGIN_TRY {
H5Pclose(dcpl);
H5Sclose(sid);
@@ -517,33 +520,33 @@ error:
} /* gen_err_level() */
/*
- * Function: gen_ext()
+ * Function: gen_ext()
*
* Create a file with/without latest format with:
- * 1) 1 contiguous dataset (without data)
- * 2) 2 chunked datasets with extensible array chunk indexing type (with/without data)
- * 3) 2 chunked datasets with version 2 B-tree chunk indexing type (with/without data)
- * 4) 2 chunked datasets with fixed array chunk indexing type (with/without data)
- * 5) 2 chunked datasets with implicit array chunk indexing type (with/without data)
+ * 1) 1 contiguous dataset (without data)
+ * 2) 2 chunked datasets with extensible array chunk indexing type (with/without data)
+ * 3) 2 chunked datasets with version 2 B-tree chunk indexing type (with/without data)
+ * 4) 2 chunked datasets with fixed array chunk indexing type (with/without data)
+ * 5) 2 chunked datasets with implicit array chunk indexing type (with/without data)
* It will create the file with/without messages in the superblock extension depending
* on the parameter "what".
*/
static void
gen_ext(const char *fname, unsigned new_format, unsigned what)
{
- hid_t fid = -1; /* file id */
- hid_t fapl = -1; /* file access property list */
- hid_t fcpl = -1; /* file creation property list */
- hid_t gid = -1; /* group id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did1 = -1, did2 = -1; /* dataset id */
- hsize_t dims1[1] = {10}; /* dataset dimension */
- hsize_t dims2[2] = {4, 6}; /* dataset dimension */
- hsize_t max_dims[2]; /* maximum dataset dimension */
- hsize_t c_dims[2] = {2, 3}; /* chunk dimension */
- int i; /* local index variable */
- int buf[24]; /* data buffer */
+ hid_t fid = -1; /* file id */
+ hid_t fapl = -1; /* file access property list */
+ hid_t fcpl = -1; /* file creation property list */
+ hid_t gid = -1; /* group id */
+ hid_t sid = -1; /* space id */
+ hid_t dcpl = -1; /* dataset creation property id */
+ hid_t did1 = -1, did2 = -1; /* dataset id */
+ hsize_t dims1[1] = {10}; /* dataset dimension */
+ hsize_t dims2[2] = {4, 6}; /* dataset dimension */
+ hsize_t max_dims[2]; /* maximum dataset dimension */
+ hsize_t c_dims[2] = {2, 3}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[24]; /* data buffer */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
goto error;
@@ -559,34 +562,34 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
/* Generate messages that might be placed in superblock extension */
switch(what) {
- case 0:
- H5Pset_istore_k(fcpl, ISTORE_IK);
- break;
- case 1:
- H5Pset_shared_mesg_nindexes(fcpl, 4);
- break;
- case 2:
- H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1);
- break;
- case 3:
- H5Pset_istore_k(fcpl, ISTORE_IK);
- H5Pset_shared_mesg_nindexes(fcpl, 4);
- break;
- case 4:
- H5Pset_istore_k(fcpl, ISTORE_IK);
- H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1);
- break;
- case 5:
- H5Pset_shared_mesg_nindexes(fcpl, 4);
- H5Pset_file_space_page_size(fcpl, (hsize_t)512);
- break;
- case 6:
- H5Pset_istore_k(fcpl, ISTORE_IK);
- H5Pset_shared_mesg_nindexes(fcpl, 4);
- H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_NONE, FALSE, (hsize_t)1);
- break;
- default:
- break;
+ case 0:
+ H5Pset_istore_k(fcpl, ISTORE_IK);
+ break;
+ case 1:
+ H5Pset_shared_mesg_nindexes(fcpl, 4);
+ break;
+ case 2:
+ H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1);
+ break;
+ case 3:
+ H5Pset_istore_k(fcpl, ISTORE_IK);
+ H5Pset_shared_mesg_nindexes(fcpl, 4);
+ break;
+ case 4:
+ H5Pset_istore_k(fcpl, ISTORE_IK);
+ H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1);
+ break;
+ case 5:
+ H5Pset_shared_mesg_nindexes(fcpl, 4);
+ H5Pset_file_space_page_size(fcpl, (hsize_t)512);
+ break;
+ case 6:
+ H5Pset_istore_k(fcpl, ISTORE_IK);
+ H5Pset_shared_mesg_nindexes(fcpl, 4);
+ H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_NONE, FALSE, (hsize_t)1);
+ break;
+ default:
+ break;
}
/* Create the file */
@@ -604,8 +607,8 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
goto error;
- /*
- * Create a contiguous dataset
+ /*
+ * Create a contiguous dataset
*/
/* Create dataspace */
@@ -622,8 +625,8 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
if(H5Dclose(did1) < 0)
goto error;
- /*
- * Create 2 chunked datasets with extensible array chunk indexing type
+ /*
+ * Create 2 chunked datasets with extensible array chunk indexing type
* (one with data; one without data)
*/
@@ -657,8 +660,8 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
goto error;
- /*
- * Create 2 chunked datasets with version 2 B-tree chunk indexing type
+ /*
+ * Create 2 chunked datasets with version 2 B-tree chunk indexing type
* (one with data; one without data)
*/
@@ -689,7 +692,7 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
goto error;
/*
- * Create 2 chunked datasets with fixed array chunk indexing type
+ * Create 2 chunked datasets with fixed array chunk indexing type
* (one with data; one without data)
*/
@@ -719,8 +722,8 @@ gen_ext(const char *fname, unsigned new_format, unsigned what)
goto error;
- /*
- * Create 2 chunked datasets with implicit chunk indexing type
+ /*
+ * Create 2 chunked datasets with implicit chunk indexing type
* (one with data; one without data)
*/
diff --git a/tools/test/h5format_convert/testfiles/h5fc_d_file-d.ddl b/tools/test/h5format_convert/testfiles/h5fc_d_file-d.ddl
new file mode 100644
index 0000000..bc0229c
--- /dev/null
+++ b/tools/test/h5format_convert/testfiles/h5fc_d_file-d.ddl
@@ -0,0 +1,25 @@
+usage: h5format_convert [OPTIONS] file_name
+ OPTIONS
+ -h, --help Print a usage message and exit
+ -V, --version Print version number and exit
+ -v, --verbose Turn on verbose mode
+ -d dname, --dname=dataset_name Pathname for the dataset
+ -n, --noop Perform all the steps except the actual conversion
+
+Examples of use:
+
+h5format_convert -d /group/dataset file_name
+ Convert the dataset </group/dataset> in the HDF5 file <file_name>:
+ a. chunked dataset: convert the chunk indexing type to version 1 B-tree
+ b. compact/contiguous dataset: downgrade the layout version to 3
+ c. virtual dataset: no action
+
+h5format_convert file_name
+ Convert all datasets in the HDF5 file <file_name>:
+ a. chunked dataset: convert the chunk indexing type to version 1 B-tree
+ b. compact/contiguous dataset: downgrade the layout version to 3
+ c. virtual dataset: no action
+
+h5format_convert -n -d /group/dataset file_name
+ Go through all the steps except the actual conversion when
+ converting the dataset </group/dataset> in the HDF5 file <file_name>.
diff --git a/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl b/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl
index 38fc432..bc0229c 100644
--- a/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl
+++ b/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl
@@ -23,4 +23,3 @@ h5format_convert file_name
h5format_convert -n -d /group/dataset file_name
Go through all the steps except the actual conversion when
converting the dataset </group/dataset> in the HDF5 file <file_name>.
-h5format_convert error: missing file name
diff --git a/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl.err b/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl.err
new file mode 100644
index 0000000..ceb0fe4
--- /dev/null
+++ b/tools/test/h5format_convert/testfiles/h5fc_d_file.ddl.err
@@ -0,0 +1 @@
+h5format_convert error: missing file name
diff --git a/tools/test/h5format_convert/testfiles/h5fc_dname.ddl b/tools/test/h5format_convert/testfiles/h5fc_dname.ddl
index 48564b7..bc0229c 100644
--- a/tools/test/h5format_convert/testfiles/h5fc_dname.ddl
+++ b/tools/test/h5format_convert/testfiles/h5fc_dname.ddl
@@ -23,4 +23,3 @@ h5format_convert file_name
h5format_convert -n -d /group/dataset file_name
Go through all the steps except the actual conversion when
converting the dataset </group/dataset> in the HDF5 file <file_name>.
-h5format_convert error: No dataset name
diff --git a/tools/test/h5format_convert/testfiles/h5fc_dname.err b/tools/test/h5format_convert/testfiles/h5fc_dname.err
new file mode 100644
index 0000000..361d8a9
--- /dev/null
+++ b/tools/test/h5format_convert/testfiles/h5fc_dname.err
@@ -0,0 +1 @@
+h5format_convert error: No dataset name
diff --git a/tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl b/tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl.err
index 39450c0..39450c0 100644
--- a/tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl
+++ b/tools/test/h5format_convert/testfiles/h5fc_nonexistdset_file.ddl.err
diff --git a/tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl b/tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl.err
index 706ea9d..706ea9d 100644
--- a/tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl
+++ b/tools/test/h5format_convert/testfiles/h5fc_nonexistfile.ddl.err
diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in
index 585d389..2cdd445 100644
--- a/tools/test/h5format_convert/testh5fc.sh.in
+++ b/tools/test/h5format_convert/testh5fc.sh.in
@@ -103,13 +103,18 @@ $SRC_H5FORMCONV_TESTFILES/old_h5fc_ext3_isf.h5
$SRC_H5FORMCONV_TESTFILES/h5fc_err_level.h5
"
+LIST_ERR_TEST_FILES="
+$SRC_H5FORMCONV_TESTFILES/h5fc_d_file.ddl.err
+$SRC_H5FORMCONV_TESTFILES/h5fc_dname.err
+$SRC_H5FORMCONV_TESTFILES/h5fc_nonexistfile.ddl.err
+$SRC_H5FORMCONV_TESTFILES/h5fc_nonexistdset_file.ddl.err
+"
+
LIST_OTHER_TEST_FILES="
$SRC_H5FORMCONV_TESTFILES/h5fc_help.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_nooption.ddl
-$SRC_H5FORMCONV_TESTFILES/h5fc_nonexistfile.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_d_file.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_dname.ddl
-$SRC_H5FORMCONV_TESTFILES/h5fc_nonexistdset_file.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_v_non_chunked.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_v_bt1.ddl
$SRC_H5FORMCONV_TESTFILES/h5fc_v_ndata_bt1.ddl
@@ -137,7 +142,7 @@ $SRC_H5FORMCONV_TESTFILES/h5fc_v_err.ddl.err
#
# copy test files and expected output files from source dirs to test dir
#
-COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES"
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_ERR_TEST_FILES $LIST_OTHER_TEST_FILES"
COPY_TESTFILES_TO_TESTDIR()
{
@@ -193,6 +198,9 @@ TESTING() {
echo "Testing $* $SPACES" | cut -c1-80 | tr -d '\012'
}
+# Source in the output filter function definitions.
+. $srcdir/../../../bin/output_filter.sh
+
# Run a test and print PASS or *FAIL*. If a test fails then increment
# the `nerrors' global variable and (if $verbose is set) display the
# difference between the actual output and the expected output. The
@@ -212,8 +220,9 @@ TESTING() {
TOOLTEST_OUT() {
# Prepare expected and actual output
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .ddl`.err"
actual="$TESTDIR/`basename $1 .ddl`.out"
- actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_err="$TESTDIR/`basename $1 .ddl`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
@@ -233,7 +242,6 @@ TOOLTEST_OUT() {
) >$actual 2>$actual_err
cp $actual $actual_sav
cp $actual_err $actual_err_sav
- cat $actual_err >> $actual
# Compare output
COMPARE_OUT $expect $actual
@@ -251,7 +259,7 @@ TOOLTEST_MASK_OUT() {
expect_err="$TESTDIR/$1.err"
actual_ext="$TESTDIR/$1.ext"
actual="$TESTDIR/`basename $1 .ddl`.out"
- actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_err="$TESTDIR/`basename $1 .ddl`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
@@ -305,6 +313,42 @@ TOOLTEST_MASK_OUT() {
$RM $actual $actual_err $actual_sav $actual_err_sav
fi
}
+# Same as TOOLTEST_OUT except only compares error outout
+TOOLTEST_ERR() {
+ # Prepare expected and actual output
+ expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/$1.err"
+ actual="$TESTDIR/`basename $1 .ddl`.out"
+ actual_err="$TESTDIR/`basename $1 .ddl`.out.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+
+ # Prepare the test file
+ $RM $TESTDIR/$TMPOUTFILE
+ TFILE=$2
+ if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then
+ $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE
+ TFILE=$TMPOUTFILE
+ fi
+
+ # Run test.
+ TESTING $FORMCONV $3 $4 $5 $6 $2
+ (
+ cd $TESTDIR
+ $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $6 $TFILE
+ ) >$actual 2>$actual_err
+ cp $actual $actual_sav
+ cp $actual_err $actual_err_sav
+
+ # Compare output
+ COMPARE_OUT $expect_err $actual_err
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ $RM $actual $actual_err
+ $RM $actual $actual_err $actual_sav $actual_err_sav
+ fi
+}
# To check that the tool exits success, no output
# Assume all short options
@@ -406,7 +450,7 @@ COPY_TESTFILES_TO_TESTDIR
# h5format_convert nonexist.h5 (no options, file does not exist)
TOOLTEST_OUT h5fc_help.ddl '' --help
TOOLTEST_OUT h5fc_nooption.ddl ''
-TOOLTEST_OUT h5fc_nonexistfile.ddl nonexist.h5
+TOOLTEST_ERR h5fc_nonexistfile.ddl nonexist.h5
#
#
# h5format_convert -d old_h5fc_ext_none.h5 (just -d option, file exists)
@@ -416,7 +460,7 @@ TOOLTEST_OUT h5fc_nonexistfile.ddl nonexist.h5
TOOLTEST_OUT h5fc_d_file.ddl old_h5fc_ext_none.h5 -d
TOOLTEST_OUT h5fc_d_file.ddl old_h5fc_ext_none.h5 --dname
TOOLTEST_OUT h5fc_dname.ddl '' --dname
-TOOLTEST_OUT h5fc_nonexistdset_file.ddl old_h5fc_ext_none.h5 --dname=nonexist
+TOOLTEST_ERR h5fc_nonexistdset_file.ddl old_h5fc_ext_none.h5 --dname=nonexist
#
#
#
diff --git a/tools/test/h5import/CMakeLists.txt b/tools/test/h5import/CMakeLists.txt
index 500be58..9364683 100644
--- a/tools/test/h5import/CMakeLists.txt
+++ b/tools/test/h5import/CMakeLists.txt
@@ -5,9 +5,14 @@ project (HDF5_TOOLS_TEST_H5IMPORT C)
# Add the h5import executables
# --------------------------------------------------------------------
add_executable (h5importtest ${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/h5importtest.c)
-target_include_directories(h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5importtest STATIC)
-target_link_libraries (h5importtest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5importtest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5importtest STATIC)
+ target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5importtest SHARED)
+ target_link_libraries (h5importtest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5importtest PROPERTIES FOLDER tools)
include (CMakeTests.cmake)
diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake
index 7d76fba..22ab848 100644
--- a/tools/test/h5import/CMakeTests.cmake
+++ b/tools/test/h5import/CMakeTests.cmake
@@ -95,34 +95,39 @@
### T H E T E S T S M A C R O S ###
##############################################################################
##############################################################################
+
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
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 H5IMPORT-h5importtest)
- endif ()
+ add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile})
+ set_tests_properties (H5IMPORT-${testname} PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
+ )
else ()
add_test (
NAME H5IMPORT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${testfile}
- ${testfile}.new
- ${testfile}.new.err
- ${testfile}.out
- ${testfile}.out.err
- ${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove ${testfile}
+ )
+ set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
)
- set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
- 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} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.new"
@@ -131,11 +136,14 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname})
+ 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testfile}.out"
@@ -144,7 +152,9 @@
-D "TEST_REFERENCE=${testfile}.new"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP)
+ set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES
+ DEPENDS H5IMPORT-${testname}-H5DMP
+ )
endif ()
endmacro ()
@@ -153,24 +163,20 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5IMPORT-DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
d${testfile}
d${testfile}.bin
- d${testfile}.dmp
- d${testfile}.dmp.err
- d${testfile}.imp
- d${testfile}.imp.err
- d${testfile}.dff
- d${testfile}.dff.err
)
- set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
+ set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES
+ DEPENDS H5IMPORT-${testname}-H5DMP_CMP
+ )
if ("${ARGN}" STREQUAL "BINARY")
add_test (
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dmp"
@@ -182,7 +188,8 @@
add_test (
NAME H5IMPORT-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-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"
@@ -191,12 +198,15 @@
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
- set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects")
+ 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
-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"
@@ -204,12 +214,15 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP")
+ 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>"
-D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d${testfile}.dff"
@@ -218,7 +231,9 @@
-D "TEST_REFERENCE=testfiles/d${testfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}")
+ set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES
+ DEPENDS "H5IMPORT-DUMP-${testname}"
+ )
endif ()
endmacro ()
@@ -227,23 +242,19 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- d-${testname}.dmp
- d-${testname}.dmp.err
+ COMMAND ${CMAKE_COMMAND} -E remove
d-${testname}.h5
- ${testname}.dmp
- ${testname}.dmp.err
- ${testname}.imp
- ${testname}.imp.err
${testname}.bin
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest)
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED set_h5importtest
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.dmp"
@@ -251,12 +262,15 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects"
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5import>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>"
-D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.imp"
@@ -264,11 +278,14 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP"
+ )
add_test (
NAME H5IMPORT_SUB-DUMP-${testname}-CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-p;d-${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=d-${testname}.dmp"
@@ -276,7 +293,9 @@
-D "TEST_REFERENCE=testfiles/${testname}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP")
+ set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES
+ DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP"
+ )
endif ()
endmacro ()
@@ -307,8 +326,7 @@
# Remove any output file left over from previous test run
add_test (
NAME H5IMPORT-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
binfp64.bin
binin8.bin
binin8w.bin
@@ -317,164 +335,40 @@
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
- tall_fp32.dmp
- tall_fp32.dmp.err
tall_fp32.bin
- tall_fp32.imp
- tall_fp32.imp.err
- d-tall_fp32.dmp
- d-tall_fp32.dmp.err
d-tall_fp32.h5
- tall_i32.dmp
- tall_i32.dmp.err
tall_i32.bin
- tall_i32.imp
- tall_i32.imp.err
- d-tall_i32.dmp
- d-tall_i32.dmp.err
d-tall_i32.h5
)
set (last_test "H5IMPORT-clear-objects")
@@ -482,8 +376,7 @@
add_test (
NAME H5IMPORT-h5importtest-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
binfp64.bin
binfp64.conf
binin8.bin
@@ -499,13 +392,12 @@
binuin32.bin
binuin32.conf
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5IMPORT-clear-objects")
- add_test (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>)
- set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects)
+ add_test (NAME H5IMPORT-h5importtest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5importtest>)
+ set_tests_properties (H5IMPORT-h5importtest PROPERTIES
+ FIXTURES_SETUP set_h5importtest
+ DEPENDS H5IMPORT-h5importtest-clear-objects
+ )
# ----- TESTING "ASCII I32 rank 3 - Output BE " ;
ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5)
diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c
index bbb67b6..560f1b3 100644
--- a/tools/test/h5import/h5importtest.c
+++ b/tools/test/h5import/h5importtest.c
@@ -183,8 +183,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10u", b8i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10u", b8i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -200,8 +200,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10u", b16i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10u", b16i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -217,8 +217,8 @@ main(void)
for (i = 0; i < nrow; i++)
{
for (j = 0; j < ncol; j++)
- (void) fprintf(sp, "%10d", b32i3[k][i][j]);
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "%10d", b32i3[k][i][j]);
+ (void) HDfprintf(sp, "\n");
}
}
(void) HDfclose(sp);
@@ -243,16 +243,16 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin32.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/32-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 32\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/32-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 32\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -274,15 +274,15 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binuin32.conf", "w");
- (void) fprintf(sp, "PATH /int/buin/32-bit\n");
- (void) fprintf(sp, "INPUT-CLASS UIN\n");
- (void) fprintf(sp, "INPUT-SIZE 32\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/buin/32-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS UIN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 32\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -304,17 +304,17 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin16.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/16-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 16\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/16-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -335,17 +335,17 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binuin16.conf", "w");
- (void) fprintf(sp, "PATH /int/buin/16-bit\n");
- (void) fprintf(sp, "INPUT-CLASS UIN\n");
- (void) fprintf(sp, "INPUT-SIZE 16\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/buin/16-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS UIN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -367,20 +367,20 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binin8.conf", "w");
- (void) fprintf(sp, "PATH /int/bin/8-bit\n");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 8\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-CLASS IN\n");
- (void) fprintf(sp, "OUTPUT-SIZE 16\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
- (void) fprintf(sp, "COMPRESSION-PARAM 3\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /int/bin/8-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "OUTPUT-SIZE 16\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n");
+ (void) HDfprintf(sp, "COMPRESSION-PARAM 3\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
#endif /* UNICOS */
@@ -408,18 +408,18 @@ main(void)
(void) HDfclose(sp);
sp = HDfopen("binfp64.conf", "w");
- (void) fprintf(sp, "PATH /fp/bin/64-bit\n");
- (void) fprintf(sp, "INPUT-CLASS FP\n");
- (void) fprintf(sp, "INPUT-SIZE 64\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 3\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n");
- (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
- (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
- (void) fprintf(sp, "COMPRESSION-PARAM 8\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "PATH /fp/bin/64-bit\n");
+ (void) HDfprintf(sp, "INPUT-CLASS FP\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 64\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 3\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n");
+ (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n");
+ (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n");
+ (void) HDfprintf(sp, "COMPRESSION-PARAM 8\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
/*-------------------------------------------------------------------------
@@ -436,21 +436,21 @@ main(void)
{
char c = bin8w[i];
if ( HDfwrite( &c, sizeof(char), 1, sp) != 1 )
- printf("error writing file\n");
+ HDprintf("error writing file\n");
}
HDfclose(sp);
sp = HDfopen("binin8w.conf", "w");
- (void) fprintf(sp, "INPUT-CLASS IN\n");
- (void) fprintf(sp, "INPUT-SIZE 8\n");
- (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
- (void) fprintf(sp, "RANK 1\n");
- (void) fprintf(sp, "OUTPUT-CLASS IN\n");
- (void) fprintf(sp, "OUTPUT-SIZE 8\n");
- (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
- (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
- (void) fprintf(sp, "DIMENSION-SIZES 4\n");
- (void) fprintf(sp, "\n");
+ (void) HDfprintf(sp, "INPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "INPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order);
+ (void) HDfprintf(sp, "RANK 1\n");
+ (void) HDfprintf(sp, "OUTPUT-CLASS IN\n");
+ (void) HDfprintf(sp, "OUTPUT-SIZE 8\n");
+ (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n");
+ (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n");
+ (void) HDfprintf(sp, "DIMENSION-SIZES 4\n");
+ (void) HDfprintf(sp, "\n");
(void) HDfclose(sp);
}
diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt
index cc70adc..6fdf7b0 100644
--- a/tools/test/h5jam/CMakeLists.txt
+++ b/tools/test/h5jam/CMakeLists.txt
@@ -4,26 +4,36 @@ project (HDF5_TOOLS_TEST_H5JAM C)
# --------------------------------------------------------------------
# Add the h5jam test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5jamgentest ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/h5jamgentest.c)
- target_include_directories(h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5jamgentest PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5jamgentest STATIC)
target_link_libraries (h5jamgentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>)
+ #add_test (NAME h5jamgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jamgentest>)
endif ()
add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c)
-target_include_directories(getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (getub STATIC)
-target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (getub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (getub STATIC)
+ target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (getub SHARED)
+ target_link_libraries (getub PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (getub PROPERTIES FOLDER tools)
add_executable (tellub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/tellub.c)
-target_include_directories(tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (tellub STATIC)
-target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (tellub PRIVATE "${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (tellub STATIC)
+ target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (tellub SHARED)
+ target_link_libraries (tellub PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (tellub PROPERTIES FOLDER tools)
include (CMakeTests.cmake)
diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake
index 66ff715..f108afc 100644
--- a/tools/test/h5jam/CMakeTests.cmake
+++ b/tools/test/h5jam/CMakeTests.cmake
@@ -47,6 +47,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# ============================================================
# TEST_H5JAM_OUTPUT
# For the purpose to verify only output & exitcode from h5jam
@@ -54,30 +60,25 @@
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")
+ add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
-D "TEST_EXPECT=${resultcode}"
+ -D "TEST_ERRREF=testfiles/${expectfile}.txt"
+ -D "TEST_SKIP_COMPARE=1"
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects")
endif ()
endmacro ()
@@ -88,22 +89,16 @@
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")
+ add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true")
endif ()
else ()
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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${expectfile}.out"
@@ -111,7 +106,6 @@
-D "TEST_REFERENCE=testfiles/${expectfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS "H5JAM-UNJAM-${expectfile}-clear-objects")
endif ()
endmacro ()
@@ -119,19 +113,10 @@
# 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=testfiles/${expected}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.new"
@@ -140,11 +125,12 @@
-D "TEST_SKIP_COMPARE=TRUE"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects)
+ set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends})
add_test (
NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=${actual}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${actual}.out"
@@ -179,7 +165,7 @@
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})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -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 ()
@@ -187,7 +173,8 @@
add_test (
NAME H5JAM-${testname}-UNJAM
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>"
-D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${outfile}.ufile.txt"
@@ -198,16 +185,15 @@
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "${outfile}.ufile.txt")
else ()
- add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam> -i ${infile} -o ${outfile})
+ add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile})
set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects)
set (compare_test "")
endif ()
endif ()
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${infile}.len.txt
${infile}.cmp
${infile}-ub.cmp
@@ -216,6 +202,7 @@
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
@@ -232,6 +219,7 @@
add_test (
NAME H5JAM-${testname}-UNJAM-CHECK_NOUB
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=NO"
@@ -242,7 +230,7 @@
-D "TEST_OFILE=NULL"
-P "${HDF_RESOURCES_DIR}/userblockTest.cmake"
)
- if (NOT "${compare_test}" STREQUAL "")
+ if (${compare_test})
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-CHECK_UB_1)
else ()
set_tests_properties (H5JAM-${testname}-UNJAM-CHECK_NOUB PROPERTIES DEPENDS H5JAM-${testname}-UNJAM)
@@ -259,7 +247,7 @@
COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5
)
endif ()
- add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN})
+ add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -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})
@@ -270,8 +258,7 @@
add_test (
NAME H5JAM-${testname}-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${compare_test}.len.txt
${compare_test}.cmp
${compare_test}-ub.cmp
@@ -280,6 +267,7 @@
add_test (
NAME H5JAM-${testname}-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
@@ -314,7 +302,7 @@
)
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})
+ add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN})
set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY)
set (compare_test ${chkfile})
@@ -325,8 +313,7 @@
add_test (
NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
${compare_test}.len.txt
${compare_test}.cmp
${compare_test}-ub.cmp
@@ -335,6 +322,7 @@
add_test (
NAME H5JAM-${testname}_NONE-CHECK_UB_1
COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:tellub>"
-D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>"
-D "TEST_CHECKUB=YES"
diff --git a/tools/test/h5jam/getub.c b/tools/test/h5jam/getub.c
index 7cfde36..26a427d 100644
--- a/tools/test/h5jam/getub.c
+++ b/tools/test/h5jam/getub.c
@@ -148,7 +148,7 @@ main(int argc, const char *argv[])
error:
if(buf)
HDfree(buf);
- if(fd > -1)
+ if(fd >= 0)
HDclose(fd);
return EXIT_FAILURE;
} /* end main() */
diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c
index 1644440..56b4ead 100644
--- a/tools/test/h5jam/h5jamgentest.c
+++ b/tools/test/h5jam/h5jamgentest.c
@@ -172,7 +172,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 10;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "abcdefghi");
+ HDsprintf(buf, "abcdefghi");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -203,7 +203,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "1st attribute of dset1.1.1");
+ HDsprintf(buf, "1st attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
@@ -211,7 +211,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill)
dims[0] = 27;
space = H5Screate_simple(1, dims, NULL);
attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT);
- sprintf(buf, "2nd attribute of dset1.1.1");
+ HDsprintf(buf, "2nd attribute of dset1.1.1");
H5Awrite(attr, H5T_NATIVE_SCHAR, buf);
H5Sclose(space);
H5Aclose(attr);
diff --git a/tools/test/h5jam/tellub.c b/tools/test/h5jam/tellub.c
index 667f2d9..559c677 100644
--- a/tools/test/h5jam/tellub.c
+++ b/tools/test/h5jam/tellub.c
@@ -53,7 +53,7 @@ usage (const char *prog)
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
- * Purpose: Parse the command line for the h5dumper.
+ * Purpose: Parse the command line.
*
* Return: Success: void
* Failure: Exits program with EXIT_FAILURE value.
@@ -89,7 +89,7 @@ parse_command_line (int argc, const char *argv[])
/*-------------------------------------------------------------------------
* Function: main
*
- * Purpose: HDF5 user block unjammer
+ * Purpose: HDF5 user block tell size
*
* Return: EXIT_SUCCESS/EXIT_FAILURE
*-------------------------------------------------------------------------
@@ -104,7 +104,7 @@ main (int argc, const char *argv[])
hsize_t usize;
htri_t testval;
herr_t status;
- hid_t plist = -1;
+ hid_t plist = H5I_INVALID_HID;
h5tools_setprogname(PROGRAMNAME);
h5tools_setstatus(EXIT_SUCCESS);
@@ -126,7 +126,7 @@ main (int argc, const char *argv[])
ifname = HDstrdup(argv[opt_ind]);
- testval = H5Fis_hdf5(ifname);
+ testval = H5Fis_accessible(ifname, H5P_DEFAULT);
if(testval <= 0) {
error_msg("Input HDF5 file is not HDF \"%s\"\n", ifname);
diff --git a/tools/test/h5ls/CMakeLists.txt b/tools/test/h5ls/CMakeLists.txt
index 5b8cbe0..0da03c5 100644
--- a/tools/test/h5ls/CMakeLists.txt
+++ b/tools/test/h5ls/CMakeLists.txt
@@ -4,29 +4,31 @@ project (HDF5_TOOLS_TEST_H5LS C)
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
-set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibls")
-set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
-set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
+if (BUILD_SHARED_LIBS)
+ set (H5LS_TOOL_PLUGIN_LIB_CORENAME "dynlibls")
+ set (H5LS_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5LS_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5LS_TOOL_PLUGIN_LIB_TARGET ${H5LS_TOOL_PLUGIN_LIB_CORENAME})
-add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
-target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
-target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_ls.c)
+ target_include_directories (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5LS_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5LS_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5LS_TOOL_PLUGIN_LIB_TARGET} ${H5LS_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
-# make plugins dir
-file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
-#-----------------------------------------------------------------------------
-# Copy plugin library to a plugins folder
-#-----------------------------------------------------------------------------
-add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
-)
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${H5LS_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${H5LS_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5LS_TOOL_PLUGIN_LIB_TARGET}>"
+ )
+endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake
index d03a344..2f3f3ab 100644
--- a/tools/test/h5ls/CMakeTests.cmake
+++ b/tools/test/h5ls/CMakeTests.cmake
@@ -47,6 +47,12 @@
${HDF5_TOOLS_DIR}/testfiles/tdset_idx.h5
)
+ set (LIST_ERR_TEST_FILES
+ ${HDF5_TOOLS_DIR}/test/h5ls/errfiles/nosuchfile.err
+ ${HDF5_TOOLS_DIR}/test/h5ls/errfiles/textlinksrc-nodangle-1.err
+ ${HDF5_TOOLS_DIR}/test/h5ls/errfiles/tgroup-1.err
+ )
+
set (LIST_OTHER_TEST_FILES
${HDF5_TOOLS_DIR}/testfiles/help-1.ls
${HDF5_TOOLS_DIR}/testfiles/help-2.ls
@@ -116,6 +122,10 @@
get_filename_component(fname "${listfiles}" NAME)
HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files")
endforeach ()
+ foreach (listfiles ${LIST_ERR_TEST_FILES})
+ get_filename_component(fname "${listfiles}" NAME)
+ HDFTEST_COPY_FILE("${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${fname}" "h5ls_files")
+ endforeach ()
add_custom_target(h5ls_files ALL COMMENT "Copying files needed by h5ls tests" DEPENDS ${h5ls_files_list})
##############################################################################
@@ -124,55 +134,69 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
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})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
# Remove any output file left over from previous test run
add_test (
- NAME H5LS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
+ NAME H5LS-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
+ -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 "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_ERR_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls> ${ARGN})
+ set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
+ if (${resultcode} EQUAL 1)
+ set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
+ endif ()
+ else ()
add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-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"
+ -D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${resultfile}.out
- testfiles/${resultfile}.out.err
- )
add_test (
NAME H5LS_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -180,9 +204,9 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clear-objects)
endif ()
endmacro ()
@@ -192,128 +216,6 @@
##############################################################################
##############################################################################
- 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
- tgrpnullspace.out
- tgrpnullspace.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
- )
- set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5LS-clearall-objects")
- endif ()
-
# 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.
@@ -341,7 +243,7 @@
# 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_ERR_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
@@ -382,7 +284,7 @@
# 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)
+ ADD_H5_ERR_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
@@ -444,7 +346,7 @@
endif ()
# test for non-existing file
- ADD_H5_TEST (nosuchfile 1 nosuchfile.h5)
+ ADD_H5_ERR_TEST (nosuchfile 1 nosuchfile.h5)
# test for variable length data types in verbose mode
if (H5_WORDS_BIGENDIAN)
@@ -470,4 +372,6 @@
##############################################################################
### P L U G I N T E S T S
##############################################################################
-ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5)
+if (BUILD_SHARED_LIBS)
+ ADD_H5_UD_TEST (h5ls_plugin_test 0 tudfilter -w80 -d tudfilter.h5)
+endif ()
diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake
index 2b6f61e..cf5b6d7 100644
--- a/tools/test/h5ls/CMakeTestsVDS.cmake
+++ b/tools/test/h5ls/CMakeTestsVDS.cmake
@@ -80,30 +80,26 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_H5_VDS_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})
+ add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
- NAME H5LS-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- add_test (
NAME H5LS-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -111,37 +107,26 @@
-D "TEST_REFERENCE=${resultfile}.ls"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects)
endif ()
endmacro ()
macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN})
+ add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN})
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES
ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}"
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- if ("${resultcode}" STREQUAL "1")
+ if (${resultcode} EQUAL 1)
set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
- NAME H5LS_PREFIX-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
- )
- set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix")
- add_test (
NAME H5LS_PREFIX-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=vds/prefix/${resultfile}.out"
@@ -151,7 +136,6 @@
-D "TEST_ENV_VALUE=\${ORIGIN}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -161,44 +145,6 @@
##############################################################################
##############################################################################
- if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5LS_VDS-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- tvds-1.out
- tvds-1.out.err
- tvds-2.out
- tvds-2.out.err
- tvds-3_1.out
- tvds-3_1.out.err
- tvds-3_2.out
- tvds-3_2.out.err
- tvds-4.out
- tvds-4.out.err
- tvds-5.out
- tvds-5.out.err
- tvds_layout-1.out
- tvds_layout-1.out.err
- tvds_layout-2.out
- tvds_layout-2.out.err
- tvds_layout-3_1.out
- tvds_layout-3_1.out.err
- tvds_layout-3_2.out
- tvds_layout-3_2.out.err
- tvds_layout-4.out
- tvds_layout-4.out.err
- tvds_layout-5.out
- tvds_layout-5.out.err
- )
- set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5LS_VDS-clearall-objects")
- endif ()
-
ADD_H5_VDS_TEST (tvds-1 0 -w80 -v -S 1_vds.h5)
ADD_H5_VDS_TEST (tvds-2 0 -w80 -v -S 2_vds.h5)
ADD_H5_VDS_TEST (tvds-3_1 0 -w80 -v -S 3_1_vds.h5)
diff --git a/tools/test/h5ls/errfiles/nosuchfile.err b/tools/test/h5ls/errfiles/nosuchfile.err
new file mode 100644
index 0000000..8c4ee42
--- /dev/null
+++ b/tools/test/h5ls/errfiles/nosuchfile.err
@@ -0,0 +1 @@
+nosuchfile.h5: unable to open file
diff --git a/tools/test/h5ls/errfiles/textlinksrc-nodangle-1.err b/tools/test/h5ls/errfiles/textlinksrc-nodangle-1.err
new file mode 100644
index 0000000..8991fc1
--- /dev/null
+++ b/tools/test/h5ls/errfiles/textlinksrc-nodangle-1.err
@@ -0,0 +1,2 @@
+Error: --no-dangling-links must be used along with --follow-symlinks option!
+
diff --git a/tools/test/h5ls/errfiles/tgroup-1.err b/tools/test/h5ls/errfiles/tgroup-1.err
new file mode 100644
index 0000000..ba4cf07
--- /dev/null
+++ b/tools/test/h5ls/errfiles/tgroup-1.err
@@ -0,0 +1,2 @@
+Error: 'recursive' option not compatible with 'group info' option!
+
diff --git a/tools/test/h5ls/testh5ls.sh.in b/tools/test/h5ls/testh5ls.sh.in
index 8c6551b..353f1bb 100644
--- a/tools/test/h5ls/testh5ls.sh.in
+++ b/tools/test/h5ls/testh5ls.sh.in
@@ -53,6 +53,7 @@ SRC_H5REPACK_TESTFILES="$SRC_TOOLS/test/h5repack/testfiles"
SRC_H5JAM_TESTFILES="$SRC_TOOLS/test/h5jam/testfiles"
SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
+SRC_H5LS_ERRFILES="$SRC_TOOLS/test/h5ls/errfiles"
TESTDIR=./testfiles
test -d $TESTDIR || mkdir $TESTDIR
@@ -93,6 +94,12 @@ $SRC_H5LS_TESTFILES/tvldtypes1.h5
$SRC_H5LS_TESTFILES/tdset_idx.h5
"
+LIST_ERROR_TEST_FILES="
+$SRC_H5LS_ERRFILES/nosuchfile.err
+$SRC_H5LS_ERRFILES/textlinksrc-nodangle-1.err
+$SRC_H5LS_ERRFILES/tgroup-1.err
+"
+
LIST_OTHER_TEST_FILES="
$SRC_H5LS_TESTFILES/help-1.ls
$SRC_H5LS_TESTFILES/help-2.ls
@@ -228,8 +235,9 @@ TESTING() {
# $2 and on -- argument for the h5ls tool
TOOLTEST() {
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .ls`.err"
actual="$TESTDIR/`basename $1 .ls`.out"
- actual_err="$TESTDIR/`basename $1 .ls`.err"
+ actual_err="$TESTDIR/`basename $1 .ls`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -251,7 +259,6 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
if [ $h5haveexitcode = 'yes' -a $exitcode -ne $retvalexpect ]; then
echo "*FAILED*"
nerrors="`expr $nerrors + 1`"
diff --git a/tools/test/h5repack/CMakeLists.txt b/tools/test/h5repack/CMakeLists.txt
index 2a168e9..f81ce4f 100644
--- a/tools/test/h5repack/CMakeLists.txt
+++ b/tools/test/h5repack/CMakeLists.txt
@@ -2,14 +2,19 @@ cmake_minimum_required (VERSION 3.10)
project (HDF5_TOOLS_TEST_H5REPACK C)
# --------------------------------------------------------------------
-# Add h5Repack test executables
+# Add h5repack test executables
# --------------------------------------------------------------------
add_executable (testh5repack_detect_szip ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testh5repack_detect_szip.c)
-target_include_directories(testh5repack_detect_szip
+target_include_directories (testh5repack_detect_szip
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC)
-target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (testh5repack_detect_szip STATIC)
+ target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (testh5repack_detect_szip SHARED)
+ target_link_libraries (testh5repack_detect_szip PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
set_target_properties (testh5repack_detect_szip PROPERTIES FOLDER tools)
set (REPACK_COMMON_SOURCES
@@ -22,55 +27,75 @@ set (REPACK_COMMON_SOURCES
${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR}/h5repack.c
)
add_executable (h5repacktest ${REPACK_COMMON_SOURCES} ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repacktst.c)
-target_include_directories(h5repacktest
+target_include_directories (h5repacktest
PRIVATE "${HDF5_TOOLS_SRC_H5REPACK_SOURCE_DIR};${HDF5_TOOLS_DIR}/lib;${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
)
-TARGET_C_PROPERTIES (h5repacktest STATIC)
-target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repacktest STATIC)
+ target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5repacktest SHARED)
+ target_link_libraries (h5repacktest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+endif ()
set_target_properties (h5repacktest PROPERTIES FOLDER tools)
#-----------------------------------------------------------------------------
# If plugin library tests can be tested
#-----------------------------------------------------------------------------
-set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
-set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
-set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
-set (HDF5_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers")
-set (HDF5_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_VCORENAME}")
-set (HDF5_TOOL_PLUGIN_LIB_VTARGET ${HDF5_TOOL_PLUGIN_LIB_VCORENAME})
+if (BUILD_SHARED_LIBS)
+ set (H5REPACK_TOOL_PLUGIN_LIB_CORENAME "dynlibadd")
+ set (H5REPACK_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5REPACK_TOOL_PLUGIN_LIB_CORENAME}")
+ set (H5REPACK_TOOL_PLUGIN_LIB_TARGET ${H5REPACK_TOOL_PLUGIN_LIB_CORENAME})
+ set (H5REPACK_TOOL_PLUGIN_LIB_VCORENAME "dynlibvers")
+ set (H5REPACK_TOOL_PLUGIN_LIB_VNAME "${HDF5_EXTERNAL_LIB_PREFIX}${H5REPACK_TOOL_PLUGIN_LIB_VCORENAME}")
+ set (H5REPACK_TOOL_PLUGIN_LIB_VTARGET ${H5REPACK_TOOL_PLUGIN_LIB_VCORENAME})
-add_library (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
-target_include_directories(${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_TARGET} SHARED)
-target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_TARGET} ${HDF5_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
+ add_library (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED dynlib_rpk.c)
+ target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} SHARED)
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_TARGET} ${H5REPACK_TOOL_PLUGIN_LIB_NAME} SHARED "LIB")
-add_library (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
-target_include_directories(${HDF5_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (${HDF5_TOOL_PLUGIN_LIB_VTARGET} SHARED)
-target_link_libraries (${HDF5_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIB_TARGET})
-H5_SET_LIB_OPTIONS (${HDF5_TOOL_PLUGIN_LIB_VTARGET} ${HDF5_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
+ add_library (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED dynlib_vrpk.c)
+ target_include_directories (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} SHARED)
+ target_link_libraries (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} PRIVATE ${HDF5_TEST_LIBSH_TARGET})
+ H5_SET_LIB_OPTIONS (${H5REPACK_TOOL_PLUGIN_LIB_VTARGET} ${H5REPACK_TOOL_PLUGIN_LIB_VNAME} SHARED "LIB")
-# make plugins dir
-file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
-#-----------------------------------------------------------------------------
-# Copy plugin library to a plugins folder
-#-----------------------------------------------------------------------------
-add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_TARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
-)
-add_custom_command (
- TARGET ${HDF5_TOOL_PLUGIN_LIB_VTARGET}
- POST_BUILD
- COMMAND ${CMAKE_COMMAND}
- ARGS -E copy_if_different
- "$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
- "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_VTARGET}>"
-)
+ # make plugins dir
+ file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/plugins")
+ #-----------------------------------------------------------------------------
+ # Copy plugin library to a plugins folder
+ #-----------------------------------------------------------------------------
+ add_custom_command (
+ TARGET ${H5REPACK_TOOL_PLUGIN_LIB_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${H5REPACK_TOOL_PLUGIN_LIB_TARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5REPACK_TOOL_PLUGIN_LIB_TARGET}>"
+ )
+ add_custom_command (
+ TARGET ${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy_if_different
+ "$<TARGET_FILE:${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}>"
+ "${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${H5REPACK_TOOL_PLUGIN_LIB_VTARGET}>"
+ )
+endif ()
+
+# --------------------------------------------------------------------
+# Add the h5repack test executable
+# --------------------------------------------------------------------
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
+ add_executable (h5repackgentest ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/h5repackgentest.c)
+ target_include_directories (h5repackgentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ TARGET_C_PROPERTIES (h5repackgentest STATIC)
+ target_link_libraries (h5repackgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ set_target_properties (h5repackgentest PROPERTIES FOLDER generator/tools)
+
+ #add_test (NAME h5repackgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repackgentest>)
+endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake
index a063e19..c8db1c3 100644
--- a/tools/test/h5repack/CMakeTests.cmake
+++ b/tools/test/h5repack/CMakeTests.cmake
@@ -16,39 +16,6 @@
##############################################################################
##############################################################################
- if (HDF5_TEST_VFD)
- set (VFD_LIST
- sec2
- stdio
- core
- split
- multi
- family
- )
-
- if (DIRECT_VFD)
- set (VFD_LIST ${VFD_LIST} direct)
- endif ()
-
- 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 "${HDF_RESOURCES_DIR}/vfdTest.cmake"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest")
- endmacro ()
- endif ()
-
# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
# --------------------------------------------------------------------
@@ -59,10 +26,23 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_deflate.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_early.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_ext.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_f32le_ex.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fill.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_filters.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fletcher.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_hlink.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex-1.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_1d_ex.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_2d_ex.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_int32le_3d_ex.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5
@@ -77,6 +57,12 @@
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_shuffle.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_soffset.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_szip.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be.h5
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-0.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-1.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-2.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex-3.dat
+ ${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_uint8be_ex.h5
# fsm
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_aggr.h5
${HDF5_TOOLS_TEST_H5REPACK_SOURCE_DIR}/testfiles/h5repack_fsm_aggr_nopersist.h5
@@ -190,30 +176,25 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
macro (ADD_HELP_TEST testname resultcode)
# If using memchecker add tests without using scripts
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5REPACK-h5repack-${testname} COMMAND $<TARGET_FILE:h5repack> ${ARGN})
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5REPACK-h5repack-${testname}")
- else ()
- add_test (
- NAME H5REPACK-h5repack-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/h5repack-${testname}.out
- testfiles/h5repack-${testname}.out.err
+ add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN})
+ set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ else ()
add_test (
NAME H5REPACK-h5repack-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=h5repack-${testname}.out"
@@ -221,39 +202,43 @@
-D "TEST_REFERENCE=h5repack-${testname}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS H5REPACK-h5repack-${testname}-clear-objects)
endif ()
+ set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
endmacro ()
macro (ADD_H5_TEST_OLD testname testtype testfile)
- if ("${testtype}" STREQUAL "SKIP")
- if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ if ("${testtype}" STREQUAL "SKIP")
add_test (
NAME H5REPACK_OLD-${testname}
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
)
set_property(TEST H5REPACK_OLD-${testname} PROPERTY DISABLED)
+ else ()
+ add_test (
+ NAME H5REPACK_OLD-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ add_test (
+ NAME H5REPACK_OLD-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES
+ DEPENDS H5REPACK_OLD-${testname}-clear-objects
+ )
+ add_test (
+ NAME H5REPACK_OLD-${testname}_DFF
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${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 ()
- else ()
- add_test (
- NAME H5REPACK_OLD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- 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}
- )
- set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects)
- 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 ()
endmacro ()
@@ -269,23 +254,25 @@
else ()
add_test (
NAME H5REPACK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK-${testname}
- COMMAND $<TARGET_FILE:h5repack> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname} PROPERTIES
+ DEPENDS H5REPACK-${testname}-clear-objects
)
- set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects)
add_test (
NAME H5REPACK-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES
+ DEPENDS H5REPACK-${testname}
)
- set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname})
endif ()
endmacro ()
@@ -303,27 +290,21 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_CMP-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
else ()
add_test (
NAME H5REPACK_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -332,12 +313,14 @@
-D "TEST_REFERENCE=${resultfile}-${testname}.tst"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS H5REPACK_CMP-${testname}-clear-objects)
+ set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES
+ DEPENDS H5REPACK_CMP-${testname}-clear-objects
+ )
endif ()
endif ()
endmacro ()
- macro (ADD_H5_MASK_TEST testname testtype resultcode resultfile)
+ macro (ADD_H5_MASK_TEST testname testtype resultcode result_errcheck resultfile)
if ("${testtype}" STREQUAL "SKIP")
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
@@ -351,34 +334,32 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_MASK-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_MASK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_MASK-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_MASK_ERROR=true"
- -D "TEST_REFERENCE=${resultfile}-${testname}.tst"
- -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ -D "TEST_SKIP_COMPARE=true"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -D "TEST_ERRREF=${result_errcheck}"
+ -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects)
endif ()
@@ -397,25 +378,24 @@
else ()
add_test (
NAME H5REPACK_DMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_DMP-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES
+ DEPENDS H5REPACK_DMP-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_DMP-h5dump-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -423,7 +403,9 @@
-D "TEST_REFERENCE=${testname}.${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}")
+ set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES
+ DEPENDS "H5REPACK_DMP-${testname}"
+ )
endif ()
endif ()
endmacro ()
@@ -440,25 +422,24 @@
else ()
add_test (
NAME H5REPACK_STAT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${statarg}.${resultfile}
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_STAT-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES
+ DEPENDS H5REPACK_STAT-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_STAT-h5stat-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
-D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -466,7 +447,9 @@
-D "TEST_REFERENCE=${statarg}.${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES DEPENDS "H5REPACK_STAT-${testname}")
+ set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES
+ DEPENDS "H5REPACK_STAT-${testname}"
+ )
endif ()
endif ()
endmacro ()
@@ -484,30 +467,31 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF
- COMMAND $<TARGET_FILE:h5diff> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${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")
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}
+ )
+ if (NOT ${resultcode})
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -516,7 +500,9 @@
-D "TEST_REFERENCE=${testfilter}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF
+ )
else ()
if ("${testfilter}" STREQUAL "CHUNKED")
set (nottestfilter "(CONTIGUOUS|COMPACT)")
@@ -530,7 +516,8 @@
add_test (
NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -539,7 +526,9 @@
-D "TEST_REFERENCE=${testfilter}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF)
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF
+ )
endif ()
endif ()
endif ()
@@ -559,25 +548,24 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}
- COMMAND $<TARGET_FILE:h5repack> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -585,8 +573,10 @@
-D "TEST_REFERENCE=${testfile}-${testname}-v.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname})
+ set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}
+ )
endif ()
endif ()
endmacro ()
@@ -596,24 +586,23 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
- testfiles/${testfile}-${testname}-v.out
- testfiles/${testfile}-${testname}-v.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}
- COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES
+ DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects
)
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects)
add_test (
NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>"
-D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testfile}-${testname}-v.out"
@@ -622,28 +611,27 @@
-D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}"
-P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake"
)
- set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname})
+ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES
+ DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}
+ )
endif ()
endmacro ()
macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound)
add_test (
NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile}
+ )
+ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}
- COMMAND $<TARGET_FILE:h5repack> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}
)
- set_tests_properties (
- ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES
- DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
- WILL_FAIL "true"
+ set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES
+ DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects
+ WILL_FAIL "true"
)
endmacro ()
@@ -651,28 +639,33 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_META-${testname}_N-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
+ COMMAND ${CMAKE_COMMAND} -E remove
testfiles/out-${testname}_N.${testname}.h5
testfiles/out-${testname}_M.${testname}.h5
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
+ )
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
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5
+ )
+ set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES
+ DEPENDS H5REPACK_META-${testname}_N-clear-objects
)
- set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects)
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
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${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
)
- 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)
+ set_tests_properties (H5REPACK_META-${testname} PROPERTIES
+ WILL_FAIL "true"
+ DEPENDS H5REPACK_META-${testname}_M
+ )
endmacro ()
macro (ADD_H5_UD_TEST testname resultcode resultfile)
@@ -680,21 +673,16 @@
# Remove any output file left over from previous test run
add_test (
NAME H5REPACK_UD-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/out-${testname}.${resultfile}
- testfiles/${testname}.${resultfile}.out
- testfiles/${testname}.${resultfile}.out.err
- testfiles/${resultfile}-${testname}.out
- testfiles/${resultfile}-${testname}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile}
+ )
+ set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES
+ FIXTURES_REQUIRED clear_h5repack
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
add_test (
NAME H5REPACK_UD-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5repack>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repack-shared>"
-D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_EXPECT=${resultcode}"
@@ -703,13 +691,17 @@
-D "TEST_REFERENCE=${testname}.${resultfile}.tst"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clear-objects)
+ set_tests_properties (H5REPACK_UD-${testname} PROPERTIES
+ DEPENDS H5REPACK_UD-${testname}-clear-objects
+ )
add_test (
NAME H5REPACK_UD-${testname}-h5dump
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5dump>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5dump-shared>"
-D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}-${testname}.out"
@@ -717,9 +709,110 @@
-D "TEST_REFERENCE=${resultfile}-${testname}.ddl"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins"
+ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES DEPENDS "H5REPACK_UD-${testname}")
+ set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES
+ DEPENDS "H5REPACK_UD-${testname}"
+ )
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_EXTERNAL_TEST testname testtype testfile)
+ # canonical file = h5repack_${testfile}.h5 - preexist
+ # external file = h5repack_${testfile}_ex.h5 - preexist
+ # repacked file = h5repack_${testfile}_rp.h5 - created
+ # external data file = h5repack_${testfile}_ex-0.dat
+ if ("${testtype}" STREQUAL "SKIP")
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}"
+ )
+ set_property(TEST H5REPACK_EXTERNAL-${testname} PROPERTY DISABLED)
+ endif ()
+ else ()
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ FIXTURES_REQUIRED clear_h5repack
+ )
+ # make sure external data file 0 is available
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_CPY
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/h5repack_${testfile}_ex-0.dat" "${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex-0.dat"
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_CPY PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}-clear-objects
+ )
+ # comparison of known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF1
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF1 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_CPY
+ )
+ # repack the external file to the repacked file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF1
+ )
+ # comparison of repacked file to known files
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF2 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}
+ )
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF3
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF3 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF2
+ )
+ # invalidate external file by removing its first data file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_ex-0.dat
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DATA_RMV PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF3
+ )
+ # verify comparison of repacked file to known file
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF4
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF4 PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DATA_RMV
+ )
+ # verify comparison of repacked file to known external file fails
+ add_test (
+ NAME H5REPACK_EXTERNAL-${testname}_DFF_FAIL
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_rp.h5 ${PROJECT_BINARY_DIR}/testfiles/h5repack_${testfile}_ex.h5
+ )
+ set_tests_properties (H5REPACK_EXTERNAL-${testname}_DFF_FAIL PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4
+ WILL_FAIL "true"
+ )
endif ()
endmacro ()
@@ -751,6 +844,7 @@
set (FILE15 h5repack_named_dtypes.h5)
set (FILE16 tfamily%05d.h5) # located in common testfiles folder
set (FILE18 h5repack_layout2.h5)
+ set (FILE19 h5repack_layout3.h5)
set (FILE_REF h5repack_refs.h5)
set (FILE_ATTR_REF h5repack_attr_refs.h5)
set (FILEV1 1_vds.h5)
@@ -763,67 +857,6 @@
if (HDF5_ENABLE_USING_MEMCHECKER)
# Remove any output file left over from previous test run
set (LIST_TO_CLEAR
- h5dump-help.out
- h5repack_layout.h5-chunk_18x13-v.out
- h5repack_layout.h5-chunk_18x13-v.out.err
- h5repack_layout.h5-chunk_20x10-v.out
- h5repack_layout.h5-chunk_20x10-v.out.err
- h5repack_layout.h5-chunk_compa-v.out
- h5repack_layout.h5-chunk_compa-v.out.err
- h5repack_layout.h5-chunk_conti-v.out
- h5repack_layout.h5-chunk_conti-v.out.err
- h5repack_layout.h5-compa-v.out
- h5repack_layout.h5-compa-v.out.err
- h5repack_layout.h5-conti-v.out
- h5repack_layout.h5-conti-v.out.err
- h5repack_layout.h5-deflate_limit.out
- h5repack_layout.h5-deflate_limit.out.err
- h5repack_layout.h5-dset2_chunk_20x10-v.out
- h5repack_layout.h5-dset2_chunk_20x10-v.out.err
- h5repack_layout.h5-dset2_chunk_20x10-errstk.out
- h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err
- h5repack_layout.h5-dset2_compa-v.out
- h5repack_layout.h5-dset2_compa-v.out.err
- h5repack_layout.h5-dset2_conti-v.out
- h5repack_layout.h5-dset2_conti-v.out.err
- h5repack_layout.h5-dset_compa_chunk-v.out
- h5repack_layout.h5-dset_compa_chunk-v.out.err
- h5repack_layout.h5-dset_compa_compa-v.out
- h5repack_layout.h5-dset_compa_compa-v.out.err
- h5repack_layout.h5-dset_compa_conti-v.out
- h5repack_layout.h5-dset_compa_conti-v.out.err
- h5repack_layout.h5-dset_conti_chunk-v.out
- h5repack_layout.h5-dset_conti_chunk-v.out.err
- h5repack_layout.h5-dset_conti_compa-v.out
- h5repack_layout.h5-dset_conti_compa-v.out.err
- h5repack_layout.h5-dset_conti_conti-v.out
- h5repack_layout.h5-dset_conti_conti-v.out.err
- h5repack_layout.h5-layout_long_switches-v.out
- h5repack_layout.h5-layout_long_switches-v.out.err
- h5repack_layout.h5-layout_short_switches-v.out
- h5repack_layout.h5-layout_short_switches-v.out.err
- h5repack_layout.h5-plugin_test.out
- h5repack_layout.h5-plugin_test.out.err
- h5repack_layout2.h5-contig_small_compa-v.out
- h5repack_layout2.h5-contig_small_compa-v.out.err
- h5repack_layout2.h5-contig_small_fixed_compa-v.out
- h5repack_layout2.h5-contig_small_fixed_compa-v.out.err
- h5repack_layout3.h5-ckdim_biger-v.out
- h5repack_layout3.h5-ckdim_biger-v.out.err
- h5repack_layout3.h5-ckdim_smaller-v.out
- h5repack_layout3.h5-ckdim_smaller-v.out.err
- h5repack_layout3.h5-chunk2chunk-v.out
- h5repack_layout3.h5-chunk2chunk-v.out.err
- h5repack_layout3.h5-chunk2compa-v.out
- h5repack_layout3.h5-chunk2compa-v.out.err
- h5repack_layout3.h5-chunk2conti-v.out
- h5repack_layout3.h5-chunk2conti-v.out.err
- h5repack_layout3.h5-error1-v.out
- h5repack_layout3.h5-error1-v.out.err
- h5repack_layout3.h5-error2-v.out
- h5repack_layout3.h5-error2-v.out.err
- h5repack_layout3.h5-error3-v.out
- h5repack_layout3.h5-error3-v.out.err
out-family.tfamily%05d.h5
out-HDFFV-7840.h5diff_attr1.h5
out-attr.h5repack_attr.h5
@@ -932,15 +965,15 @@
NAME H5REPACK-clearall-objects
COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR}
)
- set_tests_properties (H5REPACK-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ set_tests_properties (H5REPACK-clearall-objects PROPERTIES
+ FIXTURES_SETUP clear_h5repack
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
endif ()
ADD_HELP_TEST(help 0 -h)
- add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>)
+ add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testh5repack_detect_szip>)
if (HDF5_ENABLE_SZIP_SUPPORT)
if (HDF5_ENABLE_SZIP_ENCODING)
set (passRegex "yes")
@@ -954,11 +987,11 @@
set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no")
endif ()
set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects)
+ set (last_test "H5REPACK-testh5repack_detect_szip")
- 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")
-
+# add_test (NAME H5REPACK-h5repacktest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<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
@@ -1254,7 +1287,7 @@
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)
- ADD_H5_MASK_TEST (dset2_chunk_20x10-errstk "TEST" 0 ${FILE4} --layout=dset2:CHUNK=20x10x5 --enable-error-stack)
+ ADD_H5_MASK_TEST (dset2_chunk_20x10-errstk "TEST" 0 "dimensionality of chunks doesn't match the dataspace" ${FILE4} --layout=dset2:CHUNK=20x10x5 --enable-error-stack)
################################################################
# layout conversions (file has no filters)
@@ -1279,14 +1312,14 @@
# 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)
+ ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 ${FILE19} 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)
+ ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 ${FILE19} 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)
+ ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 ${FILE19} chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA)
#--------------------------------------------------------------------------
# Test -f for some specific cases. Chunked dataset with unlimited max dims.
@@ -1296,16 +1329,16 @@
# - 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)
+ ADD_H5_VERIFY_TEST (error1 "TEST" 0 ${FILE19} 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)
+ ADD_H5_VERIFY_TEST (error2 "TEST" 0 ${FILE19} 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)
+ ADD_H5_VERIFY_TEST (error3 "TEST" 0 ${FILE19} chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE)
# file input - should not fail
- ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE)
+ ADD_H5_TEST (error4 "TEST" ${FILE19} -f NONE)
#--------------------------------------------------------------------------
# Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset
@@ -1313,9 +1346,9 @@
# (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)
+ ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 ${FILE19} 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)
+ ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 ${FILE19} chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI)
@@ -1448,17 +1481,31 @@ ADD_H5_VERIFY_SUPERBLOCK (SB_IS_3 h5repack_layout.h5 2 2 3)
ADD_H5_VERIFY_INVALIDBOUNDS (latest_latest_invalid bounds_latest_latest.h5 0 1)
##############################################################################
+### E X T E R N A L S T O R A G E T E S T S
+##############################################################################
+ADD_H5_EXTERNAL_TEST (ext_f32le "TEST" f32le -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_1d "TEST" int32le_1d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_2d "TEST" int32le_2d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_int32le_3d "TEST" int32le_3d -l CONTI)
+ADD_H5_EXTERNAL_TEST (ext_uint8be "TEST" uint8be -l CONTI)
+
+##############################################################################
### P L U G I N T E S T S
##############################################################################
+if (BUILD_SHARED_LIBS)
ADD_H5_UD_TEST (plugin_version_test 0 h5repack_layout.h5 -v -f UD=260,0,4,9,${H5_VERS_MAJOR},${H5_VERS_MINOR},${H5_VERS_RELEASE})
ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9)
ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE)
# check for no parameters
ADD_H5_UD_TEST (plugin_zero 0 h5repack_layout.h5 -v -f UD=250,0,0)
+endif ()
- if (HDF5_TEST_VFD)
- # Run test with different Virtual File Driver
- foreach (vfd ${VFD_LIST})
- ADD_VFD_TEST (${vfd} 0)
- endforeach ()
- endif ()
+##############################################################################
+##############################################################################
+### V F D T E S T S ###
+##############################################################################
+##############################################################################
+
+if (HDF5_TEST_VFD)
+ include (CMakeVFDTests.cmake)
+endif ()
diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake
new file mode 100644
index 0000000..c1a280b
--- /dev/null
+++ b/tools/test/h5repack/CMakeVFDTests.cmake
@@ -0,0 +1,104 @@
+#
+# Copyright by The HDF Group.
+# All rights reserved.
+#
+# This file is part of HDF5. The full HDF5 copyright notice, including
+# terms governing use, modification, and redistribution, is contained in
+# the COPYING file, which can be found at the root of the source code
+# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
+# If you do not have access to either file, you may request a copy from
+# help@hdfgroup.org.
+#
+
+##############################################################################
+##############################################################################
+### T E S T I N G ###
+##############################################################################
+##############################################################################
+
+set (VFD_LIST
+ sec2
+ stdio
+ core
+ core_paged
+ split
+ multi
+ family
+)
+
+if (DIRECT_VFD)
+ set (VFD_LIST ${VFD_LIST} direct)
+endif ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S M A C R O S ###
+##############################################################################
+##############################################################################
+
+macro (ADD_VFD_TEST vfdname resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}")
+ add_test (
+ NAME H5REPACK-${vfdname}-h5repacktest-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove
+ bounds_latest_latest.h5
+ h5repack_attr.h5
+ h5repack_attr_refs.h5
+ h5repack_deflate.h5
+ h5repack_early.h5
+ h5repack_ext.h5
+ h5repack_fill.h5
+ h5repack_filters.h5
+ h5repack_fletcher.h5
+ h5repack_hlink.h5
+ h5repack_layout.h5
+ h5repack_layouto.h5
+ h5repack_layout2.h5
+ h5repack_layout3.h5
+ h5repack_layout.UD.h5
+ h5repack_named_dtypes.h5
+ h5repack_nested_8bit_enum.h5
+ h5repack_nested_8bit_enum_deflated.h5
+ h5repack_nbit.h5
+ h5repack_objs.h5
+ h5repack_refs.h5
+ h5repack_shuffle.h5
+ h5repack_soffset.h5
+ h5repack_szip.h5
+ # fsm
+ h5repack_aggr.h5
+ h5repack_fsm_aggr_nopersist.h5
+ h5repack_fsm_aggr_persist.h5
+ h5repack_none.h5
+ h5repack_paged_nopersist.h5
+ h5repack_paged_persist.h5
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname}
+ )
+ add_test (
+ NAME H5REPACK_VFD-${vfdname}-h5repacktest
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${vfdname}-h5repacktest.out"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}"
+ -P "${HDF_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS H5REPACK_VFD-${vfdname}-h5repacktest-clear-objects)
+ set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT})
+ endif ()
+endmacro ()
+
+##############################################################################
+##############################################################################
+### T H E T E S T S ###
+##############################################################################
+##############################################################################
+
+# Run test with different Virtual File Driver
+foreach (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+endforeach ()
diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am
index 59d7a6a..38f7b2f 100644
--- a/tools/test/h5repack/Makefile.am
+++ b/tools/test/h5repack/Makefile.am
@@ -22,10 +22,12 @@ include $(top_srcdir)/config/commence.am
AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/test -I$(top_srcdir)/tools/lib -I$(top_srcdir)/tools/src/h5repack
# Test programs and scripts
+TEST_PROG=h5repackgentest
TEST_SCRIPT=h5repack.sh
noinst_PROGRAMS=h5repacktst testh5repack_detect_szip
+check_PROGRAMS=$(TEST_PROG)
SCRIPT_DEPEND=../../src/h5repack/h5repack$(EXEEXT) h5repacktst$(EXEEXT)
if HAVE_SHARED_CONDITIONAL
if USE_PLUGINS_CONDITIONAL
@@ -57,7 +59,8 @@ endif
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
-CHECK_CLEANFILES+=*.h5 *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
+# *.dat files may be created by h5repackgentest.
+CHECK_CLEANFILES+=*.h5 *.dat *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
DISTCLEANFILES=h5repack.sh h5repack_plugin.sh
include $(top_srcdir)/config/conclude.am
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index a36eb08..6e63136 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -48,6 +48,10 @@ DIRNAME='dirname'
LS='ls'
AWK='awk'
+# Reset the VOL connector to only use the native connector, because of the
+# error stack checking. QAK - 2019/03/09
+ENVCMD="env HDF5_VOL_CONNECTOR=native"
+
H5DETECTSZIP=testh5repack_detect_szip
H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP
@@ -111,6 +115,16 @@ $SRC_H5REPACK_TESTFILES/h5repack_fsm_aggr_persist.h5
$SRC_H5REPACK_TESTFILES/h5repack_none.h5
$SRC_H5REPACK_TESTFILES/h5repack_paged_nopersist.h5
$SRC_H5REPACK_TESTFILES/h5repack_paged_persist.h5
+$SRC_H5REPACK_TESTFILES/h5repack_f32le.h5
+$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d.h5
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex.h5
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be.h5
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex.h5
$SRC_H5DIFF_TESTFILES/h5diff_attr1.h5
$SRC_TOOLS_TESTFILES/tfamily00000.h5
$SRC_TOOLS_TESTFILES/tfamily00001.h5
@@ -156,10 +170,19 @@ $SRC_H5REPACK_TESTFILES/ublock.bin
$SRC_H5REPACK_TESTFILES/h5repack.info
$SRC_H5REPACK_TESTFILES/crtorder.tordergr.h5.ddl
$SRC_H5REPACK_TESTFILES/deflate_limit.h5repack_layout.h5.ddl
+$SRC_H5REPACK_TESTFILES/h5repack_f32le_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_1d_ex-1.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_2d_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_int32le_3d_ex-0.dat
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5.ddl
$SRC_H5REPACK_TESTFILES/h5repack_filters.h5-gzip_verbose_filters.tst
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
$SRC_H5REPACK_TESTFILES/h5repack_layout.h5-plugin_test.ddl
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-0.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-1.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-2.dat
+$SRC_H5REPACK_TESTFILES/h5repack_uint8be_ex-3.dat
$SRC_H5REPACK_TESTFILES/plugin_test.h5repack_layout.h5.tst
$SRC_H5REPACK_TESTFILES/1_vds.h5-vds_dset_chunk20x10x5-v.ddl
$SRC_H5REPACK_TESTFILES/2_vds.h5-vds_chunk3x6x9-v.ddl
@@ -284,7 +307,7 @@ TOOLTEST()
TESTING $H5REPACK $@
(
cd $TESTDIR
- $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ $ENVCMD $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
)
RET=$?
if [ $RET != 0 ] ; then
@@ -595,8 +618,94 @@ VERIFY_INVALIDBOUNDS()
} # end of VERIFY_INVALIDBOUNDS
+# -----------------------------------------------------------------------------
+# Expect h5diff to fail
+# -----------------------------------------------------------------------------
+DIFFFAIL()
+{
+ VERIFY h5diff unequal $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5DIFF_BIN -q "$@"
+ )
+ RET=$?
+ if [ $RET == 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ fi
+}
+
+# -----------------------------------------------------------------------------
+# Catchall test for repacking with external files
+# Loops over all (internally-listed) cases and applies the given arguments
+# to h5repack.
+# Each test file family must be listed in the for loop at the start of the
+# 'function'.
+# Expects case files to be of format:
+# + h5repack_<NAME>.h5
+# + h5repack_<NAME>_ex.h5
+# + h5repack_<NAME>_ex-<N>.dat
+# ...where NAME is part of the internal list, and N is a positive decimal
+# number; multiple external files (*.dat) are allowed per file, but they must
+# follow the pattern and be in contiguous numerical sequence starting at 0.
+# -----------------------------------------------------------------------------
+VERIFY_EXTERNAL_CONSOLIDATION()
+{
+ for name in f32le int32le_1d int32le_2d int32le_3d uint8be
+ do
+ basename="h5repack_${name}"
+ base_ext="${basename}_ex"
+ base_rpkg="${basename}_rp"
+ canonical="${basename}.h5"
+ external="${base_ext}.h5"
+ ex_dat="${base_ext}-0.dat"
+ ex_dat_mv="__${ext_dat}"
+ repacked="${base_rpkg}.h5"
+ prev_nerrors=$nerrors
+
+ TESTING external consolidation on $name with h5repack $@
+ echo " . . ."
+
+ # baseline comparison of known files
+ DIFFTEST $canonical $external
+
+ # repack the external file, verify integrity
+ ( cd $TESTDIR
+ $H5REPACK_BIN $@ $external $repacked
+ )
+ DIFFTEST $repacked $canonical
+ DIFFTEST $repacked $external
+
+ # invalidate external file by moving its first data file; verify
+ ( cd $TESTDIR
+ mv $ex_dat $ex_dat_mv
+ )
+ DIFFFAIL $canonical $external
+ DIFFFAIL $repacked $external
+ DIFFTEST $canonical $repacked
+
+ # reset test state for re-runs with different h5repack arguments
+ ( cd $TESTDIR
+ mv $ex_dat_mv $ex_dat
+ rm $repacked
+ )
+
+ # flag if any of the above checks failed
+ if [ $prev_nerrors != $nerrors ]
+ then
+ echo ". . . *FAILED*"
+ nerrors="`expr $prev_nerrors + 1`"
+ else
+ echo ". . . PASSED"
+ fi
+ done
+} # end VERIFY_EXTERNAL_CONSOLIDATION
+
+# -----------------------------------------------------------------------------
# same as TOOLTEST, but it uses the old syntax -i input_file -o output_file
-#
+# -----------------------------------------------------------------------------
TOOLTEST0()
{
infile=$2
@@ -716,7 +825,7 @@ TOOLTESTM() {
TESTING $H5REPACK $@
(
cd $TESTDIR
- $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
+ $ENVCMD $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile
) >$actual 2>$actual_err
# save actual and actual_err in case they are needed later.
@@ -1387,7 +1496,12 @@ TOOLTEST add_alignment $arg
TOOLTEST upgrade_layout h5repack_layouto.h5
# test for datum size > H5TOOLS_MALLOCSIZE
-TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1
+arg="h5repack_objs.h5 -f GZIP=1"
+if test $USE_FILTER_DEFLATE != "yes" ; then
+ SKIP $arg
+else
+ TOOLTEST gt_mallocsize $arg
+fi
# Check repacking file with committed datatypes in odd configurations
TOOLTEST committed_dt h5repack_named_dtypes.h5
@@ -1458,7 +1572,12 @@ VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5
# -j 2 -k 2, superblock will be 3
VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5
# -j 0 -k 1, file cannot be opened
-VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5
+VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5
+
+########################################
+# Testing external storage
+########################################
+VERIFY_EXTERNAL_CONSOLIDATION -l CONTI
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR
diff --git a/tools/test/h5repack/h5repackgentest.c b/tools/test/h5repack/h5repackgentest.c
new file mode 100644
index 0000000..aaac285
--- /dev/null
+++ b/tools/test/h5repack/h5repackgentest.c
@@ -0,0 +1,340 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* For generating files for verifying h5repack with external storage. . .
+ *
+ * Each case file should follow the format of:
+ * + h5repack_<NAME>.h5
+ * + h5repack_<NAME>_ex.h5
+ * + h5repack_<NAME>_ex-<N>.dat
+ * ...where NAME idenfities the type, and N is a positive decimal number;
+ * multiple external files (*.dat) are allowed per file, but they must
+ * follow the pattern and be in contiguous numerical sequence starting at 0.
+ *
+ * Each file typename must be added to the listing for
+ * `VERIFY_EXTERNAL_CONSOLIDATION` in h5repack.sh
+ *
+ * There is no restriction on the name, number, or structure of datasets and
+ * groups in HDF5 file.
+ *
+ * The inluded datatypes should be more than adequate to verify the correctness
+ * of the behavior -- if one type can be consolidated from external storage,
+ * then thay all can.
+ */
+
+#include "hdf5.h"
+#include "H5private.h"
+
+#define MAX_NAME_SIZE 256
+#define FILE_INT32LE_1 "h5repack_int32le_1d"
+#define FILE_INT32LE_2 "h5repack_int32le_2d"
+#define FILE_INT32LE_3 "h5repack_int32le_3d"
+#define FILE_UINT8BE "h5repack_uint8be"
+#define FILE_F32LE "h5repack_f32le"
+
+#define H5REPACKGENTEST_OOPS { \
+ ret_value = -1; \
+ goto done; \
+}
+
+#define H5REPACKGENTEST_COMMON_CLEANUP(dcpl, file, space) { \
+ if ((dcpl) != H5P_DEFAULT && (dcpl) != H5I_INVALID_HID) { \
+ (void)H5Pclose((dcpl)); \
+ } \
+ if ((file) != H5I_INVALID_HID) { (void)H5Fclose((file)); } \
+ if ((space) != H5I_INVALID_HID) { (void)H5Sclose((space)); } \
+}
+
+struct external_def {
+ hsize_t type_size;
+ unsigned n_elts_per_file;
+ unsigned n_elts_total;
+};
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Helper function to create and write a dataset to file.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__make_dataset(hid_t file_id, const char *dset_name,
+ hid_t mem_type_id, hid_t space_id, hid_t dcpl_id, void *wdata) {
+ hid_t dset_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ dset_id = H5Dcreate2(file_id, dset_name, mem_type_id, space_id,
+ H5P_DEFAULT, dcpl_id,
+ H5P_DEFAULT);
+ if (dset_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ if (H5Dwrite(dset_id, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata) < 0)
+ H5REPACKGENTEST_OOPS;
+
+done:
+ if (dset_id != H5I_INVALID_HID)
+ (void) H5Dclose(dset_id);
+
+ return ret_value;
+} /* end __make_dataset() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Helper function to populate the DCPL external storage list.
+ * Creates external files for the DCPL, with each file name following the
+ * convention "<filename>_ex-<num>.dat". Will append `n_external_files` to
+ * the filename list, with each file having space for `n_elts` items of the
+ * type (of size `elt_size`). The numeric inputs are not sanity-checked.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__set_dcpl_external_list(hid_t dcpl, const char *filename,
+ unsigned n_elts_per_file, unsigned n_elts_total, hsize_t elt_size) {
+ char name[MAX_NAME_SIZE];
+ unsigned n_external_files = 0;
+ unsigned i = 0;
+
+ if (NULL == filename || '\0' == *filename)
+ return -1;
+
+ n_external_files = n_elts_total / n_elts_per_file;
+ if (n_elts_total != (n_external_files * n_elts_per_file))
+ return -1;
+
+
+ for (i = 0; i < n_external_files; i++) {
+ if (HDsnprintf(name, MAX_NAME_SIZE, "%s_ex-%u.dat", filename, i) >= MAX_NAME_SIZE)
+ return -1;
+
+ if (H5Pset_external(dcpl, name, 0, n_elts_per_file * elt_size) < 0)
+ return -1;
+ }
+ return 0;
+} /* end __set_dcpl_external_list() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Generalized utility function to write a file with the specified data and
+ * dataset configuration. If `ext` is provided, will attempt to use external
+ * storage.
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+__make_file(const char *basename, struct external_def *ext,
+ hid_t type_id, hsize_t rank, hsize_t *dims, void *wdata) {
+ char filename[MAX_NAME_SIZE];
+ hid_t file_id = H5I_INVALID_HID;
+ hid_t dcpl_id = H5P_DEFAULT;
+ hid_t space_id = H5I_INVALID_HID;
+ int ret_value = 0;
+
+ if (HDsnprintf(filename, MAX_NAME_SIZE, "%s%s.h5", basename, (NULL != ext) ? "_ex" : "") >= MAX_NAME_SIZE)
+ H5REPACKGENTEST_OOPS;
+
+ if (NULL != ext) {
+ dcpl_id = H5Pcreate(H5P_DATASET_CREATE);
+ if (dcpl_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ if (__set_dcpl_external_list(dcpl_id, basename, ext->n_elts_per_file, ext->n_elts_total, ext->type_size) < 0)
+ H5REPACKGENTEST_OOPS;
+ }
+
+ space_id = H5Screate_simple(rank, dims, NULL);
+ if (space_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+ file_id = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ if (file_id == H5I_INVALID_HID)
+ H5REPACKGENTEST_OOPS;
+
+
+ if (__make_dataset(file_id, "dset", type_id, space_id, dcpl_id, wdata) < 0)
+ H5REPACKGENTEST_OOPS;
+
+done:
+ H5REPACKGENTEST_COMMON_CLEANUP(dcpl_id, file_id, space_id);
+return ret_value;
+} /* end __make_file() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_1d(hbool_t external) {
+ int32_t wdata[12];
+ hsize_t dims[] = { 12 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 6, 12 };
+ int32_t n = 0;
+ int ret_value = 0;
+
+ /* Generate values
+ */
+ for (n = 0; n < 12; n++) {
+ wdata[n] = n - 6;
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_1, def_ptr, H5T_STD_I32LE, 1, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_1d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_2d(hbool_t external) {
+ int32_t wdata[64];
+ hsize_t dims[] = { 8, 8 };
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 64, 64 };
+ int32_t n = 0;
+ int ret_value = 0;
+
+ /* Generate values
+ */
+ for (n = 0; n < 64; n++) {
+ wdata[n] = n - 32;
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_2, def_ptr, H5T_STD_I32LE, 2, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_2d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_int32le_3d(hbool_t external) {
+ hsize_t dims[] = { 8, 8, 8 };
+ int32_t wdata[512]; /* 8^3, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(int32_t), 512, 512 };
+ int32_t n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* generate values, alternating positive and negative
+ */
+ for (i = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++, n++) {
+ wdata[n] = (k + j * 512 + i * 4096) * ((n & 1) ? (-1) : (1));
+ }
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_INT32LE_3, def_ptr, H5T_STD_I32LE, 3, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_int32le_3d() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_uint8be(hbool_t external) {
+ hsize_t dims[] = { 4, 8, 8 };
+ uint8_t wdata[256]; /* 4*8*8, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(uint8_t), 64, 256 };
+ uint8_t n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* Generate values, ping-pong from ends of range
+ */
+ for (i = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++) {
+ for (k = 0; k < dims[2]; k++, n++) {
+ wdata[n] = n * ((n & 1) ? (-1) : (1));
+ }
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_UINT8BE, def_ptr, H5T_STD_U8BE, 3, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_uint8be() */
+
+/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+ * Returns 0 on success, -1 on failure.
+ */
+static int
+generate_f32le(hbool_t external) {
+ hsize_t dims[] = { 12, 6 };
+ float wdata[72]; /* 12*6, from dims */
+ struct external_def *def_ptr = NULL;
+ struct external_def def = { (hsize_t) sizeof(float), 72, 72 };
+ float n = 0;
+ int i = 0;
+ int j = 0;
+ int k = 0;
+ int ret_value = 0;
+
+ /* Generate values */
+ for (i = 0, k = 0, n = 0; i < dims[0]; i++) {
+ for (j = 0; j < dims[1]; j++, k++, n++) {
+ wdata[k] = n * 801.1 * ((k % 5 == 1) ? (-1) : (1));
+ }
+ }
+
+ def_ptr = (TRUE == external) ? (&def) : NULL;
+ if (__make_file(FILE_F32LE, def_ptr, H5T_IEEE_F32LE, 2, dims, wdata) < 0)
+ ret_value = -1;
+
+ return ret_value;
+} /* end generate_f32le() */
+
+/* ----------------------------------------------------------------------------
+ * Create files.
+ * Return 0 on success, nonzero on failure.
+ */
+int
+main(void) {
+ int i = 0;
+ int ret_value = 0;
+
+ for (i = 0; i < 2; i++) {
+ hbool_t external = (i & 1) ? TRUE : FALSE;
+ if (generate_int32le_1d(external) < 0)
+ HDprintf("A generate_int32le_1d failed!\n");
+
+ if (generate_int32le_2d(external) < 0)
+ HDprintf("A generate_int32le_2d failed!\n");
+
+ if (generate_int32le_3d(external) < 0)
+ HDprintf("A generate_int32le_3d failed!\n");
+
+ if (generate_uint8be(external) < 0)
+ HDprintf("A generate_uint8be failed!\n");
+
+ if (generate_f32le(external) < 0)
+ HDprintf("A generate_f32le failed!\n");
+
+ } /* end for external data storage or not */
+
+ return EXIT_SUCCESS;
+} /* end main() */
+
diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c
index f6166da..f3e6cd3 100644
--- a/tools/test/h5repack/h5repacktst.c
+++ b/tools/test/h5repack/h5repacktst.c
@@ -2907,10 +2907,10 @@ out:
static
int make_all_filters(hid_t loc_id)
{
- hid_t dcpl; /* dataset creation property list */
- hid_t sid; /* dataspace ID */
- hid_t dtid;
- hid_t dsid;
+ hid_t dcpl = H5I_INVALID_HID; /* dataset creation property list */
+ hid_t sid = H5I_INVALID_HID; /* dataspace ID */
+ hid_t dtid = H5I_INVALID_HID;
+ hid_t dsid = H5I_INVALID_HID;
#if defined (H5_HAVE_FILTER_SZIP)
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=8;
@@ -3083,7 +3083,7 @@ int make_early(void)
hid_t tid=-1;
hid_t dcpl=-1;
int i;
- char name[10];
+ char name[16];
int iter=100;
if ((fid = H5Fcreate(FNAME5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -3108,7 +3108,7 @@ int make_early(void)
goto out;
if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
- sprintf(name, "%d", i);
+ HDsprintf(name, "%d", i);
if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5Tclose(tid) < 0)
@@ -3133,7 +3133,7 @@ int make_early(void)
{
if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0)
goto out;
- sprintf(name, "%d", i);
+ HDsprintf(name, "%d", i);
if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
if (H5Tclose(tid) < 0)
@@ -3178,7 +3178,7 @@ int make_layout(hid_t loc_id)
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
int i, j, n;
- char name[6];
+ char name[16];
for (i=n=0; i<DIM1; i++)
@@ -3195,7 +3195,7 @@ int make_layout(hid_t loc_id)
*/
for (i=0; i<4; i++)
{
- sprintf(name,"dset%d",i+1);
+ HDsprintf(name,"dset%d",i+1);
if (write_dset(loc_id,RANK,dims,name,H5T_NATIVE_INT,buf) < 0)
return -1;
}
@@ -3728,7 +3728,7 @@ out:
H5Pclose(fcpl);
H5Fclose(fid);
} H5E_END_TRY;
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -3797,7 +3797,7 @@ out:
H5Pclose(fcpl);
H5Fclose(fid);
} H5E_END_TRY;
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -3838,7 +3838,7 @@ make_userblock_file(void)
out:
- if(fd > 0)
+ if(fd >= 0)
HDclose(fd);
return -1;
@@ -4079,7 +4079,7 @@ int write_dset_in(hid_t loc_id,
goto out;
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf5) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
goto out;
if (H5Dclose(did) < 0)
goto out;
@@ -4120,7 +4120,7 @@ int write_dset_in(hid_t loc_id,
dbuf = (double*)HDmalloc( size );
if (NULL == dbuf)
{
- printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
+ HDprintf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 );
goto out;
}
@@ -4134,13 +4134,19 @@ int write_dset_in(hid_t loc_id,
}
/* create a type larger than TEST_BUFSIZE */
- if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0)
+ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) {
+ HDfree(dbuf);
goto out;
+ }
size = H5Tget_size(tid);
- if ((sid = H5Screate_simple(1, sdims, NULL)) < 0)
+ if ((sid = H5Screate_simple(1, sdims, NULL)) < 0) {
+ HDfree(dbuf);
goto out;
- if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ }
+ if ((did = H5Dcreate2(loc_id, "arrayd", tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
+ HDfree(dbuf);
goto out;
+ }
#if defined(WRITE_ARRAY)
H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, dbuf);
#endif
@@ -4149,7 +4155,7 @@ int write_dset_in(hid_t loc_id,
H5Dclose(did);
H5Tclose(tid);
H5Sclose(sid);
- HDfree( dbuf );
+ HDfree(dbuf);
}
/*-------------------------------------------------------------------------
@@ -4306,7 +4312,7 @@ int write_dset_in(hid_t loc_id,
goto out;
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf52) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
goto out;
if (H5Dclose(did) < 0)
goto out;
@@ -4527,7 +4533,7 @@ int write_dset_in(hid_t loc_id,
if (H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf53) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
goto out;
if (H5Dclose(did) < 0)
@@ -5003,7 +5009,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf5) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf5) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
@@ -5325,7 +5331,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf52) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf52) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
@@ -5787,7 +5793,7 @@ int write_attr_in(hid_t loc_id,
goto out;
if (H5Awrite(aid, tid, buf53) < 0)
goto out;
- if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
+ if (H5Treclaim(tid, sid, H5P_DEFAULT, buf53) < 0)
goto out;
if (H5Aclose(aid) < 0)
goto out;
@@ -6176,7 +6182,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6185,7 +6191,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6194,7 +6200,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6203,7 +6209,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id)
status = make_attr(obj_id,1,dim_attr_objref,"Attr_OBJREF",H5T_STD_REF_OBJ,data_attr_objref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6245,7 +6251,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
sid_regrefed_dset = H5Screate_simple (2, dim_regrefed_dset, NULL);
if (sid_regrefed_dset < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6254,7 +6260,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6263,7 +6269,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = H5Rcreate (&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6272,7 +6278,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id)
status = make_attr(obj_id,1,dim_attr_regref,"Attr_REGREF",H5T_STD_REF_DSETREG,data_attr_regref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6318,7 +6324,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
sid = H5Screate_simple(1, dims1, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6326,7 +6332,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
did1 = H5Dcreate2 (loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (did1 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6334,7 +6340,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6346,7 +6352,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
gid = H5Gcreate2 (loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6359,7 +6365,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6372,7 +6378,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
sid2 = H5Screate_simple (2, dims2, NULL);
if (sid2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6381,7 +6387,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
did2 = H5Dcreate2 (loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (did2 < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6390,7 +6396,7 @@ static herr_t gen_refered_objs(hid_t loc_id)
status = H5Dwrite (did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6447,7 +6453,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6456,7 +6462,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6465,7 +6471,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6476,7 +6482,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
sid = H5Screate_simple (1, dims_dset_objref, NULL);
if (sid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6484,7 +6490,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6492,7 +6498,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6505,7 +6511,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = add_attr_with_objref(loc_id, oid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6514,7 +6520,7 @@ static herr_t gen_obj_ref(hid_t loc_id)
status = add_attr_with_regref(loc_id, oid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6567,7 +6573,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid_trg = H5Screate_simple (2, dims_trg, NULL);
if (sid_trg < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6576,7 +6582,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6585,7 +6591,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6594,7 +6600,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Sselect_hyperslab (sid_trg, H5S_SELECT_SET, start, stride, count, block);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6603,7 +6609,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Rcreate (&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6612,7 +6618,7 @@ static herr_t gen_region_ref(hid_t loc_id)
sid_ref = H5Screate_simple (1, dims1, NULL);
if (sid_ref < 0)
{
- fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6621,7 +6627,7 @@ static herr_t gen_region_ref(hid_t loc_id)
oid_ref = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
if (oid_ref < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6630,7 +6636,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = H5Dwrite (oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6643,7 +6649,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = add_attr_with_objref(loc_id, oid_ref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6652,7 +6658,7 @@ static herr_t gen_region_ref(hid_t loc_id)
status = add_attr_with_regref(loc_id, oid_ref);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6685,7 +6691,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_refered_objs(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate referenced object.\n");
+ HDfprintf(stderr, "Failed to generate referenced object.\n");
ret = FAIL;
}
@@ -6693,7 +6699,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_obj_ref(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate object reference.\n");
+ HDfprintf(stderr, "Failed to generate object reference.\n");
ret = FAIL;
}
@@ -6701,7 +6707,7 @@ static herr_t make_references(hid_t loc_id)
status = gen_region_ref(loc_id);
if (status == FAIL)
{
- fprintf(stderr, "Failed to generate region reference.\n");
+ HDfprintf(stderr, "Failed to generate region reference.\n");
ret = FAIL;
}
@@ -6825,7 +6831,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6835,7 +6841,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6848,7 +6854,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
if (main_gid < 0)
{
- fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6863,7 +6869,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6887,7 +6893,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6897,7 +6903,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6907,7 +6913,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,(hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6921,7 +6927,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (comp_objref_aid, comp_objref_tid, comp_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6943,14 +6949,14 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6964,7 +6970,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (comp_regref_aid, comp_regref_tid, comp_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6990,7 +6996,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -6998,7 +7004,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7006,7 +7012,7 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7024,16 +7030,16 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite (vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
/* close resource for vlen data */
- status = H5Dvlen_reclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
+ status = H5Treclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7054,14 +7060,14 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
status = H5Rcreate (&((hdset_reg_ref_t*)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
@@ -7079,16 +7085,16 @@ static herr_t make_complex_attr_references(hid_t loc_id)
status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
/* close resource for vlen data */
- status = H5Dvlen_reclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
+ status = H5Treclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data);
if (status < 0)
{
- fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__);
+ HDfprintf(stderr, "Error: %s %d> H5Treclaim failed.\n", FUNC, __LINE__);
ret = FAIL;
goto out;
}
diff --git a/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl b/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl
index affa93b..e78c5e2 100644
--- a/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl
+++ b/tools/test/h5repack/testfiles/SP.h5repack_fsm_aggr_nopersist.h5.ddl
@@ -11,6 +11,6 @@ File space page size: 4096 bytes
Summary of file space information:
File metadata: 1602 bytes
Raw data: 400 bytes
- Amount/Percent of tracked free space: 6307 bytes/38.5%
- Unaccounted space: 8075 bytes
-Total space: 16384 bytes
+ Amount/Percent of tracked free space: 6190 bytes/75.6%
+ Unaccounted space: 0 bytes
+Total space: 8192 bytes
diff --git a/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl b/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl
index 1ce06b2..3ecf9b1 100644
--- a/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl
+++ b/tools/test/h5repack/testfiles/SPT.h5repack_aggr.h5.ddl
@@ -11,6 +11,6 @@ File space page size: 4096 bytes
Summary of file space information:
File metadata: 1485 bytes
Raw data: 400 bytes
- Amount/Percent of tracked free space: 680 bytes/26.5%
+ Amount/Percent of tracked free space: 563 bytes/23.0%
Unaccounted space: 0 bytes
-Total space: 2565 bytes
+Total space: 2448 bytes
diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt
index 0eef0f5..130cd72 100644
--- a/tools/test/h5repack/testfiles/h5repack-help.txt
+++ b/tools/test/h5repack/testfiles/h5repack-help.txt
@@ -6,13 +6,17 @@ usage: h5repack [OPTIONS] file1 file2
-v, --verbose Verbose mode, print object information
-V, --version Print version number and exit
-n, --native Use a native HDF5 type when repacking
- --enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --enable-error-stack Prints messages from the HDF5 error stack as they
+ occur
-L, --latest Use latest version of file format
- This option will take precedence over the -j and -k options
- --low=BOUND The low bound for library release versions to use when creating
- objects in the file (default is H5F_LIBVER_EARLIEST)
- --high=BOUND The high bound for library release versions to use when creating
- objects in the file (default is H5F_LIBVER_LATEST)
+ This option will take precedence over the options
+ --low and --high
+ --low=BOUND The low bound for library release versions to use
+ when creating objects in the file
+ (default is H5F_LIBVER_EARLIEST)
+ --high=BOUND The high bound for library release versions to use
+ when creating objects in the file
+ (default is H5F_LIBVER_LATEST)
-c L1, --compact=L1 Maximum number of links in header messages
-d L2, --indexed=L2 Minimum number of links in the indexed format
-s S[:F], --ssize=S[:F] Shared object header message minimum size
@@ -27,10 +31,14 @@ usage: h5repack [OPTIONS] file1 file2
-z Z, --sort_order=Z Sort groups and attributes by order Z
-f FILT, --filter=FILT Filter type
-l LAYT, --layout=LAYT Layout type
- -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for H5Pset_file_space_strategy
- -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-space for H5Pset_file_space_strategy
- -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold for H5Pset_file_space_strategy
- -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for H5Pset_file_space_page_size
+ -S FS_STRATEGY, --fs_strategy=FS_STRATEGY File space management strategy for
+ H5Pset_file_space_strategy
+ -P FS_PERSIST, --fs_persist=FS_PERSIST Persisting or not persisting free-
+ space for H5Pset_file_space_strategy
+ -T FS_THRESHOLD, --fs_threshold=FS_THRESHOLD Free-space section threshold
+ for H5Pset_file_space_strategy
+ -G FS_PAGESIZE, --fs_pagesize=FS_PAGESIZE File space page size for
+ H5Pset_file_space_page_size
M - is an integer greater than 1, size of dataset in bytes (default is 0)
E - is a filename.
@@ -38,40 +46,51 @@ usage: h5repack [OPTIONS] file1 file2
U - is a filename.
T - is an integer
A - is an integer greater than zero
- Q - is the sort index type for the input file. It can be "name" or "creation_order" (default)
- Z - is the sort order type for the input file. It can be "descending" or "ascending" (default)
+ Q - is the sort index type for the input file. It can be "name" or
+ "creation_order" (default)
+ Z - is the sort order type for the input file. It can be "descending" or
+ "ascending" (default)
B - is the user block size, any value that is 512 or greater and is
a power of 2 (1024 default)
F - is the shared object header message type, any of <dspace|dtype|fill|
pline|attr>. If F is not specified, S applies to all messages
- BOUND is an integer indicating the library release versions to use when creating
- objects in the file (see H5Pset_libver_bounds()):
+ BOUND is an integer indicating the library release versions to use when
+ creating objects in the file (see H5Pset_libver_bounds()):
0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct
1: This is H5F_LIBVER_V18 in H5F_libver_t struct
2: This is H5F_LIBVER_V110 in H5F_libver_t struct
- (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release
+ 3: This is H5F_LIBVER_V112 in H5F_libver_t struct
+ 4: This is H5F_LIBVER_V114 in H5F_libver_t struct
+ (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V114 for this release
FS_STRATEGY is a string indicating the file space strategy used:
FSM_AGGR:
- The mechanisms used in managing file space are free-space managers, aggregators and virtual file driver.
+ The mechanisms used in managing file space are free-space
+ managers, aggregators and virtual file driver.
PAGE:
- The mechanisms used in managing file space are free-space managers with embedded paged aggregation and virtual file driver.
+ The mechanisms used in managing file space are free-space
+ managers with embedded paged aggregation and virtual file driver.
AGGR:
- The mechanisms used in managing file space are aggregators and virtual file driver.
+ The mechanisms used in managing file space are aggregators and
+ virtual file driver.
NONE:
- The mechanisms used in managing file space are virtual file driver.
- The default strategy when not set is FSM_AGGR without persisting free-space.
+ The mechanisms used in managing file space are virtual file
+ driver.
+ The default strategy when not set is FSM_AGGR without persisting free-
+ space.
FS_PERSIST is 1 to persisting free-space or 0 to not persisting free-space.
The default when not set is not persisting free-space.
The value is ignored for AGGR and NONE strategies.
- FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be tracked by the library.
+ FS_THRESHOLD is the minimum size (in bytes) of free-space sections to be
+ tracked by the library.
The default when not set is 1.
The value is ignored for AGGR and NONE strategies.
- FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when the file space strategy PAGE is used.
+ FS_PAGESIZE is the size (in bytes) >=512 that is used by the library when
+ the file space strategy PAGE is used.
The default when not set is 4096.
FILT - is a string with the format:
@@ -99,9 +118,9 @@ usage: h5repack [OPTIONS] file1 file2
NBIT (no parameter)
SOFF=<scale_factor,scale_type> scale_factor is an integer and scale_type
is either IN or DS
- UD=<filter_number,filter_flag,cd_value_count,value_1[,value_2,...,value_N]>
- required values for filter_number,filter_flag,cd_value_count,value_1
- optional values for value_2 to value_N
+ UD=<filter_number,filter_flag,cd_value_count,value1[,value2,...,valueN]>
+ Required values: filter_number, filter_flag, cd_value_count, value1
+ Optional values: value2 to valueN
NONE (no parameter)
LAYT - is a string with the format:
@@ -138,12 +157,7 @@ Examples of use:
4) h5repack -L -c 10 -s 20:dtype file1 file2
Using latest file format with maximum compact group size of 10 and
- and minimum shared datatype size of 20
-
-5) h5repack --low=0 --high=1 file1 file2
-
- Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via H5Pset_libver_bounds() when
- creating the repacked file: file2
+ minimum shared datatype size of 20
5) h5repack -f SHUF -f GZIP=1 file1 file2
@@ -153,3 +167,8 @@ Examples of use:
Add bzip2 filter to all datasets
+7) h5repack --low=0 --high=1 file1 file2
+
+ Set low=H5F_LIBVER_EARLIEST and high=H5F_LIBVER_V18 via
+ H5Pset_libver_bounds() when creating the repacked file, file2
+
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le.h5 b/tools/test/h5repack/testfiles/h5repack_f32le.h5
new file mode 100644
index 0000000..03a9b57
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat
new file mode 100644
index 0000000..8378fc2
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5 b/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5
new file mode 100644
index 0000000..ca6c49d
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_f32le_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5
new file mode 100644
index 0000000..7d60566
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat
new file mode 100644
index 0000000..f75ada5
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-0.dat
@@ -0,0 +1 @@
+úÿÿÿûÿÿÿüÿÿÿýÿÿÿþÿÿÿÿÿÿÿ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat
new file mode 100644
index 0000000..1f8f3b6
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex-1.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5
new file mode 100644
index 0000000..ba4b534
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_1d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5
new file mode 100644
index 0000000..2f32bd1
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat
new file mode 100644
index 0000000..c6bfc64
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5
new file mode 100644
index 0000000..f6cce59
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_2d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5
new file mode 100644
index 0000000..7a61ef5
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat
new file mode 100644
index 0000000..b505eb4
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5 b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5
new file mode 100644
index 0000000..7c4b750
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_int32le_3d_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
index 069fb3b..4e69148 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-dset2_chunk_20x10-errstk.tst
@@ -2,34 +2,43 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs):
#000: (file name) line (number) in H5Dcreate2(): unable to create dataset
major: Dataset
minor: Unable to initialize object
- #001: (file name) line (number) in H5D__create_named(): unable to create and link to dataset
+ #001: (file name) line (number) in H5VL_dataset_create(): dataset create failed
+ major: Virtual Object Layer
+ minor: Unable to create file
+ #002: (file name) line (number) in H5VL__dataset_create(): dataset create failed
+ major: Virtual Object Layer
+ minor: Unable to create file
+ #003: (file name) line (number) in H5VL__native_dataset_create(): unable to create dataset
major: Dataset
minor: Unable to initialize object
- #002: (file name) line (number) in H5L_link_object(): unable to create new link to object
+ #004: (file name) line (number) in H5D__create_named(): unable to create and link to dataset
+ major: Dataset
+ minor: Unable to initialize object
+ #005: (file name) line (number) in H5L_link_object(): unable to create new link to object
major: Links
minor: Unable to initialize object
- #003: (file name) line (number) in H5L__create_real(): can't insert link
+ #006: (file name) line (number) in H5L__create_real(): can't insert link
major: Links
minor: Unable to insert object
- #004: (file name) line (number) in H5G_traverse(): internal path traversal failed
+ #007: (file name) line (number) in H5G_traverse(): internal path traversal failed
major: Symbol table
minor: Object not found
- #005: (file name) line (number) in H5G__traverse_real(): traversal operator failed
+ #008: (file name) line (number) in H5G__traverse_real(): traversal operator failed
major: Symbol table
minor: Callback failed
- #006: (file name) line (number) in H5L__link_cb(): unable to create object
+ #009: (file name) line (number) in H5L__link_cb(): unable to create object
major: Links
minor: Unable to initialize object
- #007: (file name) line (number) in H5O_obj_create(): unable to open object
+ #010: (file name) line (number) in H5O_obj_create(): unable to open object
major: Object header
minor: Can't open object
- #008: (file name) line (number) in H5O__dset_create(): unable to create dataset
+ #011: (file name) line (number) in H5O__dset_create(): unable to create dataset
major: Dataset
minor: Unable to initialize object
- #009: (file name) line (number) in H5D__create(): unable to construct layout information
+ #012: (file name) line (number) in H5D__create(): unable to construct layout information
major: Dataset
minor: Unable to initialize object
- #010: (file name) line (number) in H5D__chunk_construct(): dimensionality of chunks doesn't match the dataspace
+ #013: (file name) line (number) in H5D__chunk_construct(): dimensionality of chunks doesn't match the dataspace
major: Dataset
minor: Bad value
H5tools-DIAG: Error detected in HDF5:tools (version (number)) thread (IDs):
diff --git a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
index 8f48c37..eeb0f2d 100644
--- a/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
+++ b/tools/test/h5repack/testfiles/h5repack_layout.h5-plugin_version_test.ddl
@@ -11,7 +11,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -33,7 +33,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -55,7 +55,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -77,7 +77,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -99,7 +99,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -121,7 +121,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
@@ -143,7 +143,7 @@ GROUP "/" {
USER_DEFINED_FILTER {
FILTER_ID 260
COMMENT dynlib4
- PARAMS { 9 1 11 3 }
+ PARAMS { 9 1 13 0 }
}
}
FILLVALUE {
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be.h5 b/tools/test/h5repack/testfiles/h5repack_uint8be.h5
new file mode 100644
index 0000000..0e25211
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be.h5
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat
new file mode 100644
index 0000000..f95b90a
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-0.dat
Binary files differ
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat
new file mode 100644
index 0000000..011ab48
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-1.dat
@@ -0,0 +1 @@
+@¿B½D»F¹H·JµL³N±P¯R­T«V©X§Z¥\£^¡`Ÿbd›f™h—j•l“n‘prt‹v‰x‡z…|ƒ~ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat
new file mode 100644
index 0000000..069b96d
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-2.dat
@@ -0,0 +1 @@
+€‚}„{†yˆwŠuŒsŽqo’m”k–i˜gšeœcža _¢]¤[¦Y¨WªU¬S®Q°O²M´K¶I¸GºE¼C¾A \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat
new file mode 100644
index 0000000..240d8ca
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex-3.dat
@@ -0,0 +1 @@
+À?Â=Ä;Æ9È7Ê5Ì3Î1Ð/Ò-Ô+Ö)Ø'Ú%Ü#Þ!àâäæèêìîðò ô ö øúüþ \ No newline at end of file
diff --git a/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5 b/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5
new file mode 100644
index 0000000..8787188
--- /dev/null
+++ b/tools/test/h5repack/testfiles/h5repack_uint8be_ex.h5
Binary files differ
diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c
index 6e7a24e..6b86dd5 100644
--- a/tools/test/h5repack/testh5repack_detect_szip.c
+++ b/tools/test/h5repack/testh5repack_detect_szip.c
@@ -50,10 +50,10 @@ int main(void)
#ifdef H5_HAVE_FILTER_SZIP
if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
- printf("yes\n");
+ HDprintf("yes\n");
return(1);
}
#endif /* H5_HAVE_FILTER_SZIP */
- printf("no\n");
+ HDprintf("no\n");
return(0);
}
diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt
index e65c76f..5c17fd5 100644
--- a/tools/test/h5stat/CMakeLists.txt
+++ b/tools/test/h5stat/CMakeLists.txt
@@ -4,14 +4,14 @@ project (HDF5_TOOLS_TEST_H5STAT C)
# --------------------------------------------------------------------
# Add the h5stat test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5stat_gentest ${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/h5stat_gentest.c)
- target_include_directories(h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ target_include_directories (h5stat_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
TARGET_C_PROPERTIES (h5stat_gentest STATIC)
target_link_libraries (h5stat_gentest PRIVATE ${HDF5_LIB_TARGET})
set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>)
+ #add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat_gentest>)
endif ()
include (CMakeTests.cmake)
diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake
index bd55ac1..9674a77 100644
--- a/tools/test/h5stat/CMakeTests.cmake
+++ b/tools/test/h5stat/CMakeTests.cmake
@@ -39,23 +39,30 @@
h5stat_newgrat
h5stat_newgrat-UG
h5stat_newgrat-UA
- h5stat_err1_links
h5stat_idx
h5stat_links1
h5stat_links2
h5stat_links3
h5stat_links4
h5stat_links5
- h5stat_err1_dims
h5stat_dims1
h5stat_dims2
- h5stat_err1_numattrs
- h5stat_err2_numattrs
h5stat_numattrs1
h5stat_numattrs2
h5stat_numattrs3
h5stat_numattrs4
)
+ set (HDF5_REFERENCE_ERR_FILES
+ h5stat_err_refcount
+ h5stat_err_old_layout
+ h5stat_err_old_fill
+ h5stat_err1_dims
+ h5stat_err1_links
+ h5stat_err1_numattrs
+ h5stat_err2_numattrs
+ h5stat_notexist
+ h5stat_nofile
+ )
set (HDF5_REFERENCE_TEST_FILES
h5stat_err_refcount.h5
h5stat_err_old_layout.h5
@@ -71,6 +78,10 @@
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${ddl_file}.ddl" "${PROJECT_BINARY_DIR}/${ddl_file}.ddl" "h5stat_files")
endforeach ()
+ foreach (h5_file ${HDF5_REFERENCE_ERR_FILES})
+ HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${h5_file}.err" "${PROJECT_BINARY_DIR}/${h5_file}.err" "h5stat_files")
+ endforeach ()
+
foreach (h5_file ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5STAT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/${h5_file}" "h5stat_files")
endforeach ()
@@ -82,39 +93,56 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
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")
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ if (${resultcode})
set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test})
- endif ()
else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5STAT-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.out
- ${resultfile}.out.err
+ NAME H5STAT-${resultfile}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
+ -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 "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test})
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_ERR_TEST resultfile resultcode)
+ # If using memchecker add tests without using scripts
+ if (HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN})
+ if (${resultcode})
+ set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true")
endif ()
+ else (HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5STAT-${resultfile}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5stat>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>"
-D "TEST_ARGS=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${resultfile}.out"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects)
endif ()
endmacro ()
@@ -131,13 +159,8 @@
endforeach ()
add_test (
NAME H5STAT-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove ${CLEAR_LIST}
+ COMMAND ${CMAKE_COMMAND} -E remove ${CLEAR_LIST}
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5STAT-clearall-objects")
endif ()
# Test for help flag
@@ -173,7 +196,7 @@
# -g -l 8
# --links=8
# --links=20 -g
- ADD_H5_TEST (h5stat_err1_links 1 -l 0 h5stat_threshold.h5)
+ ADD_H5_ERR_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)
@@ -188,7 +211,7 @@
# -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_ERR_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)
#
@@ -198,8 +221,8 @@
# -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_ERR_TEST (h5stat_err1_numattrs 1 -a -2 h5stat_threshold.h5)
+ ADD_H5_ERR_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)
diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c
index 2daf24b..2edfcf6 100644
--- a/tools/test/h5stat/h5stat_gentest.c
+++ b/tools/test/h5stat/h5stat_gentest.c
@@ -14,7 +14,7 @@
/*
* Generate the binary hdf5 files for the h5stat tests.
* Usage: just execute the program without any arguments will
- * generate all the binary hdf5 files
+ * 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
@@ -24,25 +24,25 @@
#include "H5private.h"
/* 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
+#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
/* Declarations for gen_idx_file() */
-#define IDX_FILE "h5stat_idx.h5"
-#define DSET "dset"
-#define DSET_FILTER "dset_filter"
+#define IDX_FILE "h5stat_idx.h5"
+#define DSET "dset"
+#define DSET_FILTER "dset_filter"
/* 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
+#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
/* For gen_err_refcount() */
#define ERR_REFCOUNT_FILE "h5stat_err_refcount.h5"
@@ -51,7 +51,7 @@
* Generate HDF5 file with latest format with
* NUM_GRPS groups and NUM_ATTRS attributes for the dataset
*/
-static void
+static void
gen_newgrat_file(const char *fname)
{
hid_t fcpl = -1; /* File creation property */
@@ -62,79 +62,66 @@ gen_newgrat_file(const char *fname)
hid_t sid = -1; /* Dataspace id */
hid_t attr_id = -1; /* Attribute id */
hid_t did = -1; /* Dataset id */
- char name[30]; /* Group name */
- char attrname[30]; /* Attribute name */
- int i; /* Local index variable */
+ 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;
+ goto error;
/* Set to use latest library format */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- goto error;
+ goto error;
/* Get a copy of file creation property list */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
- goto error;
+ goto error;
/* Set file space handling strategy */
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, 1, (hsize_t)1) < 0)
- goto error;
+ goto error;
/* Create file */
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
- goto error;
+ goto error;
/* Create NUM_GRPS groups in the root group */
for(i = 1; i <= NUM_GRPS; i++) {
- sprintf(name, "%s%d", GROUP_NAME,i);
+ HDsprintf(name, "%s%d", GROUP_NAME,i);
if((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
if(H5Gclose(gid) < 0)
- goto error;
+ goto error;
} /* end for */
/* Create a datatype to commit and use */
if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)
- goto error;
+ goto error;
/* Create dataspace for dataset */
if((sid = H5Screate(H5S_SCALAR)) < 0)
- goto error;
+ goto error;
/* Create dataset */
if((did = H5Dcreate2(fid, DATASET_NAME, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
/* Create NUM_ATTRS for the dataset */
for(i = 1; i <= NUM_ATTRS; i++) {
- sprintf(attrname, "%s%d", ATTR_NAME,i);
+ HDsprintf(attrname, "%s%d", ATTR_NAME,i);
if((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
if(H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
} /* end for */
/* Close dataset, dataspace, datatype, file */
- if(H5Pclose(fapl) < 0)
- goto error;
- if(H5Pclose(fcpl) < 0)
- goto error;
- 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 {
- H5Pclose(fapl);
- H5Pclose(fcpl);
- H5Aclose(attr_id);
+ H5Pclose(fapl);
+ H5Pclose(fcpl);
+ H5Aclose(attr_id);
H5Dclose(did);
H5Tclose(tid);
H5Sclose(sid);
@@ -145,192 +132,175 @@ error:
/*
* 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.
+ * -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 */
+ hid_t fid = -1; /* File ID */
+ hid_t sid0 = -1; /* Dataspace IDs */
+ hid_t sid1 = -1; /* Dataspace IDs */
+ hid_t sid2 = -1; /* Dataspace IDs */
+ hid_t sid3 = -1; /* Dataspace IDs */
+ hid_t sid4 = -1; /* Dataspace IDs */
+ hid_t did = -1; /* Dataset ID */
+ hid_t attr_id = -1; /* Attribute ID */
+ hid_t gid = -1; /* 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;
+ goto error;
/* Create 1-D dataspace with zero dimension size */
if((sid0 = H5Screate_simple(1, zero_dims, NULL)) < 0)
- goto error;
+ goto error;
/* Create 1-D dataspace with non-zero dimension size*/
if((sid1 = H5Screate_simple(1, one_dims, NULL)) < 0)
- goto error;
+ goto error;
/* Create 2-D dataspace */
if((sid2 = H5Screate_simple(2, two_dims, NULL)) < 0)
- goto error;
+ goto error;
/* Create scalar dataspace */
if((sid3 = H5Screate(H5S_SCALAR)) < 0)
- goto error;
+ goto error;
/* Create null dataspace */
if((sid4 = H5Screate(H5S_NULL)) < 0)
- goto error;
+ 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;
+ goto error;
if(H5Aclose(attr_id) < 0)
- goto error;
+ 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;
+ goto error;
/* Create 11 attributes for the dataset */
for(i = 1; i <= (THRES_NUM+1); i++) {
- sprintf(name, "%s%d", THRES_ATTR_NAME,i);
+ HDsprintf(name, "%s%d", THRES_ATTR_NAME,i);
if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
if(H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
}
if(H5Dclose(did) < 0)
- goto error;
+ 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;
+ goto error;
if(H5Dclose(did) < 0)
- goto error;
+ 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;
+ goto error;
if(H5Dclose(did) < 0)
- goto error;
+ 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;
+ 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);
+ HDsprintf(name, "%s%d", THRES_ATTR_NAME,i);
if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
if(H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
}
if(H5Dclose(did) < 0)
- goto error;
+ goto error;
/* Create first group */
if((gid = H5Gcreate2(fid, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ 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;
+ goto error;
/* Close attribute */
if(H5Aclose(attr_id) < 0)
- goto error;
+ 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);
+ /* set up dataset name */
+ HDsprintf(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;
+ /* Create the dataset */
+ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
- /* Close the dataset */
+ /* Close the dataset */
if(H5Dclose(did) < 0)
- goto error;
+ goto error;
}
/* Close the group */
if(H5Gclose(gid) < 0)
- goto error;
+ goto error;
/* Create second group */
if((gid = H5Gcreate2(fid, "group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ 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);
+ /* Set up attribute name */
+ HDsprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i);
- /* Create the attribute */
+ /* Create the attribute */
if((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
- /* Close the attribute */
+ /* Close the attribute */
if(H5Aclose(attr_id) < 0)
- goto error;
+ goto error;
}
/* Close the group */
if(H5Gclose(gid) < 0)
- goto error;
+ goto error;
/* Create third group */
if((gid = H5Gcreate2(fid, "group3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
- goto error;
+ 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);
+ /* set up dataset name */
+ HDsprintf(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;
+ /* Create the dataset */
+ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
- /* Close the dataset */
+ /* Close the dataset */
if(H5Dclose(did) < 0)
- goto error;
+ 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);
+ H5Aclose(attr_id);
H5Dclose(did);
H5Sclose(sid0);
H5Sclose(sid1);
@@ -346,84 +316,73 @@ error:
* Function: gen_idx_file
*
* Purpose: Create a file with datasets that use Fixed Array indexing:
- * one dataset: fixed dimension, chunked layout, w/o filters
- * one dataset: fixed dimension, chunked layout, w/ filters
+ * one dataset: fixed dimension, chunked layout, w/o filters
+ * one dataset: fixed dimension, chunked layout, w/ filters
*
*/
-static void
+static void
gen_idx_file(const char *fname)
{
- hid_t fapl = -1; /* file access property id */
- hid_t fid = -1; /* file id */
- hid_t sid = -1; /* space id */
- hid_t dcpl = -1; /* dataset creation property id */
- hid_t did = -1, did2 = -1; /* dataset id */
- hsize_t dims[1] = {10}; /* dataset dimension */
- hsize_t c_dims[1] = {2}; /* chunk dimension */
- int i; /* local index variable */
- int buf[10]; /* data buffer */
+ hid_t fapl = -1; /* file access property id */
+ hid_t fid = -1; /* file id */
+ hid_t sid = -1; /* space id */
+ hid_t dcpl = -1; /* dataset creation property id */
+ hid_t did = -1, did2 = -1; /* dataset id */
+ hsize_t dims[1] = {10}; /* dataset dimension */
+ hsize_t c_dims[1] = {2}; /* chunk dimension */
+ int i; /* local index variable */
+ int buf[10]; /* data buffer */
/* Get a copy of the file access property */
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
- goto error;
+ goto error;
/* Set the "use the latest format" bounds for creating objects in the file */
if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
- goto error;
+ goto error;
/* Create file */
if((fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
- goto error;
+ goto error;
/* Create data */
for(i = 0; i < 10; i++)
- buf[i] = i;
+ buf[i] = i;
/* Set chunk */
if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0)
- goto error;
+ goto error;
if(H5Pset_chunk(dcpl, 1, c_dims) < 0)
- goto error;
+ goto error;
/* Create a 1D dataset */
if((sid = H5Screate_simple(1, dims, NULL)) < 0)
- goto error;
+ goto error;
if((did = H5Dcreate2(fid, DSET, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
-
+ goto error;
+
/* Write to the dataset */
if(H5Dwrite(did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- goto error;
+ goto error;
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
if(H5Pset_deflate(dcpl, 9) < 0)
- goto error;
+ goto error;
/* Create and write the dataset */
if((did2 = H5Dcreate2(fid, DSET_FILTER, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
- goto error;
+ goto error;
if(H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
- goto error;
+ goto error;
/* Close the dataset */
if(H5Dclose(did2) < 0)
- goto error;
+ goto error;
#endif
/* closing: dataspace, dataset, file */
- if(H5Pclose(fapl) < 0)
- goto error;
- if(H5Pclose(dcpl) < 0)
- goto error;
- if(H5Sclose(sid) < 0)
- goto error;
- if(H5Dclose(did) < 0)
- goto error;
- if(H5Fclose(fid) < 0)
- goto error;
-
error:
H5E_BEGIN_TRY {
H5Pclose(fapl);
@@ -451,7 +410,7 @@ error:
* H5O_refcount_decode in the jira issue.
*
*/
-static void
+static void
gen_err_refcount(const char *fname)
{
hid_t fid = -1; /* File identifier */
@@ -525,16 +484,13 @@ gen_err_refcount(const char *fname)
/* Offset of the message ID to modify is as follows: */
/* 4520: the offset of the object header containing the attribute message
with the committed datatype */
- /* 24: the offset in the object header containing the version of the
+ /* 24: the offset in the object header containing the version of the
attribute message */
- if((fd = HDopen(fname, O_RDWR, 0633)) < 0)
- goto error;
- if(HDlseek(fd, 4520+24, SEEK_SET) < 0)
- goto error;
- if(HDwrite(fd, &val, 2) < 0)
- goto error;
- if(HDclose(fd) < 0)
- goto error;
+ if((fd = HDopen(fname, O_RDWR, 0633)) >= 0) {
+ HDlseek(fd, 4520+24, SEEK_SET);
+ HDwrite(fd, &val, 2);
+ HDclose(fd);
+ }
error:
H5E_BEGIN_TRY {
@@ -548,8 +504,8 @@ error:
} H5E_END_TRY;
} /* gen_err_refcount() */
-/*
- * The following two test files are generated with older versions
+/*
+ * The following two test files are generated with older versions
* of the library for HDFFV-10333. They are used for testing in
* testh5stat.sh.in.
*
@@ -559,7 +515,7 @@ error:
* Then a "0" is written to the "dimension" field in the layout
* message to trigger the error.
* This is to verify HDFFV-10333 that h5stat will exit gracefully
- * when encountered error similar to H5O__layout_decode in the
+ * when encountered error similar to H5O__layout_decode in the
* jira issue.
*
* (2) h5stat_err_old_fill.h5
@@ -568,7 +524,7 @@ error:
* Then an illegal size is written to the "size" fild in the
* fill value message to trigger the error.
* This is to verify HDFFV-10333 that h5stat will exit gracefully
- * when encountered error similar to H5O_fill_old_decode in the
+ * when encountered error similar to H5O_fill_old_decode in the
* jira issue.
*/
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_dims.ddl b/tools/test/h5stat/testfiles/h5stat_err1_dims.err
index 86d375b..86d375b 100644
--- a/tools/test/h5stat/testfiles/h5stat_err1_dims.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err1_dims.err
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_links.ddl b/tools/test/h5stat/testfiles/h5stat_err1_links.err
index d43207c..d43207c 100644
--- a/tools/test/h5stat/testfiles/h5stat_err1_links.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err1_links.err
diff --git a/tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl b/tools/test/h5stat/testfiles/h5stat_err1_numattrs.err
index 01b6c18..01b6c18 100644
--- a/tools/test/h5stat/testfiles/h5stat_err2_numattrs.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err1_numattrs.err
diff --git a/tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl b/tools/test/h5stat/testfiles/h5stat_err2_numattrs.err
index 01b6c18..01b6c18 100644
--- a/tools/test/h5stat/testfiles/h5stat_err1_numattrs.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err2_numattrs.err
diff --git a/tools/test/h5stat/testfiles/h5stat_err_old_fill.ddl b/tools/test/h5stat/testfiles/h5stat_err_old_fill.ddl
index e751b7f..5cc1e32 100644
--- a/tools/test/h5stat/testfiles/h5stat_err_old_fill.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err_old_fill.ddl
@@ -1,2 +1 @@
Filename: h5stat_err_old_fill.h5
-h5stat error: unable to traverse objects/links in file "h5stat_err_old_fill.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_err_old_fill.err b/tools/test/h5stat/testfiles/h5stat_err_old_fill.err
new file mode 100644
index 0000000..8b886d2
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err_old_fill.err
@@ -0,0 +1 @@
+h5stat error: unable to traverse objects/links in file "h5stat_err_old_fill.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_err_old_layout.ddl b/tools/test/h5stat/testfiles/h5stat_err_old_layout.ddl
index a3e27e2..112190c 100644
--- a/tools/test/h5stat/testfiles/h5stat_err_old_layout.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err_old_layout.ddl
@@ -1,2 +1 @@
Filename: h5stat_err_old_layout.h5
-h5stat error: unable to traverse objects/links in file "h5stat_err_old_layout.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_err_old_layout.err b/tools/test/h5stat/testfiles/h5stat_err_old_layout.err
new file mode 100644
index 0000000..7aa2fa7
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err_old_layout.err
@@ -0,0 +1 @@
+h5stat error: unable to traverse objects/links in file "h5stat_err_old_layout.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_err_refcount.ddl b/tools/test/h5stat/testfiles/h5stat_err_refcount.ddl
index 1f1b491..41e533e 100644
--- a/tools/test/h5stat/testfiles/h5stat_err_refcount.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_err_refcount.ddl
@@ -1,2 +1 @@
Filename: h5stat_err_refcount.h5
-h5stat error: unable to traverse objects/links in file "h5stat_err_refcount.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_err_refcount.err b/tools/test/h5stat/testfiles/h5stat_err_refcount.err
new file mode 100644
index 0000000..d176996
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_err_refcount.err
@@ -0,0 +1 @@
+h5stat error: unable to traverse objects/links in file "h5stat_err_refcount.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl
index 01e39af..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_help1.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl
@@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl
index 01e39af..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_help2.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl
@@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
index 7171320..2ba7772 100644
--- a/tools/test/h5stat/testfiles/h5stat_nofile.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl
@@ -23,4 +23,13 @@ Usage: h5stat [OPTIONS] file
-s, --freespace Print free space information
-S, --summary Print summary of file space information
--enable-error-stack Prints messages from the HDF5 error stack as they occur
-h5stat error: missing file name
+ --s3-cred=<cred> Access file on S3, using provided credential
+ <cred> :: (region,id,key)
+ If <cred> == "(,,)", no authentication is used.
+ --hdfs-attrs=<attrs> Access a file on HDFS with given configuration
+ attributes.
+ <attrs> :: (<namenode name>,<namenode port>,
+ <kerberos cache path>,<username>,
+ <buffer size>)
+ If an attribute is empty, a default value will be
+ used.
diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.err b/tools/test/h5stat/testfiles/h5stat_nofile.err
new file mode 100644
index 0000000..3b7e979
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_nofile.err
@@ -0,0 +1 @@
+h5stat error: missing file name
diff --git a/tools/test/h5stat/testfiles/h5stat_notexist.ddl b/tools/test/h5stat/testfiles/h5stat_notexist.ddl
index cc25e43..7f71941 100644
--- a/tools/test/h5stat/testfiles/h5stat_notexist.ddl
+++ b/tools/test/h5stat/testfiles/h5stat_notexist.ddl
@@ -1,2 +1 @@
Filename: notexist.h5
-h5stat error: unable to open file "notexist.h5"
diff --git a/tools/test/h5stat/testfiles/h5stat_notexist.err b/tools/test/h5stat/testfiles/h5stat_notexist.err
new file mode 100644
index 0000000..c1d9e54
--- /dev/null
+++ b/tools/test/h5stat/testfiles/h5stat_notexist.err
@@ -0,0 +1 @@
+h5stat error: unable to open file "notexist.h5"
diff --git a/tools/test/h5stat/testh5stat.sh.in b/tools/test/h5stat/testh5stat.sh.in
index 0a5127f..69b856e 100644
--- a/tools/test/h5stat/testh5stat.sh.in
+++ b/tools/test/h5stat/testh5stat.sh.in
@@ -79,6 +79,18 @@ $SRC_H5STAT_TESTFILES/h5stat_idx.h5
$SRC_H5STAT_TESTFILES/h5stat_threshold.h5
"
+LIST_ERR_TEST_FILES="
+$SRC_H5STAT_TESTFILES/h5stat_err_refcount.err
+$SRC_H5STAT_TESTFILES/h5stat_err_old_layout.err
+$SRC_H5STAT_TESTFILES/h5stat_err_old_fill.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_links.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_dims.err
+$SRC_H5STAT_TESTFILES/h5stat_err1_numattrs.err
+$SRC_H5STAT_TESTFILES/h5stat_err2_numattrs.err
+$SRC_H5STAT_TESTFILES/h5stat_notexist.err
+$SRC_H5STAT_TESTFILES/h5stat_nofile.err
+"
+
LIST_OTHER_TEST_FILES="
$SRC_H5STAT_TESTFILES/h5stat_err_refcount.ddl
$SRC_H5STAT_TESTFILES/h5stat_err_old_layout.ddl
@@ -100,17 +112,13 @@ $SRC_H5STAT_TESTFILES/h5stat_newgrat.ddl
$SRC_H5STAT_TESTFILES/h5stat_newgrat-UG.ddl
$SRC_H5STAT_TESTFILES/h5stat_newgrat-UA.ddl
$SRC_H5STAT_TESTFILES/h5stat_idx.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
@@ -120,7 +128,7 @@ $SRC_H5STAT_TESTFILES/h5stat_numattrs4.ddl
#
# copy test files and expected output files from source dirs to test dir
#
-COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES"
+COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_ERR_TEST_FILES $LIST_OTHER_TEST_FILES"
COPY_TESTFILES_TO_TESTDIR()
{
@@ -184,8 +192,9 @@ TESTING() {
#
TOOLTEST() {
expect="$TESTDIR/$1"
+ expect_err="$TESTDIR/`basename $1 .ddl`.err"
actual="$TESTDIR/`basename $1 .ddl`.out"
- actual_err="$TESTDIR/`basename $1 .ddl`.err"
+ actual_err="$TESTDIR/`basename $1 .ddl`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
shift
@@ -202,14 +211,17 @@ TOOLTEST() {
STDOUT_FILTER $actual
cp $actual_err $actual_err_sav
STDERR_FILTER $actual_err
- cat $actual_err >> $actual
if [ ! -f $expect ]; then
- # Create the expect file if it doesn't yet exist.
- echo " CREATED"
- cp $actual $expect
- echo " Expected result (*.ddl) missing"
- nerrors="`expr $nerrors + 1`"
+ # Compare error files if the expect file doesn't exist.
+ if $CMP $expect_err $actual_err; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ echo " Expected result (*.err) differs from actual result (*.out.err)"
+ nerrors="`expr $nerrors + 1`"
+ test yes = "$verbose" && $DIFF $expect_err $actual_err |sed 's/^/ /'
+ fi
elif $CMP $expect $actual; then
echo " PASSED"
else
diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt
index 556b5b2..a250222 100644
--- a/tools/test/misc/CMakeLists.txt
+++ b/tools/test/misc/CMakeLists.txt
@@ -4,35 +4,55 @@ project (HDF5_TOOLS_TEST_MISC C)
# --------------------------------------------------------------------
# Add the misc test executables
# --------------------------------------------------------------------
-if (HDF5_BUILD_GENERATORS)
+if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS)
add_executable (h5repart_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5repart_gentest.c)
- target_include_directories(h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5repart_gentest STATIC)
- target_link_libraries (h5repart_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5repart_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repart_gentest STATIC)
+ target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5repart_gentest SHARED)
+ target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools)
- #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>)
+ #add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_gentest>)
add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c)
- target_include_directories(h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5clear_gentest STATIC)
- target_link_libraries (h5clear_gentest PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5clear_gentest STATIC)
+ target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5clear_gentest SHARED)
+ target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET})
+ endif ()
set_target_properties (h5clear_gentest PROPERTIES FOLDER tools)
- #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>)
+ #add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear_gentest>)
add_subdirectory (vds)
endif ()
add_executable (h5repart_test ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/repart_test.c)
-target_include_directories(h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5repart_test STATIC)
-target_link_libraries (h5repart_test PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5repart_test PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5repart_test STATIC)
+ target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5repart_test SHARED)
+ target_link_libraries (h5repart_test PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5repart_test PROPERTIES FOLDER tools)
add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c)
-target_include_directories(clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (clear_open_chk STATIC)
-target_link_libraries (clear_open_chk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (clear_open_chk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (clear_open_chk STATIC)
+ target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (clear_open_chk SHARED)
+ target_link_libraries (clear_open_chk PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (clear_open_chk PROPERTIES FOLDER tools)
include (CMakeTestsRepart.cmake)
diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake
index a51d0e9..a2c494d 100644
--- a/tools/test/misc/CMakeTestsClear.cmake
+++ b/tools/test/misc/CMakeTestsClear.cmake
@@ -49,8 +49,6 @@
h5clear_missing_file.ddl
h5clear_noclose_after_size.ddl
h5clear_noclose_before_size.ddl
- h5clear_no_mdc_image.ddl
- h5clear_open_fail.ddl
h5clear_status_noclose_after_size.ddl
h5clear_usage.ddl
h5clear_user_equal_after_size.ddl
@@ -60,10 +58,17 @@
h5clear_user_less_after_size.ddl
h5clear_user_less_before_size.ddl
)
+ set (HDF5_REFERENCE_ERR_FILES
+ h5clear_no_mdc_image.err
+ h5clear_open_fail.err
+ )
foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES} ${HDF5_REFERENCE_TEST_FILES})
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5clear_files")
endforeach ()
+ foreach (h5_file ${HDF5_REFERENCE_ERR_FILES})
+ HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5clear_files")
+ endforeach ()
# make second copy of h5clear_sec2.h5
foreach (h5_file ${HDF5_SEC2_TEST_FILES})
HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" "h5clear_files")
@@ -78,33 +83,46 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# Need special dependencies for tests that use the same reference file
# This is an issue on Windows
macro (ADD_H5_CMP testname resultfile resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
- NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
+ NAME H5CLEAR_CMP-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.ddl"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_ERR_CMP testname resultfile resultcode)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
-D "TEST_EXPECT=${resultcode}"
- -D "TEST_REFERENCE=${resultfile}.ddl"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -D "TEST_ERRREF=${resultfile}.err"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
- set (last_test "H5CLEAR_CMP-${testname}")
endif ()
endmacro ()
@@ -112,26 +130,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_CMP-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}.out
- testfiles/${testname}.out.err
- testfiles/${testfile}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile}
+ )
add_test (
NAME H5CLEAR_CMP-copy_${testname}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}"
)
- set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects)
+ set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-${testname}-clear-objects
+ )
add_test (
NAME H5CLEAR_CMP-${testname}
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN};${testfile}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}.out"
@@ -139,8 +152,42 @@
-D "TEST_REFERENCE=${resultfile}.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname})
- set (last_test "H5CLEAR_CMP-${testname}")
+ set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-copy_${testname}
+ )
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_ERR_CMP_WITH_COPY testname resultcode resultfile testfile)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5CLEAR_CMP-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile}
+ )
+ add_test (
+ NAME H5CLEAR_CMP-copy_${testname}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}"
+ )
+ set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-${testname}-clear-objects
+ )
+ add_test (
+ NAME H5CLEAR_CMP-${testname}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=${ARGN};${testfile}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}.out"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -D "TEST_ERRREF=${resultfile}.err"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES
+ DEPENDS H5CLEAR_CMP-copy_${testname}
+ )
endif ()
endmacro ()
@@ -148,14 +195,12 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_RET-${testname}
- COMMAND $<TARGET_FILE:h5clear> ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN}
+ )
+ set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ WILL_FAIL "${resultcode}"
)
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WILL_FAIL "${resultcode}")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR_RET-${testname}")
endif ()
endmacro ()
@@ -163,28 +208,21 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR_FILESIZE_TEST-${testname}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- testfiles/${testname}_before_size.out
- testfiles/${testname}_before_size.out.err
- testfiles/${testname}_after_size.out
- testfiles/${testname}_after_size.out.err
- testfiles/${testname}.h5
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR_FILESIZE_TEST-${testname}-clear-objects PROPERTIES DEPENDS ${last_test})
- endif ()
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5
+ )
add_test (
NAME H5CLEAR_FILESIZE_TEST-copy_${testname}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5"
)
- set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects)
+ set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects
+ )
add_test (
NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_before_size.out"
@@ -192,34 +230,102 @@
-D "TEST_REFERENCE=${resultfile}_before_size.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname})
+ set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname}
+ )
if (NOT ${incr_size} MATCHES "NONE")
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND $<TARGET_FILE:h5clear> --increment=${incr_size} ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5
)
else ()
add_test (
NAME H5CLEAR_FILESIZE_INCR-${testname}
- COMMAND $<TARGET_FILE:h5clear> --increment ${testname}.h5
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5
)
endif ()
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WILL_FAIL "${resultcode}")
- set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size)
+ set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ WILL_FAIL "${resultcode}"
+ DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size
+ )
add_test (
NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5clear>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
-D "TEST_ARGS:STRING=--filesize;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${testname}_after_size.out"
+ -D "TEST_EXPECT=0"
+ -D "TEST_REFERENCE=${resultfile}_after_size.ddl"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_INCR-${testname}
+ )
+ endif ()
+ endmacro ()
+
+ macro (ADD_H5_FILESIZE_FAIL_TEST testname resultcode resultfile incr_size)
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname}
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
+ "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname} PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=--filesize;${testname}.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}_before_size.out"
-D "TEST_EXPECT=${resultcode}"
+ -D "TEST_REFERENCE=${resultfile}.mty"
+ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
+ )
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname}
+ )
+ if (NOT ${incr_size} MATCHES "NONE")
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5
+ )
+ else ()
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5
+ )
+ endif ()
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size
+ )
+ add_test (
+ NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>"
+ -D "TEST_ARGS:STRING=--filesize;${testname}.h5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
+ -D "TEST_OUTPUT=${testname}_after_size.out"
+ -D "TEST_EXPECT=0"
-D "TEST_REFERENCE=${resultfile}_after_size.ddl"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_INCR-${testname})
- set (last_test "H5CLEAR_FILESIZE_CMP-${testname}_after_size")
+ set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size PROPERTIES
+ DEPENDS H5CLEAR_FILESIZE_FAIL_INCR-${testname}
+ )
endif ()
endmacro ()
@@ -227,32 +333,39 @@
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5CLEAR-clr_open_chk-copy_${testname}.h5
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/testfiles/${testfile}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testfile}.h5"
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clr_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-clr_open_chk-copy_${testname}.h5")
# Initial file open fails OR
# File open succeeds because the library does not check status_flags for file with < v3 superblock
- add_test (NAME H5CLEAR-clr_open_chk-${testname}_${resultcode} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5)
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WILL_FAIL "${resultcode}")
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES DEPENDS ${last_test})
- endif ()
+ add_test (
+ NAME H5CLEAR-clr_open_chk-${testname}_${resultcode}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES
+ WILL_FAIL "${resultcode}"
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ DEPENDS H5CLEAR-clr_open_chk-copy_${testname}.h5
+ )
# After "h5clear" the file, the subsequent file open succeeds
- add_test (NAME H5CLEAR-h5clr-${testname} COMMAND $<TARGET_FILE:h5clear> -s ${testfile}.h5)
- set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode})
- set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- add_test (NAME H5CLEAR-clr_open_chk-${testname} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5)
- set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES DEPENDS H5CLEAR-h5clr-${testname})
- set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
- set (last_test "H5CLEAR-clr_open_chk-${testname}")
+ add_test (
+ NAME H5CLEAR-h5clr-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES
+ DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode}
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ add_test (
+ NAME H5CLEAR-clr_open_chk-${testname}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5
+ )
+ set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES
+ DEPENDS H5CLEAR-h5clr-${testname}
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
endif ()
endmacro ()
@@ -264,73 +377,6 @@
#
#
#
-# The following are tests to verify the status_flags field is cleared properly:
-if (HDF5_ENABLE_USING_MEMCHECKER)
- # Remove any output file left over from previous test run
- add_test (
- NAME H5CLEAR-clearall-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- h5clear_log_v3.h5
- h5clear_mdc_image.h5
- h5clear_sec2_v0.h5
- h5clear_sec2_v2.h5
- h5clear_sec2_v3.h5
- orig_h5clear_sec2_v0.h5
- orig_h5clear_sec2_v2.h5
- orig_h5clear_sec2_v3.h5
- latest_h5clear_log_v3.h5
- latest_h5clear_sec2_v3.h5
- mod_h5clear_mdc_image.h5
- mod_h5clear_mdc_image2.h5
- ${HDF5_TEST_FILES}
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-clearall-objects")
-
- foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES})
- add_test (
- NAME H5CLEAR-copy_${h5_file}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_${h5_file} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_${h5_file}")
- endforeach ()
- # make second copy of h5clear_sec2.h5
- foreach (h5_file ${HDF5_SEC2_TEST_FILES})
- add_test (
- NAME H5CLEAR-copy_orig_${h5_file}
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_orig_${h5_file} PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_orig_${h5_file}")
- endforeach ()
- # make second copy of mod_h5clear_mdc_image.h5
- add_test (
- NAME H5CLEAR-copy_mod_h5clr_mdc_image2.h5
- COMMAND ${CMAKE_COMMAND}
- -E copy_if_different
- "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5"
- )
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5CLEAR-copy_mod_h5clr_mdc_image2.h5 PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5CLEAR-copy_mod_h5clr_mdc_image2.h5")
-endif()
-
-#
-#
-#
# The following are tests to verify the expected output from h5clear
# "h5clear -h"
# "h5clear" (no options, no file)
@@ -347,11 +393,11 @@ endif()
ADD_H5_CMP (h5clr_usage_junk h5clear_usage 1 "" junk.h5)
ADD_H5_CMP (h5clr_usage_none h5clear_usage 1 "" orig_h5clear_sec2_v3.h5)
ADD_H5_CMP (h5clr_missing_file_m h5clear_missing_file 1 "-m")
- ADD_H5_CMP (h5clr_open_fail_s h5clear_open_fail 1 "-s" junk.h5)
+ ADD_H5_ERR_CMP (h5clr_open_fail_s h5clear_open_fail 1 "-s" junk.h5)
ADD_H5_CMP (h5clr_missing_file_ms h5clear_missing_file 1 "-m" "-s")
- ADD_H5_CMP (h5clr_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5)
- ADD_H5_CMP (h5clr_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5)
- ADD_H5_CMP (h5clr_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5)
+ ADD_H5_ERR_CMP (h5clr_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5)
+ ADD_H5_ERR_CMP (h5clr_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5)
+ ADD_H5_ERR_CMP (h5clr_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5)
#
#
#
@@ -382,8 +428,8 @@ endif()
#
#
# h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear:
- ADD_H5_CMP (h5clr_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5)
- ADD_H5_CMP (h5clr_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5)
+ ADD_H5_ERR_CMP (h5clr_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5)
+ ADD_H5_ERR_CMP (h5clr_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5)
#
#
#
@@ -404,9 +450,7 @@ endif()
# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0)
# (no output, check exit code)
# "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action)
- ADD_H5_CMP_WITH_COPY (h5clr_open_fail_nc_s 1 h5clear_open_fail h5clear_status_noclose.h5 "--filesize")
- ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5)
- ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5)
+ ADD_H5_FILESIZE_FAIL_TEST (h5clear_status_noclose 1 h5clear_status_noclose 0)
#
# (2) h5clear_fsm_persist_noclose.h5
# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action)
diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake
index e99983b..11fa3f2 100644
--- a/tools/test/misc/CMakeTestsMkgrp.cmake
+++ b/tools/test/misc/CMakeTestsMkgrp.cmake
@@ -54,34 +54,34 @@
##############################################################################
##############################################################################
- 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 ()
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+ macro (ADD_H5_TEST resultfile resultcode resultoption)
+ add_test (
+ NAME H5MKGRP-${resultfile}-clear-objects
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
add_test (
NAME H5MKGRP-${resultfile}
- COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${resultfile}.h5 ${ARGN}
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${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 ()
- else (HDF5_ENABLE_USING_MEMCHECKER)
- set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects)
+ set_tests_properties (H5MKGRP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP-${resultfile}-clear-objects
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
+ )
+ if (NOT HDF5_ENABLE_USING_MEMCHECKER)
add_test (
NAME H5MKGRP-${resultfile}-h5ls
COMMAND "${CMAKE_COMMAND}"
- -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>"
-D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -96,21 +96,20 @@
macro (ADD_H5_CMP resultfile resultcode)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN})
+ add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp> ${ARGN})
else ()
add_test (
NAME H5MKGRP_CMP-${resultfile}-clear-objects
- COMMAND ${CMAKE_COMMAND}
- -E remove
- ${resultfile}.h5
- ${resultfile}.out
- ${resultfile}.out.err
+ COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5
+ )
+ set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- 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_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
-D "TEST_OUTPUT=${resultfile}.out"
@@ -118,7 +117,9 @@
-D "TEST_REFERENCE=${resultfile}.txt"
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
- set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects)
+ set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES
+ DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects
+ )
endif ()
endmacro ()
@@ -130,54 +131,23 @@
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
+ COMMAND ${CMAKE_COMMAND} -E remove
+ h5mkgrp_single.h5
+ h5mkgrp_single_v.h5
+ h5mkgrp_single_p.h5
+ h5mkgrp_single_l.h5
+ h5mkgrp_several.h5
+ h5mkgrp_several_v.h5
+ h5mkgrp_several_p.h5
+ h5mkgrp_several_l.h5
+ h5mkgrp_nested_p.h5
+ h5mkgrp_nested_lp.h5
+ h5mkgrp_nested_mult_p.h5
+ h5mkgrp_nested_mult_lp.h5
+ )
+ set_tests_properties (H5MKGRP-clearall-objects PROPERTIES
+ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles"
)
- 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 ()
- set (last_test "H5MKGRP-clearall-objects")
endif ()
# Check that help & version is displayed properly
diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake
index 37da903..fa49c53 100644
--- a/tools/test/misc/CMakeTestsRepart.cmake
+++ b/tools/test/misc/CMakeTestsRepart.cmake
@@ -58,6 +58,12 @@
##############################################################################
##############################################################################
+ if (NOT BUILD_SHARED_LIBS)
+ set (tgt_ext "")
+ else ()
+ set (tgt_ext "-shared")
+ endif ()
+
# Remove any output file left over from previous test run
add_test (
NAME H5REPART-clearall-objects
@@ -68,28 +74,55 @@
scd_family00001.h5
scd_family00002.h5
scd_family00003.h5
+ family_to_single.h5
family_to_sec2.h5
)
- if (NOT "${last_test}" STREQUAL "")
- set_tests_properties (H5REPART-clearall-objects PROPERTIES DEPENDS ${last_test})
- endif ()
- set (last_test "H5REPART-clearall-objects")
+ set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart)
# 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)
+ add_test (
+ NAME H5REPART-h5repart_20K
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5
+ )
+ set_tests_properties (H5REPART-h5repart_20K PROPERTIES
+ FIXTURES_REQUIRED clear_testrepart
+ )
# 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)
+ add_test (
+ NAME H5REPART-h5repart_5K
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5
+ )
+ set_tests_properties (H5REPART-h5repart_5K PROPERTIES
+ FIXTURES_REQUIRED clear_testrepart
+ )
# 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)
+ add_test (
+ NAME H5REPART-h5repart_single
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
+ )
+ set_tests_properties (H5REPART-h5repart_single PROPERTIES
+ FIXTURES_REQUIRED clear_testrepart
+ )
+
+ # convert family file to sec2 file of 20,000 bytes (old argument)
+ add_test (
+ NAME H5REPART-h5repart_sec2
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
+ )
+ set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES
+ FIXTURES_REQUIRED clear_testrepart
+ )
# 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;H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_sec2")
+ add_test (
+ NAME H5REPART-h5repart_test
+ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_test>
+ )
+ set_tests_properties (H5REPART-h5repart_test PROPERTIES
+ DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2"
+ )
set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES}
h5repart_test
diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c
index 88c8ea5..96d7e75e7 100644
--- a/tools/test/misc/h5clear_gentest.c
+++ b/tools/test/misc/h5clear_gentest.c
@@ -15,10 +15,10 @@
/* The HDF5 test files */
const char *FILENAME[] = {
- "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */
- "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */
- "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */
- "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */
+ "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */
+ "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */
+ "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */
+ "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */
};
const char *FILENAME_ENHANCE[] = {
@@ -28,12 +28,12 @@ const char *FILENAME_ENHANCE[] = {
"h5clear_fsm_persist_user_equal.h5", /* 3: user block, persisting free-space, stored EOA = actual EOF */
"h5clear_fsm_persist_user_greater.h5", /* 4: user block, persisting free-space, stored EOA > actual EOF */
"h5clear_fsm_persist_user_less.h5", /* 5: user block, persisting free-space, stored EOA < actual EOF */
- "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit,
+ "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit,
stored EOA < actual EOF */
"h5clear_fsm_persist_noclose.h5" /* 7 -- persisting free-space, no flush, exit, stored EOA < actual EOF */
};
-#define KB 1024U
+#define KB 1024U
#define CACHE_IMAGE_FILE "h5clear_mdc_image.h5"
#define DSET "DSET"
@@ -42,14 +42,14 @@ const char *FILENAME_ENHANCE[] = {
#define USERBLOCK 512
/*-------------------------------------------------------------------------
- * Function: gen_cache_image_file
+ * Function: gen_cache_image_file
*
- * Purpose: To create a file with cache image feature enabled.
+ * Purpose: To create a file with cache image feature enabled.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; March 2017
+ * Programmer: Vailin Choi; March 2017
*
*-------------------------------------------------------------------------
*/
@@ -136,9 +136,9 @@ error:
} /* gen_cache_image_file() */
/*-------------------------------------------------------------------------
- * Function: gen_enhance_files
+ * Function: gen_enhance_files
*
- * Purpose: To create the first 6 files in FILENAME_ENHANCE[]:
+ * Purpose: To create the first 6 files in FILENAME_ENHANCE[]:
* (0) FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
* (1) FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5"
* (2) FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5"
@@ -149,15 +149,15 @@ error:
* value to the location where the EOA is stored in the superblock.
* Also modify the chksum in the superblock due to this change.
*
- * The first call to this routine (without user block) will generate
+ * The first call to this routine (without user block) will generate
* the first 3 files.
* The second call to this routine (with user block) will generate
* the last 3 files.
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; March 2017
+ * Programmer: Vailin Choi; March 2017
*
*-------------------------------------------------------------------------
*/
@@ -172,7 +172,7 @@ gen_enhance_files(hbool_t user)
int data[NUM_ELMTS]; /* Buffer for data */
int fd = -1; /* The file descriptor ID */
int64_t eoa; /* The EOA value */
- int32_t chksum; /* The chksum value */
+ uint32_t chksum; /* The chksum value */
int i = 0 , j = 0, u = 0; /* Local index variable */
/* Get a copy of the default file creation property */
@@ -190,7 +190,7 @@ gen_enhance_files(hbool_t user)
if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0)
goto error;
- /*
+ /*
* Create the file, then write invalid EOA to the file.
*/
for(i = 0+u; i < 3+u; i++) {
@@ -221,21 +221,21 @@ gen_enhance_files(hbool_t user)
if(H5Fclose(fid) < 0)
goto error;
- /*
+ /*
* No further action for:
- * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
+ * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5"
* --FILENAME_ENHANCE[3]: "h5clear_fsm_persist_user_equal.h5",
*/
if(!(i % 3))
continue;
- /*
+ /*
* For the following files:
* --FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5"
* --FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5"
* --FILENAME_ENHANCE[4]: "h5clear_fsm_persist_greater.h5"
* --FILENAME_ENHANCE[5]: "h5clear_fsm_persist_less.h5"
*
- * Write invalid value to the location for stored eoa and
+ * Write invalid value to the location for stored eoa and
* update the chksum value.
*/
/* Open the file */
@@ -306,9 +306,9 @@ error:
} /* gen_enhance_files() */
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Generate test files used by h5clear.
+ * Purpose: Generate test files used by h5clear.
*
* (A) gen_cache_image_file():
* --generate a file with cache image feature
@@ -317,10 +317,10 @@ error:
* --generate the first 6 files in FILENAME_ENHANCE[]:
* (0) "h5clear_fsm_persist_equal.h5"
* (1) "h5clear_fsm_persist_greater.h5"
- * (2) "h5clear_fsm_persist_less.h5"
- * (3) "h5clear_fsm_persist_user_equal.h5"
+ * (2) "h5clear_fsm_persist_less.h5"
+ * (3) "h5clear_fsm_persist_user_equal.h5"
* (4) "h5clear_fsm_persist_user_greater.h5"
- * (5) "h5clear_fsm_persist_user_less.h5"
+ * (5) "h5clear_fsm_persist_user_less.h5"
*
* (C) Generate the following FILENAME[] files in main():
* (0a) "h5clear_sec2_v3.h5"
@@ -328,43 +328,43 @@ error:
* (1a) "h5clear_log_v3.h5",
* (1b) "latest_h5clear_log_v3.h5"
* (2) "h5clear_sec2_v0.h5"
- * (3) "h5clear_sec2_v2.h5"
- *
- * These HDF5 files are created with non-zero status_flags in
+ * (3) "h5clear_sec2_v2.h5"
+ *
+ * These HDF5 files are created with non-zero status_flags in
* the superblock via flushing and exiting without closing the
* library.
- * Due to file locking, status_flags in the superblock will be
- * nonzero after H5Fcreate. The library will clear status_flags
- * on file closing.
+ * Due to file locking, status_flags in the superblock will be
+ * nonzero after H5Fcreate. The library will clear status_flags
+ * on file closing.
* This program, after "H5Fcreate" the files, exits without
- * going through library closing. Thus, status_flags for these
- * files are not cleared.
- * The library will check consistency of status_flags when
- * opening a file with superblock >= v3 and will return error
+ * going through library closing. Thus, status_flags for these
+ * files are not cleared.
+ * The library will check consistency of status_flags when
+ * opening a file with superblock >= v3 and will return error
* accordingly.
- * The library will not check status_flags when opening a file
- * with < v3 superblock.
- * These files are used by "h5clear" to see if the tool clears
- * status_flags properly so users can open the files afterwards.
- *
+ * The library will not check status_flags when opening a file
+ * with < v3 superblock.
+ * These files are used by "h5clear" to see if the tool clears
+ * status_flags properly so users can open the files afterwards.
+ *
* (D) Generate the last two files in FILENAME_ENHANCE[] in main():
- * (6) "h5clear_status_noclose.h5",
+ * (6) "h5clear_status_noclose.h5",
* (7) "h5clear_fsm_persist_noclose.h5"
*
- * Return: Success: 0
- * Failure: 1
+ * Return: Success: 0
+ * Failure: 1
*
- * Programmer: Vailin Choi; July 2013
+ * Programmer: Vailin Choi; July 2013
*
*-------------------------------------------------------------------------
*/
int
main(void)
{
- hid_t fid = -1; /* File ID */
- hid_t fcpl = -1; /* File creation property list */
- hid_t fapl = -1, new_fapl = -1; /* File access property lists */
- char fname[512]; /* File name */
+ hid_t fid = -1; /* File ID */
+ hid_t fcpl = -1; /* File creation property list */
+ hid_t fapl = -1, new_fapl = -1; /* File access property lists */
+ char fname[512]; /* File name */
unsigned new_format; /* To use latest library format or not */
hid_t sid = -1; /* Dataspace ID */
hid_t did = -1; /* Dataset ID */
@@ -382,7 +382,7 @@ main(void)
if(gen_enhance_files(TRUE) < 0)
goto error;
- /*
+ /*
* Generate files in FILENAME[]
*/
/* Create a copy of the file access property list */
@@ -396,13 +396,13 @@ main(void)
if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
goto error;
- /*
+ /*
* Files created within this for loop will have v3 superblock and nonzero status_flags
* --FILENAME[0]: "h5clear_sec2_v3.h5", "latest_h5clear_sec2_v3.h5"
* --FILENAME[1]: "h5clear_log_v3.h5", "latest_h5clear_log_v3.h5"
*/
for(new_format = FALSE; new_format <= TRUE; new_format++) {
- hid_t fapl2, my_fapl; /* File access property lists */
+ hid_t fapl2, my_fapl; /* File access property lists */
/* Set to use the appropriate file access property list */
if(new_format)
@@ -415,14 +415,14 @@ main(void)
if((my_fapl = H5Pcopy(fapl2)) < 0)
goto error;
/* Create the file */
- sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
- if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
+ HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
goto error;
/* Flush the file */
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
goto error;
-
+
/* Close the property list */
if(H5Pclose(my_fapl) < 0)
goto error;
@@ -439,8 +439,8 @@ main(void)
goto error;
/* Create the file */
- sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
- if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
+ HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]);
+ if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0)
goto error;
/* Flush the file */
@@ -453,11 +453,11 @@ main(void)
} /* end for */
- /*
+ /*
* Create a sec2 file with v0 superblock but nonzero status_flags:
* FILENAME[2]: "h5clear_sec2_v0.h5"
*/
- if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
+ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
goto error;
/* Flush the file */
@@ -465,9 +465,9 @@ main(void)
goto error;
- /*
+ /*
* Create a sec2 file with v2 superblock but nonzero status_flags:
- * FILENAME[3]: "h5clear_sec2_v2.h5"
+ * FILENAME[3]: "h5clear_sec2_v2.h5"
*/
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
goto error;
@@ -476,14 +476,14 @@ main(void)
if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0)
goto error;
- if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
+ if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0)
goto error;
/* Flush the file */
if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0)
goto error;
-
+
/* Close the property lists */
if(H5Pclose(fapl) < 0)
goto error;
@@ -492,10 +492,10 @@ main(void)
if(H5Pclose(fcpl) < 0)
goto error;
- /*
+ /*
* Create the last two files in FILENAME_ENHANCE[]:
* --FILENAME_ENHANCE[6]: h5clear_status_noclose.h5
- * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
+ * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
*/
/*
* FILENAME_ENHANCE[6]: h5clear_status_noclose.h5
@@ -503,7 +503,7 @@ main(void)
* --version 3 superblock
* --nonzero status_flags
* --does not persist free-space
- * --does not flush the file, just exit without closing file:
+ * --does not flush the file, just exit without closing file:
* --this file is similar to the user-suppplied test file attached with HDFFV-10347
*/
if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
@@ -542,8 +542,8 @@ main(void)
/* Does not flush and does not close the file */
- /*
- * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
+ /*
+ * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5
* --stored EOA < actual EOF
* --persisting free-space
* --undefined fsinfo.eoa_pre_fsm_fsalloc
diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c
index 3784278..f50e5fb 100644
--- a/tools/test/misc/h5perf_gentest.c
+++ b/tools/test/misc/h5perf_gentest.c
@@ -10,8 +10,8 @@
* help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*****************************************************************************
- This test generates attributes, groups, and datasets of many types. It
- creates a large number of attributes, groups, and datasets by specifying
+ This test generates attributes, groups, and datasets of many types. It
+ creates a large number of attributes, groups, and datasets by specifying
-a, -g, -d options respectively. Using "-h" option to see details.
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
@@ -31,7 +31,7 @@
#define MAXVLEN 10
#define FIXED_LEN 8
-typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
+typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t;
typedef struct {
int i;
@@ -43,24 +43,24 @@ typedef struct {
float f_array[FIXED_LEN];
hvl_t i_vlen;
char *s_vlen;
-} test_comp_t;
+} test_comp_t;
typedef struct {
int zipcode;
char *city;
-} zipcode_t;
+} zipcode_t;
int add_attrs(hid_t oid, int idx);
int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ;
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest);
+herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
+ int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
+ int compressed, int latest);
int main (int argc, char *argv[])
{
char fname[32];
- int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
- chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
+ int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0,
+ chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0;
memset(fname, 0, 32);
for (i=1; i<argc; i++) {
@@ -83,92 +83,92 @@ int main (int argc, char *argv[])
else if (strcmp(argv[i], "-l")==0)
l = 1;
else if (strcmp(argv[i], "-z")==0)
- z = 1;
+ z = 1;
else if (strcmp(argv[i], "-h")==0) {
- printf("\nOPTONS:\n");
- printf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
- printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
- printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
- printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
- printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
- printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
- printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
- printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
- printf("\t-l:\tuse latest format (default: no).\n");
- printf("\t-z:\tuse gzip compression (default: no).\n");
- printf("\t-h:\tthis help information.\n");
- printf("Example:\n");
- printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
+ HDprintf("\nOPTONS:\n");
+ HDprintf("\t-f F:\tname of the test file (default: %s).\n", FNAME);
+ HDprintf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS);
+ HDprintf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS);
+ HDprintf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS);
+ HDprintf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS);
+ HDprintf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0);
+ HDprintf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1));
+ HDprintf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN);
+ HDprintf("\t-l:\tuse latest format (default: no).\n");
+ HDprintf("\t-z:\tuse gzip compression (default: no).\n");
+ HDprintf("\t-h:\tthis help information.\n");
+ HDprintf("Example:\n");
+ HDprintf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n");
exit(0);
}
}
-
+
if (strlen(fname)<=0)
- sprintf(fname, FNAME);
+ HDsprintf(fname, FNAME);
+
+ create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
+ (hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
- create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows,
- (hsize_t)dim0, (hsize_t)chunk, vlen, z, l);
-
return 0;
}
/*****************************************************************************
- This function generates attributes, groups, and datasets of many types.
+ This function generates attributes, groups, and datasets of many types.
Parameters:
- fname: file_name.
- ngrps: number of top level groups.
- ndsets: number of datasets.
- attrs: number of attributes.
- nrow: number of rows in a dataset.
- chunk: chunk size (single number).
- vlen: max vlen size.
- comp: use latest format.
- latest: use gzip comnpression.
-
+ fname: file_name.
+ ngrps: number of top level groups.
+ ndsets: number of datasets.
+ attrs: number of attributes.
+ nrow: number of rows in a dataset.
+ chunk: chunk size (single number).
+ vlen: max vlen size.
+ comp: use latest format.
+ latest: use gzip comnpression.
+
Return: Non-negative on success/Negative on failure
-
+
Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013
****************************************************************************/
-herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
- int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
- int compressed, int latest)
+herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
+ int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen,
+ int compressed, int latest)
{
int i, j, k;
- hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
- fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
- tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
+ hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large,
+ fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str,
+ tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s;
char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32];
- hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
- dim1[1]={2};
+ hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN},
+ dim1[1]={2};
char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"};
test_comp_t *buf_comp=NULL, *buf_comp_large=NULL;
int *buf_int=NULL;
float (*buf_float_a)[FIXED_LEN]=NULL;
double **buf_double2d=NULL;
hvl_t *buf_vlen_i=NULL;
- char (*buf_str)[FIXED_LEN];
- char **buf_vlen_s=NULL;
- hobj_ref_t buf_ref[2];
- hdset_reg_ref_t buf_reg_ref[2];
+ char (*buf_str)[FIXED_LEN];
+ char **buf_vlen_s=NULL;
+ hobj_ref_t buf_ref[2];
+ hdset_reg_ref_t buf_reg_ref[2];
size_t offset, len;
herr_t status;
- char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
- "enum", "fixed float array", "vlen int array", "vlen strings"};
- hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
+ char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string",
+ "enum", "fixed float array", "vlen int array", "vlen strings"};
+ hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT,
H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s};
- hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
-
- if (nrows < NROWS) nrows = NROWS;
+ hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1;
+
+ if (nrows < NROWS) nrows = NROWS;
if (ngrps<NGROUPS) ngrps=NGROUPS;
- if (ndsets<NDSETS) ndsets=NDSETS;
- if (nattrs<NATTRS) nattrs=NATTRS;
- if (dim0<DIM0) dim0=DIM0;
+ if (ndsets<NDSETS) ndsets=NDSETS;
+ if (nattrs<NATTRS) nattrs=NATTRS;
+ if (dim0<DIM0) dim0=DIM0;
if (chunk>dim0) chunk=dim0/4;
if (chunk<1) chunk = 1;
- if (vlen<1) vlen = MAXVLEN;
+ if (vlen<1) vlen = MAXVLEN;
- /* create fixed string datatype */
+ /* create fixed string datatype */
types[4] = tid_str = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_str, FIXED_LEN);
@@ -181,15 +181,15 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
/* create float array datatype */
types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array);
-
+
/* create variable length integer datatypes */
types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT);
-
+
/* create variable length string datatype */
types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1);
H5Tset_size (tid_vlen_s, H5T_VARIABLE);
-
- /* create compound datatypes */
+
+ /* create compound datatypes */
cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t));
offset = 0;
for (i=0; i<NTYPES-2; i++) {
@@ -197,31 +197,31 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
offset += H5Tget_size(types[i]);
}
- H5Tinsert(cmp_tid, names[7], offset, types[7]);
- offset += sizeof (hvl_t);
- H5Tinsert(cmp_tid, names[8], offset, types[8]);
+ H5Tinsert(cmp_tid, names[7], offset, types[7]);
+ offset += sizeof (hvl_t);
+ H5Tinsert(cmp_tid, names[8], offset, types[8]);
- /* create dataspace */
+ /* create dataspace */
sid_1d = H5Screate_simple (1, dims, NULL);
sid_2d = H5Screate_simple (2, dims2d, NULL);
sid_2 = H5Screate_simple (1, dim1, NULL);
- sid_large = H5Screate_simple (1, &nrows, NULL);
- sid_null = H5Screate (H5S_NULL);
- sid_scalar = H5Screate (H5S_SCALAR);
-
- /* create fid access property */
- fapl = H5Pcreate (H5P_FILE_ACCESS);
+ sid_large = H5Screate_simple (1, &nrows, NULL);
+ sid_null = H5Screate (H5S_NULL);
+ sid_scalar = H5Screate (H5S_SCALAR);
+
+ /* create fid access property */
+ fapl = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST);
- /* create dataset creation property */
+ /* create dataset creation property */
dcpl = H5Pcreate (H5P_DATASET_CREATE);
- /* set dataset chunk */
+ /* set dataset chunk */
if (chunk>0) {
H5Pset_chunk (dcpl, 1, &chunk);
}
- /* set dataset compression */
+ /* set dataset compression */
if (compressed) {
if (chunk<=0) {
chunk = dim0/10+1;;
@@ -229,54 +229,54 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
H5Pset_shuffle (dcpl);
H5Pset_deflate (dcpl, 6);
- }
+ }
- /* allocate buffers */
+ /* allocate buffers */
buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t));
buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t));
buf_int = (int *)calloc(dim0, sizeof(int));
buf_float_a = malloc(dim0*sizeof(*buf_float_a));
- buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
+ buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t));
buf_vlen_s = (char **)calloc(dim0, sizeof(char *));
- buf_str = malloc(dim0*sizeof (*buf_str));
+ buf_str = malloc(dim0*sizeof (*buf_str));
- /* allocate array of doulbe pointers */
- buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
- /* allocate a contigous chunk of memory for the data */
- buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
- /* assign memory city to pointer array */
- for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
+ /* allocate array of doulbe pointers */
+ buf_double2d = (double **)calloc(dims2d[0],sizeof(double *));
+ /* allocate a contigous chunk of memory for the data */
+ buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) );
+ /* assign memory city to pointer array */
+ for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1];
- /* fill buffer values */
- len = 1;
+ /* fill buffer values */
+ len = 1;
for (i=0; i<dims[0]; i++) {
buf_comp[i].i = buf_int[i] = i-2147483648;
buf_comp[i].l = 0xffffffffffffffff-i;
buf_comp[i].f = 1.0/(i+1.0);
buf_comp[i].d = 987654321.0*i+1.0/(i+1.0);
buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1));
-
- for (j=0; j<FIXED_LEN; j++) {
- buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
- buf_str[i][j] = 'a' + (i%26);
- }
- buf_str[i][FIXED_LEN-1] = 0;
+
+ for (j=0; j<FIXED_LEN; j++) {
+ buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j;
+ buf_str[i][j] = 'a' + (i%26);
+ }
+ buf_str[i][FIXED_LEN-1] = 0;
strcpy(buf_comp[i].s, buf_str[i]);
-
- len = (1-cos(i/8.0))/2*vlen+1;
- if (!i) len = vlen;
- buf_vlen_i[i].len = len;
- buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
- for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
- buf_comp[i].i_vlen = buf_vlen_i[i];
-
- buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
- for (j=0; j<len-1; j++)
- buf_vlen_s[i][j] = j%26+'A';
- buf_comp[i].s_vlen = buf_vlen_s[i];
-
- for (j=0; j<dims2d[1]; j++)
- buf_double2d[i][j] = i+j/10000.0;
+
+ len = (1-cos(i/8.0))/2*vlen+1;
+ if (!i) len = vlen;
+ buf_vlen_i[i].len = len;
+ buf_vlen_i[i].p = (int *)calloc(len, sizeof(int));
+ for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j;
+ buf_comp[i].i_vlen = buf_vlen_i[i];
+
+ buf_vlen_s[i] = (char *)calloc(len, sizeof(char));
+ for (j=0; j<len-1; j++)
+ buf_vlen_s[i][j] = j%26+'A';
+ buf_comp[i].s_vlen = buf_vlen_s[i];
+
+ for (j=0; j<dims2d[1]; j++)
+ buf_double2d[i][j] = i+j/10000.0;
}
for (i=0; i<nrows; i++) {
@@ -289,147 +289,147 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
buf_comp_large[i].f_array[j] = i*100+j;
buf_comp_large[i].s[j] = 'a' + (i%26);
}
- len = i%vlen+1;
+ len = i%vlen+1;
buf_comp_large[i].i_vlen.len = len;
buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int));
for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j;
buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char));
for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A';
}
-
- /* create file */
+
+ /* create file */
if (latest)
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl);
else
fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(fid, 0);
+ add_attrs(fid, 0);
- sprintf(name, "a cmp ds of %d rows", nrows);
- did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
- add_attrs(did, 0);
- H5Dclose(did);
+ HDsprintf(name, "a cmp ds of %d rows", nrows);
+ did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large);
+ add_attrs(did, 0);
+ H5Dclose(did);
- // /* add attributes*/
+ // /* add attributes*/
gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (nattrs<1) nattrs = 1;
- i=0;
- while (i<nattrs) i += add_attrs(gid1, i);
- H5Gclose(gid1);
-
- /* add many sub groups to a group*/
+ if (nattrs<1) nattrs = 1;
+ i=0;
+ while (i<nattrs) i += add_attrs(gid1, i);
+ H5Gclose(gid1);
+
+ /* add many sub groups to a group*/
gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
+ add_attrs(gid1, 0);
for (i=0; i<ngrps; i++) {
- /* create sub groups */
- sprintf(name, "g%02d", i);
+ /* create sub groups */
+ HDsprintf(name, "g%02d", i);
gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (i<10) add_attrs(gid2, 0);
- H5Gclose(gid2);
- }
- H5Gclose(gid1);
-
- /* add many datasets to a group */
- gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- add_attrs(gid1, 0);
+ if (i<10) add_attrs(gid2, 0);
+ H5Gclose(gid2);
+ }
+ H5Gclose(gid1);
+
+ /* add many datasets to a group */
+ gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ add_attrs(gid1, 0);
for (j=0; j<ndsets; j+=12) {
- /* 1 add a null dataset */
- sprintf(name, "%05d null dataset", j);
+ /* 1 add a null dataset */
+ HDsprintf(name, "%05d null dataset", j);
did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
- /* 2 add scalar int point */
- sprintf(name, "%05d scalar int point", j);
+ /* 2 add scalar int point */
+ HDsprintf(name, "%05d scalar int point", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 3 scalar vlen string */
- sprintf(name, "%05d scalar vlen string", j);
+ H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 3 scalar vlen string */
+ HDsprintf(name, "%05d scalar vlen string", j);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 4 add fixed-length float array */
- sprintf(name, "%05d fixed-length float array", j);
- did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 5 add fixed-length strings */
- sprintf(name, "%05d fixed-length strings", j);
- did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 6 add compound data */
- sprintf(name, "%05d compund data", j);
- did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 7 add 2D double */
- sprintf(name, "%05d 2D double", j);
- strcpy (tmp_name1, name);
- did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 8 add 1D int array */
- sprintf(name, "%05d 1D int array", j);
+ H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 4 add fixed-length float array */
+ HDsprintf(name, "%05d fixed-length float array", j);
+ did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 5 add fixed-length strings */
+ HDsprintf(name, "%05d fixed-length strings", j);
+ did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 6 add compound data */
+ HDsprintf(name, "%05d compund data", j);
+ did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
+ H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 7 add 2D double */
+ HDsprintf(name, "%05d 2D double", j);
+ strcpy (tmp_name1, name);
+ did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
+ H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 8 add 1D int array */
+ HDsprintf(name, "%05d 1D int array", j);
did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 9 add vlen int array */
- sprintf(name, "%05d vlen int array", j);
- strcpy (tmp_name2, name);
+ H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 9 add vlen int array */
+ HDsprintf(name, "%05d vlen int array", j);
+ strcpy (tmp_name2, name);
did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
+ H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
- /* 10 add vlen strings */
- sprintf(name, "%05d vlen strings", j);
- strcpy (tmp_name3, name);
+ /* 10 add vlen strings */
+ HDsprintf(name, "%05d vlen strings", j);
+ strcpy (tmp_name3, name);
did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT);
- H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 11 add object refs */
- H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
- H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
- sprintf(name, "%05d obj refs", j);
+ H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 11 add object refs */
+ H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1);
+ H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1);
+ HDsprintf(name, "%05d obj refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
-
- /* 12 add region refs */
- H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
- H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
- H5Sselect_none(sid_2d);
- count = dims[0]/2+1;
- H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
- H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
- H5Sselect_none(sid_1d);
- sprintf(name, "%05d region refs", j);
+ H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+
+ /* 12 add region refs */
+ H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]);
+ H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d);
+ H5Sselect_none(sid_2d);
+ count = dims[0]/2+1;
+ H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL);
+ H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d);
+ H5Sselect_none(sid_1d);
+ HDsprintf(name, "%05d region refs", j);
did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT);
- H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
- if (!j) add_attrs(did, j);
- H5Dclose(did);
- }
- H5Gclose(gid1);
-
+ H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref);
+ if (!j) add_attrs(did, j);
+ H5Dclose(did);
+ }
+ H5Gclose(gid1);
+
H5Tclose (tid_array_f);
H5Tclose (tid_vlen_i);
H5Tclose (tid_vlen_s);
@@ -447,22 +447,22 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
H5Fclose (fid);
for (i=0; i<dims[0]; i++) {
- if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
- if (buf_vlen_s[i]) free(buf_vlen_s[i]);
- }
+ if (buf_vlen_i[i].p) free(buf_vlen_i[i].p);
+ if (buf_vlen_s[i]) free(buf_vlen_s[i]);
+ }
for (i=0; i<nrows; i++) {
- if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
- if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
- }
-
+ if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p);
+ if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen);
+ }
+
free (buf_comp);
free (buf_comp_large);
free (buf_int);
free (buf_float_a);
free (buf_double2d[0]);
free (buf_double2d);
- free (buf_str);
+ free (buf_str);
free(buf_vlen_i);
free(buf_vlen_s);
@@ -470,34 +470,34 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets,
}
/* add a single attribute */
-int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
+int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf)
{
hid_t aid;
aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT);
- if (aid <0)
- return 0;
-
- H5Awrite(aid, tid, buf);
+ if (aid <0)
+ return 0;
+
+ H5Awrite(aid, tid, buf);
H5Aclose(aid);
-
- return 1;
+
+ return 1;
}
-/*
+/*
adds different types of attributes to an object.
-
- returns the number of attributes added to the objects.
+
+ returns the number of attributes added to the objects.
*/
-int add_attrs(hid_t oid, int idx)
+int add_attrs(hid_t oid, int idx)
{
char name[32];
int i0, i1, i2, j, nattrs=0;
- hid_t aid, tid, tid1, sid;
+ hid_t aid, tid, tid1, sid;
hvl_t i_vlen[4];
- hobj_ref_t ref;
- zipcode_t cmp_data[4];
+ hobj_ref_t ref;
+ zipcode_t cmp_data[4];
unsigned int i = 0xffffffff;
long long l = -2147483647;
float f = 123456789.987654321;
@@ -505,22 +505,22 @@ int add_attrs(hid_t oid, int idx)
char *s[7] = {"Parting", "is such", "sweeter", "sorrow."};
float f_array[4] = {1.0, 2.22, 3.333, 4.444};
char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."};
- hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
- int int3d[4][3][5];
- size_t offset = 0;
-
- for (i0=0; i0<4; i0++) {
- i_vlen[i0].len = (i0+1);
- i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
- for (j=0; j<i_vlen[i0].len; j++)
- ((int *)i_vlen[i0].p)[j] = i0*100+j;
- for (i1=0; i1<3; i1++) {
- for (i2=0; i2<5; i2++)
- int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
- }
+ hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5};
+ int int3d[4][3][5];
+ size_t offset = 0;
+
+ for (i0=0; i0<4; i0++) {
+ i_vlen[i0].len = (i0+1);
+ i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int));
+ for (j=0; j<i_vlen[i0].len; j++)
+ ((int *)i_vlen[i0].p)[j] = i0*100+j;
+ for (i1=0; i1<3; i1++) {
+ for (i2=0; i2<5; i2++)
+ int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2;
+ }
}
- cmp_data[0].zipcode = 01001;
+ cmp_data[0].zipcode = 01001;
cmp_data[0].city = "Agawam, Massachusetts";
cmp_data[1].zipcode = 99950;
cmp_data[1].city = "Ketchikan, Alaska";
@@ -528,82 +528,82 @@ int add_attrs(hid_t oid, int idx)
cmp_data[2].city = "Holtsville, New York";
cmp_data[3].zipcode = 61820;
cmp_data[3].city = "Champaign, Illinois";
-
- /* 1 scalar point */
- sid = H5Screate (H5S_SCALAR);
- sprintf(name, "%05d scalar int", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
- sprintf(name, "%05d scalar ulong", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
- sprintf(name, "%05d scalar str", idx);
- tid = H5Tcopy (H5T_C_S1);
+
+ /* 1 scalar point */
+ sid = H5Screate (H5S_SCALAR);
+ HDsprintf(name, "%05d scalar int", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i);
+ HDsprintf(name, "%05d scalar ulong", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l);
+ HDsprintf(name, "%05d scalar str", idx);
+ tid = H5Tcopy (H5T_C_S1);
H5Tset_size (tid, H5T_VARIABLE);
- nattrs += add_attr(oid, name, tid, sid, &s[2]);
- H5Tclose(tid);
- H5Sclose(sid);
+ nattrs += add_attr(oid, name, tid, sid, &s[2]);
+ H5Tclose(tid);
+ H5Sclose(sid);
- /* 4 single point */
- sid = H5Screate_simple (1, dims1, NULL);
+ /* 4 single point */
+ sid = H5Screate_simple (1, dims1, NULL);
H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1);
- sprintf(name, "%05d single float", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
- sprintf(name, "%05d single double", idx);
- nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
- sprintf(name, "%05d single obj_ref", idx);
- nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
- H5Sclose(sid);
-
- /* 7 fixed length 1D array */
- sid = H5Screate_simple (1, dims1, NULL);
- tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
- sprintf(name, "%05d array float", idx);
+ HDsprintf(name, "%05d single float", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f);
+ HDsprintf(name, "%05d single double", idx);
+ nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d);
+ HDsprintf(name, "%05d single obj_ref", idx);
+ nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref);
+ H5Sclose(sid);
+
+ /* 7 fixed length 1D array */
+ sid = H5Screate_simple (1, dims1, NULL);
+ tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2);
+ HDsprintf(name, "%05d array float", idx);
nattrs += add_attr(oid, name, tid, sid, &f_array[0]);
- H5Tclose(tid);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, strlen(s[0])+1);
- tid1 = H5Tarray_create (tid, 1, dims2);
- sprintf(name, "%05d array str", idx);
- nattrs += add_attr(oid, name, tid1, sid, s);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 9 fixed length 2D int arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
- sprintf(name, "%05d array int 2D", idx);
+ H5Tclose(tid);
+ tid = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid, strlen(s[0])+1);
+ tid1 = H5Tarray_create (tid, 1, dims2);
+ HDsprintf(name, "%05d array str", idx);
+ nattrs += add_attr(oid, name, tid1, sid, s);
+ H5Tclose(tid1);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 9 fixed length 2D int arrays */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3);
+ HDsprintf(name, "%05d array int 2D", idx);
nattrs += add_attr(oid, name, tid, sid, int3d[0][0]);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 10 variable length arrays */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid, H5T_VARIABLE);
- sprintf(name, "%05d vlen strings", idx);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 10 variable length arrays */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid, H5T_VARIABLE);
+ HDsprintf(name, "%05d vlen strings", idx);
nattrs += add_attr(oid, name, tid, sid, s_vlen);
- H5Tclose(tid);
- tid = H5Tvlen_create (H5T_NATIVE_INT);;
- sprintf(name, "%05d vlen int array", idx);
+ H5Tclose(tid);
+ tid = H5Tvlen_create (H5T_NATIVE_INT);;
+ HDsprintf(name, "%05d vlen int array", idx);
nattrs += add_attr(oid, name, tid, sid, i_vlen);
- H5Tclose(tid);
- H5Sclose(sid);
-
- /* 12 compound data */
- sid = H5Screate_simple (1, dims2, NULL);
- tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
- tid1 = H5Tcopy (H5T_C_S1);
- H5Tset_size (tid1, H5T_VARIABLE);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ /* 12 compound data */
+ sid = H5Screate_simple (1, dims2, NULL);
+ tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t));
+ tid1 = H5Tcopy (H5T_C_S1);
+ H5Tset_size (tid1, H5T_VARIABLE);
H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT);
H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *);
- sprintf(name, "%05d compound data", idx);
+ HDsprintf(name, "%05d compound data", idx);
nattrs += add_attr(oid, name, tid, sid, cmp_data);
- H5Tclose(tid1);
- H5Tclose(tid);
- H5Sclose(sid);
-
- for (i0=0; i0<4; i0++)
- free(i_vlen[i0].p);
-
- return nattrs;
+ H5Tclose(tid1);
+ H5Tclose(tid);
+ H5Sclose(sid);
+
+ for (i0=0; i0<4; i0++)
+ free(i_vlen[i0].p);
+
+ return nattrs;
}
diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c
index 4016ee8..b8e0292 100644
--- a/tools/test/misc/repart_test.c
+++ b/tools/test/misc/repart_test.c
@@ -26,12 +26,13 @@
const char *FILENAME[] = {
"fst_family%05d.h5",
"scd_family%05d.h5",
+ "family_to_single.h5",
"family_to_sec2.h5",
NULL
};
herr_t test_family_h5repart_opens(void);
-herr_t test_sec2_h5repart_opens(void);
+herr_t test_single_h5repart_opens(void);
/*-------------------------------------------------------------------------
@@ -90,23 +91,28 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_sec2_h5repart_opens
+ * Function: test_single_h5repart_opens
*
- * Purpose: Tries to reopen a sec2 file.
+ * Purpose: Tries to reopen a single file.
*
* Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
-test_sec2_h5repart_opens(void)
+test_single_h5repart_opens(void)
{
hid_t fid = -1;
- /* open the sec2 file */
+ /* open the single file */
if ((fid = H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+ /* open the single file (created using the old argument) */
+ if ((fid = H5Fopen(FILENAME[3], H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ goto error;
if (H5Fclose(fid) < 0)
goto error;
@@ -119,7 +125,7 @@ error:
return FAIL;
-} /* end test_sec2_h5repart_opens() */
+} /* end test_single_h5repart_opens() */
/*-------------------------------------------------------------------------
@@ -137,7 +143,7 @@ main(void)
int nerrors = 0;
nerrors += test_family_h5repart_opens() < 0 ? 1 : 0;
- nerrors += test_sec2_h5repart_opens() < 0 ? 1 : 0;
+ nerrors += test_single_h5repart_opens() < 0 ? 1 : 0;
if (nerrors)
goto error;
@@ -150,3 +156,4 @@ error:
nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
} /* end main() */
+
diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c
index ce866b4..7f1f038 100644
--- a/tools/test/misc/talign.c
+++ b/tools/test/misc/talign.c
@@ -51,14 +51,14 @@ int main(void)
int result = 0;
herr_t error = 1;
- printf("%-70s", "Testing alignment in compound datatypes");
+ HDprintf("%-70s", "Testing alignment in compound datatypes");
- strcpy(string5, "Hi!");
+ HDstrcpy(string5, "Hi!");
HDunlink(fname);
fil = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
if (fil < 0) {
- puts("*FAILED*");
+ HDputs("*FAILED*");
return 1;
}
@@ -123,20 +123,20 @@ int main(void)
data = (char *)HDmalloc(H5Tget_size(fix));
if(!data) {
- perror("malloc() failed");
- abort();
+ HDperror("malloc() failed");
+ HDabort();
}
set = H5Dopen2(fil, setname, H5P_DEFAULT);
H5Dread(set, fix, spc, H5S_ALL, H5P_DEFAULT, data);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
H5Dclose(set);
out:
if(error < 0) {
result = 1;
- puts("*FAILED - HDF5 library error*");
+ HDputs("*FAILED - HDF5 library error*");
} else if(!(H5_FLT_ABS_EQUAL(fok[0], fptr[0]))
|| !(H5_FLT_ABS_EQUAL(fok[1], fptr[1]))
|| !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2]))
@@ -145,15 +145,15 @@ out:
result = 1;
mname = H5Tget_member_name(fix, 0);
- printf("%14s (%2d) %6s = %s\n",
+ HDprintf("%14s (%2d) %6s = %s\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0),
string5, (char *)(data + H5Tget_member_offset(fix, 0)));
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
mname = H5Tget_member_name(fix, 1);
- printf("Data comparison:\n"
+ HDprintf("Data comparison:\n"
"%14s (%2d) %6f = %f\n"
" %6f = %f\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1),
@@ -162,9 +162,9 @@ out:
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 2));
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 2)));
mname = H5Tget_member_name(fix, 2);
- printf("%14s (%2d) %6f = %f\n"
+ HDprintf("%14s (%2d) %6f = %f\n"
" %6f = %6f\n",
mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2),
(double)fnok[0], (double)fptr[0],
@@ -172,8 +172,8 @@ out:
if(mname)
H5free_memory(mname);
- fptr = (float *)(data + H5Tget_member_offset(fix, 1));
- printf("\n"
+ fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1)));
+ HDprintf("\n"
"Short circuit\n"
" %6f = %f\n"
" %6f = %f\n"
@@ -183,9 +183,9 @@ out:
(double)fok[1], (double)fptr[1],
(double)fnok[0], (double)fptr[2],
(double)fnok[1], (double)fptr[3]);
- puts("*FAILED - compound type alignmnent problem*");
+ HDputs("*FAILED - compound type alignmnent problem*");
} else {
- puts(" PASSED");
+ HDputs(" PASSED");
}
if(data)
@@ -200,7 +200,7 @@ out:
H5Pclose(plist);
H5Fclose(fil);
HDunlink(fname);
- fflush(stdout);
+ HDfflush(stdout);
return result;
}
diff --git a/tools/test/misc/testfiles/h5clear_missing_file.ddl b/tools/test/misc/testfiles/h5clear_missing_file.ddl
index 13eb2c9..32dd549 100644
--- a/tools/test/misc/testfiles/h5clear_missing_file.ddl
+++ b/tools/test/misc/testfiles/h5clear_missing_file.ddl
@@ -20,4 +20,3 @@ h5clear --increment file_name
h5clear --increment=512 file_name
Set the EOA to the maximum of (EOA, EOF) + 512 for the file <file_name>.
-h5clear error: missing file name
diff --git a/tools/test/misc/testfiles/h5clear_missing_file.err b/tools/test/misc/testfiles/h5clear_missing_file.err
new file mode 100644
index 0000000..ea21b76
--- /dev/null
+++ b/tools/test/misc/testfiles/h5clear_missing_file.err
@@ -0,0 +1 @@
+h5clear error: missing file name
diff --git a/tools/test/misc/testfiles/h5clear_no_mdc_image.ddl b/tools/test/misc/testfiles/h5clear_no_mdc_image.err
index f5acd71..f5acd71 100644
--- a/tools/test/misc/testfiles/h5clear_no_mdc_image.ddl
+++ b/tools/test/misc/testfiles/h5clear_no_mdc_image.err
diff --git a/tools/test/misc/testfiles/h5clear_open_fail.ddl b/tools/test/misc/testfiles/h5clear_open_fail.err
index 895ecd4..895ecd4 100644
--- a/tools/test/misc/testfiles/h5clear_open_fail.ddl
+++ b/tools/test/misc/testfiles/h5clear_open_fail.err
diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in
index 11c2ff9..3f2b32f 100644
--- a/tools/test/misc/testh5clear.sh.in
+++ b/tools/test/misc/testh5clear.sh.in
@@ -62,10 +62,10 @@ test -d $TESTDIR || mkdir -p $TESTDIR
# copy test files and expected output files from source dirs to test dir
#
COPY_TESTFILES="
+$SRC_H5CLEAR_TESTFILES/h5clear_open_fail.err
+$SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.err
$SRC_H5CLEAR_TESTFILES/h5clear_usage.ddl
-$SRC_H5CLEAR_TESTFILES/h5clear_open_fail.ddl
$SRC_H5CLEAR_TESTFILES/h5clear_missing_file.ddl
-$SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.ddl
$SRC_H5CLEAR_TESTFILES/h5clear_status_noclose_after_size.ddl
$SRC_H5CLEAR_TESTFILES/h5clear_noclose_before_size.ddl
$SRC_H5CLEAR_TESTFILES/h5clear_noclose_after_size.ddl
@@ -179,8 +179,9 @@ TOOLTEST_OUT() {
expected=$5
# Prepare expected and actual output
expect="$TESTDIR/$expected"
+ expect_err="$TESTDIR/`basename $expected .ddl`.err"
actual="$TESTDIR/`basename $expected .ddl`.out"
- actual_err="$TESTDIR/`basename $expected .ddl`.err"
+ actual_err="$TESTDIR/`basename $expected .ddl`.out.err"
actual_sav=${actual}-sav
actual_err_sav=${actual_err}-sav
@@ -192,7 +193,6 @@ TOOLTEST_OUT() {
) >$actual 2>$actual_err
cp $actual $actual_sav
cp $actual_err $actual_err_sav
- cat $actual_err >> $actual
# Compare output
COMPARE_OUT $expect $actual
@@ -202,6 +202,38 @@ TOOLTEST_OUT() {
$RM $actual $actual_err $actual_sav $actual_err_sav
fi
}
+# same as TOOLTEST_OUT just compare stderr
+TOOLTEST_ERR() {
+ fname=$1
+ option1=$2
+ option2=$3
+ option3=$4
+ expected=$5
+ # Prepare expected and actual output
+ expect_err="$TESTDIR/$expected"
+ expect="$TESTDIR/`basename $expected .err`.ddl"
+ actual="$TESTDIR/`basename $expected .err`.out"
+ actual_err="$TESTDIR/`basename $expected .err`.out.err"
+ actual_sav=${actual}-sav
+ actual_err_sav=${actual_err}-sav
+
+ # Run test.
+ TESTING $H5CLEAR $option1 $option2 $option3 $option4 $fname
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $option3 $option4 $fname
+ ) >$actual 2>$actual_err
+ cp $actual $actual_sav
+ cp $actual_err $actual_err_sav
+
+ # Compare output
+ COMPARE_OUT $expect_err $actual_err
+
+ # Clean up output file
+ if test -z "$HDF5_NOCLEANUP"; then
+ $RM $actual $actual_err $actual_sav $actual_err_sav
+ fi
+}
# $1 is the filename to open
# $2 is the expected return from the open/check program
@@ -274,11 +306,11 @@ TOOLTEST_OUT "" "" "" "" h5clear_usage.ddl
TOOLTEST_OUT junk.h5 "" "" "" h5clear_usage.ddl
TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" "" h5clear_usage.ddl
TOOLTEST_OUT "" -m "" "" h5clear_missing_file.ddl
-TOOLTEST_OUT junk.h5 -s "" "" h5clear_open_fail.ddl
+TOOLTEST_ERR junk.h5 -s "" "" h5clear_open_fail.err
TOOLTEST_OUT "" -m -s "" h5clear_missing_file.ddl
-TOOLTEST_OUT junk.h5 -m -s "" h5clear_open_fail.ddl
-TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" "" h5clear_no_mdc_image.ddl
-TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.ddl
+TOOLTEST_ERR junk.h5 -m -s "" h5clear_open_fail.err
+TOOLTEST_ERR orig_h5clear_sec2_v2.h5 -m "" "" h5clear_no_mdc_image.err
+TOOLTEST_ERR orig_h5clear_sec2_v0.h5 -s -m "" h5clear_no_mdc_image.err
#
#
# The following are tests to verify the expected exit code from h5clear:
@@ -308,8 +340,8 @@ TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL
#
#
# h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear:
-TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" "" h5clear_no_mdc_image.ddl
-TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m "" h5clear_no_mdc_image.ddl
+TOOLTEST_ERR mod_h5clear_mdc_image.h5 -m "" "" h5clear_no_mdc_image.err
+TOOLTEST_ERR mod_h5clear_mdc_image.h5 -s -m "" h5clear_no_mdc_image.err
#
#
#
@@ -342,16 +374,16 @@ OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED
#
#
#
-# (1) h5clear_status_noclose.h5
+# (1) h5clear_status_noclose.h5
# "h5clear --filesize h5clear_status_noclose.h5" (unable to open the file because status_flag is on)
-# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0)
+# "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0)
# (no output, check exit code)
# "h5clear --filesize h5clear_status_noclose_user.h5" (print EOA/EOF after the last action)
-TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_open_fail.ddl
+TOOLTEST_ERR h5clear_status_noclose.h5 --filesize "" "" h5clear_open_fail.err
TOOLTEST h5clear_status_noclose.h5 -s --increment=0 $SUCCEED
TOOLTEST_OUT h5clear_status_noclose.h5 --filesize "" "" h5clear_status_noclose_after_size.ddl
#
-# (2) h5clear_fsm_persist_noclose.h5
+# (2) h5clear_fsm_persist_noclose.h5
# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action)
# "h5clear --increment=0 h5clear_fsm_persist_noclose.h5" (EOA = MAX(EOA, EOF)) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF after the last action)
@@ -364,7 +396,7 @@ TOOLTEST_OUT h5clear_fsm_persist_noclose.h5 --filesize "" "" h5clear_noclose_aft
# "h5clear --increment h5clear_fsm_persist_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_equal.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_before_size.ddl
-TOOLTEST h5clear_fsm_persist_equal.h5 --increment "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_equal.h5 --increment "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_after_size.ddl
#
# (4) h5clear_fsm_persist_greater.h5
@@ -372,7 +404,7 @@ TOOLTEST_OUT h5clear_fsm_persist_equal.h5 --filesize "" "" h5clear_equal_after_s
# "h5clear --increment=0 h5clear_fsm_persist_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_greater.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_before_size.ddl
-TOOLTEST h5clear_fsm_persist_greater.h5 --increment=0 "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_greater.h5 --increment=0 "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_after_size.ddl
#
# (5) h5clear_fsm_persist_less.h5
@@ -380,7 +412,7 @@ TOOLTEST_OUT h5clear_fsm_persist_greater.h5 --filesize "" "" h5clear_greater_aft
# "h5clear --increment=200 h5clear_fsm_persist_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_less.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_before_size.ddl
-TOOLTEST h5clear_fsm_persist_less.h5 --increment=200 "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_less.h5 --increment=200 "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_after_size.ddl
#
# (6) h5clear_fsm_persist_user_equal.h5
@@ -388,7 +420,7 @@ TOOLTEST_OUT h5clear_fsm_persist_less.h5 --filesize "" "" h5clear_less_after_siz
# "h5clear --increment h5clear_fsm_persist_user_equal.h5" (EOA = MAX(EOA, EOF) + 1M) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_user_equal.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_before_size.ddl
-TOOLTEST h5clear_fsm_persist_user_equal.h5 --increment "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_user_equal.h5 --increment "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equal_after_size.ddl
#
# (7) h5clear_fsm_persist_user_greater.h5
@@ -396,7 +428,7 @@ TOOLTEST_OUT h5clear_fsm_persist_user_equal.h5 --filesize "" "" h5clear_user_equ
# "h5clear --increment=0 h5clear_fsm_persist_user_greater.h5" (EOA = MAX(EOA, EOF) + 0) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_user_greater.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_before_size.ddl
-TOOLTEST h5clear_fsm_persist_user_greater.h5 --increment=0 "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_user_greater.h5 --increment=0 "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_greater_after_size.ddl
#
# (8) h5clear_fsm_persist_user_less.h5
@@ -404,7 +436,7 @@ TOOLTEST_OUT h5clear_fsm_persist_user_greater.h5 --filesize "" "" h5clear_user_g
# "h5clear --increment=200 h5clear_fsm_persist_user_less.h5" (EOA = MAX(EOA, EOF) + 200) (no output, check exit code)
# "h5clear --filesize h5clear_fsm_persist_user_less.h5" (print EOA/EOF after the last action)
TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_before_size.ddl
-TOOLTEST h5clear_fsm_persist_user_less.h5 --increment=200 "" $SUCCEED
+TOOLTEST h5clear_fsm_persist_user_less.h5 --increment=200 "" $SUCCEED
TOOLTEST_OUT h5clear_fsm_persist_user_less.h5 --filesize "" "" h5clear_user_less_after_size.ddl
#
#
diff --git a/tools/test/misc/testh5repart.sh.in b/tools/test/misc/testh5repart.sh.in
index 594d37e..143f607 100644
--- a/tools/test/misc/testh5repart.sh.in
+++ b/tools/test/misc/testh5repart.sh.in
@@ -171,7 +171,9 @@ COPY_TESTFILES_TO_TESTDIR
TOOLTEST -m 20000 family_file%05d.h5 fst_family%05d.h5
# repartition family member size to 5 KB.
TOOLTEST -m 5k family_file%05d.h5 scd_family%05d.h5
-# convert family file to sec2 file of 20,000 bytes
+# convert family file to single file of 20,000 bytes
+TOOLTEST -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
+# convert family file to single file of 20,000 bytes (old argument)
TOOLTEST -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
# test the output files repartitioned above.
@@ -183,7 +185,7 @@ CLEAN_TESTFILES_AND_TESTDIR
if test -z "$HDF5_NOCLEANUP"; then
cd $actual_dir
- rm -f fst_family*.h5 scd_family*.h5 family_to_sec2.h5
+ rm -f fst_family*.h5 scd_family*.h5 family_to_single.h5 family_to_sec2.h5
fi
if test $nerrors -eq 0 ; then
diff --git a/tools/test/misc/vds/CMakeLists.txt b/tools/test/misc/vds/CMakeLists.txt
index 98bce4d..092cabc 100644
--- a/tools/test/misc/vds/CMakeLists.txt
+++ b/tools/test/misc/vds/CMakeLists.txt
@@ -3,9 +3,14 @@ project (HDF5_TOOLS_TEST_MISC_VDS C)
MACRO (ADD_H5_GENERATOR genfile)
add_executable (${genfile} ${HDF5_TOOLS_TEST_MISC_VDS_SOURCE_DIR}/${genfile}.c)
- target_include_directories(${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (${genfile} STATIC)
- target_link_libraries (${genfile} PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (${genfile} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT ONLY_SHARED_LIBS)
+ TARGET_C_PROPERTIES (${genfile} STATIC)
+ target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (${genfile} SHARED)
+ target_link_libraries (${genfile} PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (${genfile} PROPERTIES FOLDER generator/tools)
ENDMACRO ()
diff --git a/tools/test/perform/CMakeLists.txt b/tools/test/perform/CMakeLists.txt
index fa41608..38dd605 100644
--- a/tools/test/perform/CMakeLists.txt
+++ b/tools/test/perform/CMakeLists.txt
@@ -10,9 +10,14 @@ set (h5perf_serial_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
)
add_executable (h5perf_serial ${h5perf_serial_SOURCES})
-target_include_directories(h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (h5perf_serial STATIC)
-target_link_libraries (h5perf_serial PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (h5perf_serial PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial STATIC)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (h5perf_serial SHARED)
+ target_link_libraries (h5perf_serial PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (h5perf_serial PROPERTIES FOLDER perform)
if (HDF5_BUILD_PERFORM_STANDALONE)
@@ -20,11 +25,17 @@ if (HDF5_BUILD_PERFORM_STANDALONE)
set (h5perf_serial_alone_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_engine.c
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/sio_standalone.c
)
add_executable (h5perf_serial_alone ${h5perf_serial_alone_SOURCES})
- target_include_directories(h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
- target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+ target_include_directories (h5perf_serial_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_serial_alone STATIC)
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf_serial_alone SHARED)
+ target_link_libraries (h5perf_serial_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf_serial_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_serial_alone
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
@@ -36,9 +47,14 @@ set (chunk_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk.c
)
add_executable(chunk ${chunk_SOURCES})
-target_include_directories(chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (chunk STATIC)
-target_link_libraries(chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (chunk STATIC)
+ target_link_libraries (chunk PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (chunk SHARED)
+ target_link_libraries (chunk PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (chunk PROPERTIES FOLDER perform)
#-- Adding test for iopipe
@@ -46,19 +62,44 @@ set (iopipe_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/iopipe.c
)
add_executable (iopipe ${iopipe_SOURCES})
-target_include_directories(iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (iopipe STATIC)
-target_link_libraries (iopipe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (iopipe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (iopipe STATIC)
+ target_link_libraries (iopipe PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (iopipe SHARED)
+ target_link_libraries (iopipe PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (iopipe PROPERTIES FOLDER perform)
+#-- Adding test for chunk_cache
+set (chunk_cache_SOURCES
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/chunk_cache.c
+)
+add_executable (chunk_cache ${chunk_cache_SOURCES})
+target_include_directories (chunk_cache PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (chunk_cache STATIC)
+ target_link_libraries (chunk_cache PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (chunk_cache SHARED)
+ target_link_libraries (chunk_cache PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
+set_target_properties (chunk_cache PROPERTIES FOLDER perform)
+
#-- Adding test for overhead
set (overhead_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/overhead.c
)
add_executable (overhead ${overhead_SOURCES})
-target_include_directories(overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (overhead STATIC)
-target_link_libraries (overhead PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET})
+target_include_directories (overhead PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (overhead STATIC)
+ target_link_libraries (overhead PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (overhead SHARED)
+ target_link_libraries (overhead PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (overhead PROPERTIES FOLDER perform)
#-- Adding test for perf_meta
@@ -66,9 +107,14 @@ set (perf_meta_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf_meta.c
)
add_executable (perf_meta ${perf_meta_SOURCES})
-target_include_directories(perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (perf_meta STATIC)
-target_link_libraries (perf_meta PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+target_include_directories (perf_meta PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf_meta STATIC)
+ target_link_libraries (perf_meta PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+else ()
+ TARGET_C_PROPERTIES (perf_meta SHARED)
+ target_link_libraries (perf_meta PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+endif ()
set_target_properties (perf_meta PROPERTIES FOLDER perform)
#-- Adding test for zip_perf
@@ -76,21 +122,48 @@ set (zip_perf_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/zip_perf.c
)
add_executable (zip_perf ${zip_perf_SOURCES})
-target_include_directories(zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
-TARGET_C_PROPERTIES (zip_perf STATIC)
-target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
+target_include_directories (zip_perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (zip_perf STATIC)
+ target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_COMP_LIBS})
+else ()
+ TARGET_C_PROPERTIES (zip_perf SHARED)
+ target_link_libraries (zip_perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_LIBSH_TARGET} ${LINK_COMP_LIBS})
+endif ()
set_target_properties (zip_perf PROPERTIES FOLDER perform)
if (H5_HAVE_PARALLEL AND BUILD_TESTING)
+ if (UNIX)
+ #-- Adding test for perf - only on unix systems
+ set (perf_SOURCES
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/perf.c
+ )
+ add_executable (perf ${perf_SOURCES})
+ target_include_directories (perf PRIVATE "${HDF5_TEST_SRC_DIR};${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (perf STATIC)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (perf SHARED)
+ target_link_libraries (perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
+ set_target_properties (perf PROPERTIES FOLDER perform)
+ endif ()
+
#-- Adding test for h5perf
set (h5perf_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
)
add_executable (h5perf ${h5perf_SOURCES})
- target_include_directories(h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf STATIC)
- target_link_libraries (h5perf PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_include_directories (h5perf PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf STATIC)
+ target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf SHARED)
+ target_link_libraries (h5perf PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf PROPERTIES FOLDER perform)
if (HDF5_BUILD_PERFORM_STANDALONE)
@@ -98,11 +171,17 @@ if (H5_HAVE_PARALLEL AND BUILD_TESTING)
set (h5perf_alone_SOURCES
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_perf.c
${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_engine.c
+ ${HDF5_TOOLS_TEST_PERFORM_SOURCE_DIR}/pio_standalone.c
)
add_executable (h5perf_alone ${h5perf_alone_SOURCES})
- target_include_directories(h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
- TARGET_C_PROPERTIES (h5perf_alone STATIC)
- target_link_libraries (h5perf_alone PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
+ target_include_directories (h5perf_alone PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
+ if (NOT BUILD_SHARED_LIBS)
+ TARGET_C_PROPERTIES (h5perf_alone STATIC)
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET})
+ else ()
+ TARGET_C_PROPERTIES (h5perf_alone SHARED)
+ target_link_libraries (h5perf_alone PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
+ endif ()
set_target_properties (h5perf_alone PROPERTIES FOLDER perform)
set_property (TARGET h5perf_alone
APPEND PROPERTY COMPILE_DEFINITIONS STANDALONE
diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake
index 450667a..f0ae416 100644
--- a/tools/test/perform/CMakeTests.cmake
+++ b/tools/test/perform/CMakeTests.cmake
@@ -53,9 +53,10 @@ add_test (
)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>)
+ add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>)
else ()
add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -66,17 +67,20 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT 1800)
-set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_h5perf_serial PROPERTIES
+ TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>)
+ add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>)
endif ()
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>)
+ add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>)
else ()
add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:chunk>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -87,12 +91,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_chunk PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>)
+ add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>)
else ()
add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:iopipe>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -103,12 +110,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_iopipe PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>)
+ add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>)
else ()
add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:overhead>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -119,12 +129,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_overhead PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>)
+ add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>)
else ()
add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -135,12 +148,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_perf_meta PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h")
+ add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h")
else ()
add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -151,12 +167,15 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf_help PROPERTIES
+ DEPENDS "PERFORM_h5perform-clearall-objects"
+)
if (HDF5_ENABLE_USING_MEMCHECKER)
- add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5)
+ add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5)
else ()
add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>"
-D "TEST_ARGS:STRING="
-D "TEST_EXPECT=0"
@@ -167,12 +186,18 @@ else ()
-P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
)
endif ()
-set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects")
+set_tests_properties (PERFORM_zip_perf PROPERTIES
+ DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects"
+)
if (H5_HAVE_PARALLEL)
- add_test (NAME PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf> ${MPIEXEC_POSTFLAGS})
+ if (UNIX)
+ add_test (NAME MPI_TEST_PERFORM_perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:perf> ${MPIEXEC_POSTFLAGS})
+ endif ()
+
+ add_test (NAME MPI_TEST_PERFORM_h5perf COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf> ${MPIEXEC_POSTFLAGS})
if (HDF5_BUILD_PERFORM_STANDALONE)
- add_test (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf_alone> ${MPIEXEC_POSTFLAGS})
+ add_test (NAME MPI_TEST_PERFORM_h5perf_alone COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:h5perf_alone> ${MPIEXEC_POSTFLAGS})
endif ()
endif ()
diff --git a/tools/test/perform/Makefile.am b/tools/test/perform/Makefile.am
index 5a89a66..39800d7 100644
--- a/tools/test/perform/Makefile.am
+++ b/tools/test/perform/Makefile.am
@@ -50,12 +50,12 @@ if BUILD_PARALLEL_CONDITIONAL
TEST_PROG_PARA=h5perf perf
endif
# Serial test programs.
-TEST_PROG = iopipe chunk overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
+TEST_PROG = iopipe chunk chunk_cache overhead zip_perf perf_meta h5perf_serial $(BUILD_ALL_PROGS)
# check_PROGRAMS will be built but not installed. Do not any executable
# that is in bin_PROGRAMS already. Otherwise, it will be removed twice in
# "make clean" and some systems, e.g., AIX, do not like it.
-check_PROGRAMS= iopipe chunk overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
+check_PROGRAMS= iopipe chunk chunk_cache overhead zip_perf perf_meta $(BUILD_ALL_PROGS) perf
h5perf_SOURCES=pio_perf.c pio_engine.c
h5perf_serial_SOURCES=sio_perf.c sio_engine.c
diff --git a/tools/test/perform/chunk_cache.c b/tools/test/perform/chunk_cache.c
new file mode 100644
index 0000000..1d2e791
--- /dev/null
+++ b/tools/test/perform/chunk_cache.c
@@ -0,0 +1,405 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * Purpose: check the performance of chunk cache in these two cases (HDFFV-10601):
+ * 1. partial chunks exist along any dimension.
+ * 2. number of slots in chunk cache is smaller than the number of chunks
+ * in the fastest-growing dimension.
+ */
+#include "hdf5.h"
+#include "H5private.h"
+
+#define FILENAME "chunk_cache_perf.h5"
+
+#define RANK 2
+
+#define DSET1_NAME "partial_chunks"
+#define DSET1_DIM1 9 * 1000
+#define DSET1_DIM2 9
+#define CHUNK1_DIM1 2 * 1000
+#define CHUNK1_DIM2 2
+
+#define DSET2_NAME "hash_value"
+#define DSET2_DIM1 300
+#define DSET2_DIM2 600
+#define CHUNK2_DIM1 100
+#define CHUNK2_DIM2 100
+
+#define RDCC_NSLOTS 5
+#define RDCC_NBYTES 1024 * 1024 * 10
+#define RDCC_W0 0.75F
+
+#define FILTER_COUNTER 306
+static size_t nbytes_global;
+
+typedef struct test_time_t {
+ long tv_sec;
+ long tv_usec;
+} test_time_t;
+
+/* Local function prototypes for the dummy filter */
+static size_t
+counter (unsigned flags, size_t cd_nelmts,
+ const unsigned *cd_values, size_t nbytes,
+ size_t *buf_size, void **buf);
+
+/* This message derives from H5Z */
+const H5Z_class2_t H5Z_COUNTER[1] = {{
+ H5Z_CLASS_T_VERS, /* H5Z_class_t version */
+ FILTER_COUNTER, /* Filter id number */
+ 1, 1, /* Encoding and decoding enabled */
+ "counter", /* Filter name for debugging */
+ NULL, /* The "can apply" callback */
+ NULL, /* The "set local" callback */
+ counter, /* The actual filter function */
+}};
+
+/*-------------------------------------------------------------------------
+ * Count number of bytes but don't do anything else. Keep
+ * track of the data of chunks being read from file into memory.
+ */
+static size_t
+counter (unsigned H5_ATTR_UNUSED flags, size_t H5_ATTR_UNUSED cd_nelmts,
+ const unsigned H5_ATTR_UNUSED *cd_values, size_t nbytes,
+ size_t H5_ATTR_UNUSED *buf_size, void H5_ATTR_UNUSED **buf)
+{
+ nbytes_global += nbytes;
+ return nbytes;
+}
+
+/*---------------------------------------------------------------------------*/
+static double retrieve_time(void)
+{
+#ifdef H5_HAVE_GETTIMEOFDAY
+ struct timeval t;
+ HDgettimeofday(&t, NULL);
+ return ((double)t.tv_sec + (double)t.tv_usec / 1000000);
+#else
+ return 0.0;
+#endif
+}
+
+/*---------------------------------------------------------------------------*/
+static void
+cleanup (void)
+{
+ if (!getenv ("HDF5_NOCLEANUP")) {
+ remove (FILENAME);
+ }
+}
+
+/*-------------------------------------------------------------------------------
+ * Create a chunked dataset with partial chunks along either dimensions:
+ * dataset dimension: 9000 x 9
+ * chunk dimension: 2000 x 2
+ */
+static int create_dset1(hid_t file)
+{
+ hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
+ hsize_t dims[RANK] = {DSET1_DIM1, DSET1_DIM2};
+ hsize_t chunk_dims[RANK] = {CHUNK1_DIM1, CHUNK1_DIM2};
+ int data[DSET1_DIM1][DSET1_DIM2]; /* data for writing */
+ int i, j;
+
+ /* Create the data space. */
+ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking */
+ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0)
+ goto error;
+
+ /* Set the dummy filter simply for counting the number of bytes being read into the memory */
+ if(H5Zregister(H5Z_COUNTER) < 0)
+ goto error;
+
+ if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using chunk creation properties. */
+ if((dataset = H5Dcreate2 (file, DSET1_NAME, H5T_NATIVE_INT, dataspace,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto error;
+
+ for (i = 0; i < DSET1_DIM1; i++)
+ for (j = 0; j < DSET1_DIM2; j++)
+ data[i][j] = i+j;
+
+ /* Write data to dataset */
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, data) < 0)
+ goto error;
+
+ /* Close resources */
+ H5Dclose (dataset);
+ H5Pclose (dcpl);
+ H5Sclose (dataspace);
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose (dataset);
+ H5Pclose (dcpl);
+ H5Sclose (dataspace);
+ } H5E_END_TRY;
+
+ return 1;
+}
+
+/*---------------------------------------------------------------------------
+ * Create a chunked dataset for testing hash values:
+ * dataset dimensions: 300 x 600
+ * chunk dimensions: 100 x 100
+ */
+static int create_dset2(hid_t file)
+{
+ hid_t dataspace = H5I_INVALID_HID, dataset = H5I_INVALID_HID;
+ hid_t dcpl = H5I_INVALID_HID;
+ hsize_t dims[RANK] = {DSET2_DIM1, DSET2_DIM2};
+ hsize_t chunk_dims[RANK] = {CHUNK2_DIM1, CHUNK2_DIM2};
+ int data[DSET2_DIM1][DSET2_DIM2]; /* data for writing */
+ int i, j;
+
+ /* Create the data space. */
+ if((dataspace = H5Screate_simple (RANK, dims, NULL)) < 0)
+ goto error;
+
+ /* Modify dataset creation properties, i.e. enable chunking */
+ if((dcpl = H5Pcreate (H5P_DATASET_CREATE)) < 0)
+ goto error;
+ if(H5Pset_chunk (dcpl, RANK, chunk_dims) < 0)
+ goto error;
+
+ /* Set the dummy filter simply for counting the number of bytes being read into the memory */
+ if(H5Zregister(H5Z_COUNTER) < 0)
+ goto error;
+ if(H5Pset_filter(dcpl, FILTER_COUNTER, 0, 0, NULL) < 0)
+ goto error;
+
+ /* Create a new dataset within the file using chunk creation properties. */
+ if((dataset = H5Dcreate2 (file, DSET2_NAME, H5T_NATIVE_INT, dataspace,
+ H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0)
+ goto error;
+
+ for (i = 0; i < DSET2_DIM1; i++)
+ for (j = 0; j < DSET2_DIM2; j++)
+ data[i][j] = i+j;
+
+ /* Write data to dataset */
+ if(H5Dwrite (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, data) < 0)
+ goto error;
+
+ /* Close resources */
+ H5Dclose (dataset);
+ H5Pclose (dcpl);
+ H5Sclose (dataspace);
+
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose (dataset);
+ H5Pclose (dcpl);
+ H5Sclose (dataspace);
+ } H5E_END_TRY;
+
+ return 1;
+}
+/*---------------------------------------------------------------------------
+ * Check the performance of the chunk cache when partial chunks exist
+ * along the dataset dimensions.
+ */
+static int check_partial_chunks_perf(hid_t file)
+{
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t filespace = H5I_INVALID_HID;
+ hid_t memspace = H5I_INVALID_HID;
+ hid_t dapl = H5I_INVALID_HID;
+
+ int rdata[DSET1_DIM2]; /* data for reading */
+ int i;
+
+ hsize_t row_rank = 1;
+ hsize_t row_dim[1] = {DSET1_DIM2};
+ hsize_t start[RANK] = {0, 0};
+ hsize_t count[RANK] = {1, DSET1_DIM2};
+ double start_t, end_t;
+
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0)
+ goto error;
+
+ dataset = H5Dopen2 (file, DSET1_NAME, dapl);
+
+ memspace = H5Screate_simple(row_rank, row_dim, NULL);
+ filespace = H5Dget_space(dataset);
+
+ nbytes_global = 0;
+
+ start_t = retrieve_time();
+
+ /* Read the data row by row */
+ for(i = 0; i < DSET1_DIM1; i++) {
+ start[0] = i;
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0)
+ goto error;
+
+ if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace,
+ H5P_DEFAULT, rdata) < 0)
+ goto error;
+ }
+
+ end_t = retrieve_time();
+
+#ifdef H5_HAVE_GETTIMEOFDAY
+ printf("1. Partial chunks: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global);
+#else
+ printf("1. Partial chunks: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global);
+#endif
+
+ H5Dclose (dataset);
+ H5Sclose (filespace);
+ H5Sclose (memspace);
+ H5Pclose (dapl);
+
+ return 0;
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose (dataset);
+ H5Sclose (filespace);
+ H5Sclose (memspace);
+ H5Pclose (dapl);
+ } H5E_END_TRY;
+ return 1;
+}
+
+/*---------------------------------------------------------------------------
+ * Check the performance of chunk cache when the number of cache slots
+ * is smaller than the number of chunks along the fastest-growing
+ * dimension of the dataset.
+ */
+static int check_hash_value_perf(hid_t file)
+{
+ hid_t dataset = H5I_INVALID_HID;
+ hid_t filespace = H5I_INVALID_HID;
+ hid_t memspace = H5I_INVALID_HID;
+ hid_t dapl = H5I_INVALID_HID;
+
+ int rdata[DSET2_DIM1]; /* data for reading */
+ int i;
+
+ hsize_t column_rank = 1;
+ hsize_t column_dim[1] = {DSET2_DIM1};
+ hsize_t start[RANK] = {0, 0};
+ hsize_t count[RANK] = {DSET2_DIM1, 1};
+ double start_t, end_t;
+
+ if((dapl = H5Pcreate(H5P_DATASET_ACCESS)) < 0)
+ goto error;
+ if(H5Pset_chunk_cache (dapl, RDCC_NSLOTS, RDCC_NBYTES, RDCC_W0) < 0)
+ goto error;
+
+ if((dataset = H5Dopen2 (file, DSET2_NAME, dapl)) < 0)
+ goto error;
+ if((memspace = H5Screate_simple(column_rank, column_dim, NULL)) < 0)
+ goto error;
+ if((filespace = H5Dget_space(dataset)) < 0)
+ goto error;
+
+ nbytes_global = 0;
+
+ start_t = retrieve_time();
+
+ /* Read the data column by column */
+ for(i = 0; i < DSET2_DIM2; i++) {
+ start[1] = i;
+ if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET,
+ start, NULL, count, NULL) < 0)
+ goto error;
+
+ if(H5Dread (dataset, H5T_NATIVE_INT, memspace, filespace,
+ H5P_DEFAULT, rdata) < 0)
+ goto error;
+ }
+
+ end_t = retrieve_time();
+
+#ifdef H5_HAVE_GETTIMEOFDAY
+ printf("2. Hash value: total read time is %lf; number of bytes being read from file is %lu\n", (end_t -start_t), nbytes_global);
+#else
+ printf("2. Hash value: no total read time because gettimeofday() is not available; number of bytes being read from file is %lu\n", nbytes_global);
+#endif
+
+ H5Dclose (dataset);
+ H5Sclose (filespace);
+ H5Sclose (memspace);
+ H5Pclose (dapl);
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Dclose (dataset);
+ H5Sclose (filespace);
+ H5Sclose (memspace);
+ H5Pclose (dapl);
+ } H5E_END_TRY;
+ return 1;
+}
+
+/*-------------------------------------------------------------------------------------
+ * Purpose: check the performance of chunk cache in these two cases (HDFFV-10601):
+ * 1. partial chunks exist along any dimension.
+ * 2. number of slots in chunk cache is smaller than the number of chunks
+ * in the fastest-growing dimension.
+ *-------------------------------------------------------------------------------------*/
+int
+main (void)
+{
+ hid_t file; /* handles */
+ int nerrors = 0;
+
+ /* Create a new file. If file exists its contents will be overwritten. */
+ if((file = H5Fcreate (FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0)
+ goto error;
+
+ nerrors += create_dset1(file);
+ nerrors += create_dset2(file);
+
+ if(H5Fclose (file) < 0)
+ goto error;
+
+ /* Re-open the file for testing performance. */
+ if((file = H5Fopen (FILENAME, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
+ goto error;
+
+ nerrors += check_partial_chunks_perf(file);
+ nerrors += check_hash_value_perf(file);
+
+ if(H5Fclose (file) < 0)
+ goto error;
+
+ if (nerrors>0) goto error;
+ cleanup();
+ return 0;
+
+error:
+ fprintf(stderr, "*** ERRORS DETECTED ***\n");
+ return 1;
+}
diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c
index eac099b..2d9c44f 100644
--- a/tools/test/perform/iopipe.c
+++ b/tools/test/perform/iopipe.c
@@ -224,7 +224,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill raw");
+ HDfprintf (stderr, HEADING, "fill raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -262,7 +262,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "fill hdf5");
+ HDfprintf (stderr, HEADING, "fill hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -301,7 +301,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out raw");
+ HDfprintf (stderr, HEADING, "out raw");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -341,7 +341,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "out hdf5");
+ HDfprintf (stderr, HEADING, "out hdf5");
for(u = 0; u < nwrite; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -380,7 +380,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in raw");
+ HDfprintf (stderr, HEADING, "in raw");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -421,7 +421,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5");
+ HDfprintf (stderr, HEADING, "in hdf5");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
@@ -465,7 +465,7 @@ main (void)
_ftime(tbstart);
#endif
#endif
- fprintf (stderr, HEADING, "in hdf5 partial");
+ HDfprintf (stderr, HEADING, "in hdf5 partial");
for(u = 0; u < nread; u++) {
putc (PROGRESS, stderr);
HDfflush(stderr);
diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c
index 81f9de6..108d9e4 100644
--- a/tools/test/perform/overhead.c
+++ b/tools/test/perform/overhead.c
@@ -84,9 +84,9 @@ typedef enum fill_t {
static void
usage(const char *prog)
{
- fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
+ HDfprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n",
prog);
- fprintf(stderr, "\
+ HDfprintf(stderr, "\
STYLE is the order that the dataset is filled and should be one of:\n\
forward -- Fill the dataset from lowest address to highest\n\
address. This style tests the right split ratio.\n\
@@ -401,6 +401,6 @@ main(int argc, char *argv[])
return 0;
error:
- fprintf(stderr, "*** ERRORS DETECTED ***\n");
+ HDfprintf(stderr, "*** ERRORS DETECTED ***\n");
return 1;
}
diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c
index c6e62d5..34b8a2d 100644
--- a/tools/test/perform/perf.c
+++ b/tools/test/perform/perf.c
@@ -22,6 +22,7 @@
#include "hdf5.h"
#include "H5private.h"
+#include "h5test.h"
#ifdef H5_HAVE_PARALLEL
@@ -63,13 +64,13 @@
#define H5FATAL 1
#define VRFY(val, mesg, fatal) do { \
if (!val) { \
- printf("Proc %d: ", mynod); \
+ printf("Proc %d: ", mynod); \
printf("*** Assertion failed (%s) at line %4d in %s\n", \
- mesg, (int)__LINE__, __FILE__); \
- if (fatal){ \
- fflush(stdout); \
- goto die_jar_jar_die; \
- } \
+ mesg, (int)__LINE__, __FILE__); \
+ if (fatal){ \
+ fflush(stdout); \
+ goto die_jar_jar_die; \
+ } \
} \
} while(0)
#define RANK 1
@@ -77,7 +78,7 @@
hsize_t dims[RANK]; /* dataset dim sizes */
hsize_t block[RANK], stride[RANK], count[RANK];
-hssize_t start[RANK];
+hsize_t start[RANK];
hid_t fid; /* HDF5 file ID */
hid_t acc_tpl; /* File access templates */
hid_t sid; /* Dataspace ID */
@@ -240,7 +241,7 @@ int main(int argc, char **argv)
*/
for(j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -293,7 +294,7 @@ int main(int argc, char **argv)
/* we are going to repeat the read the same pattern the write used */
for (j=0; j < opt_iter; j++) {
/* setup a file dataspace selection */
- start[0] = (j*iter_jump)+(mynod*opt_block);
+ start[0] = (hsize_t)((j * iter_jump) + (mynod * opt_block));
stride[0] = block[0] = opt_block;
count[0]= 1;
ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block);
@@ -320,13 +321,13 @@ int main(int argc, char **argv)
VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL);
- if (ret < 0) fprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
+ if (ret < 0) HDfprintf(stderr, "node %d, read error, loc = %Ld: %s\n",
mynod, mynod*opt_block, strerror(myerrno));
/* if the user wanted to check correctness, compare the write
* buffer to the read buffer */
if (opt_correct && memcmp(buf, buf2, opt_block)) {
- fprintf(stderr, "node %d, correctness test failed\n", mynod);
+ HDfprintf(stderr, "node %d, correctness test failed\n", mynod);
my_correct = 0;
MPI_Allreduce(&my_correct, &correct, 1, MPI_INT, MPI_MIN,
MPI_COMM_WORLD);
@@ -435,10 +436,12 @@ parse_args(int argc, char **argv)
* e.g., -a4096/512 allocate at 4096 bytes
* boundary if request size >= 512.
*/
- {char *p;
- opt_alignment = atoi(optarg);
- if (p=(char*)strchr(optarg, '/'))
- opt_threshold = atoi(p+1);
+ {
+ char *p;
+
+ opt_alignment = HDatoi(optarg);
+ if(NULL != (p = (char*)HDstrchr(optarg, '/')))
+ opt_threshold = HDatoi(p + 1);
}
HDfprintf(stdout,
"alignment/threshold=%Hu/%Hu\n",
diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c
index c24e598..b56f074 100644
--- a/tools/test/perform/perf_meta.c
+++ b/tools/test/perform/perf_meta.c
@@ -313,7 +313,7 @@ create_dsets(hid_t file)
* Create a dataset using the default dataset creation properties.
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto error;
@@ -378,14 +378,14 @@ create_attrs_1(void)
* Create all(user specifies the number) attributes for each dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -422,7 +422,7 @@ create_attrs_1(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
+ HDfprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(open_t, close_t, attr_t);
}
@@ -480,7 +480,7 @@ create_attrs_2(void)
* Create all(user specifies the number) attributes for each new dataset
*/
for(i = 0; i < NUM_DSETS; i++) {
- sprintf(dset_name, "dataset %d", i);
+ HDsprintf(dset_name, "dataset %d", i);
create_t.start = retrieve_time();
if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE,
space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -488,7 +488,7 @@ create_attrs_2(void)
perf(&create_t, create_t.start, retrieve_time());
for(j = 0; j < NUM_ATTRS; j++) {
- sprintf(attr_name, "all attrs for each dset %d", j);
+ HDsprintf(attr_name, "all attrs for each dset %d", j);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -525,7 +525,7 @@ create_attrs_2(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
+ HDfprintf(stderr, "2. Create %d attributes for each of %d new datasets\n",
NUM_ATTRS, NUM_DSETS);
print_perf(create_t, close_t, attr_t);
}
@@ -593,14 +593,14 @@ create_attrs_3(void)
for(i = 0; i < loop_num; i++) {
for(j = 0; j < NUM_DSETS; j++) {
- sprintf(dset_name, "dataset %d", j);
+ HDsprintf(dset_name, "dataset %d", j);
open_t.start = retrieve_time();
if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0)
goto error;
perf(&open_t, open_t.start, retrieve_time());
for(k = 0; k < BATCH_ATTRS; k++) {
- sprintf(attr_name, "some attrs for each dset %d %d", i, k);
+ HDsprintf(attr_name, "some attrs for each dset %d %d", i, k);
attr_t.start = retrieve_time();
if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE,
small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0)
@@ -637,7 +637,7 @@ create_attrs_3(void)
attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS);
/* Print out the performance result */
- fprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
+ HDfprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n",
BATCH_ATTRS, NUM_DSETS, loop_num);
print_perf(open_t, close_t, attr_t);
}
@@ -750,12 +750,12 @@ void perf(p_time *perf_t, double start_t, double end_t)
*/
void print_perf(p_time open_t, p_time close_t, p_time attr_t)
{
- fprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
open_t.func, open_t.avg, open_t.max, open_t.min);
- fprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
close_t.avg, close_t.max, close_t.min);
if(NUM_ATTRS)
- fprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
+ HDfprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n",
attr_t.avg, attr_t.max, attr_t.min);
}
@@ -799,7 +799,7 @@ main(int argc, char **argv)
#ifdef H5_HAVE_PARALLEL
if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS))
#endif /*H5_HAVE_PARALLEL*/
- fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
+ HDfprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n");
fapl = H5Pcreate (H5P_FILE_ACCESS);
#ifdef H5_HAVE_PARALLEL
diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c
index 1c0d621..77c04ab 100644
--- a/tools/test/perform/pio_engine.c
+++ b/tools/test/perform/pio_engine.c
@@ -61,14 +61,14 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define GOTODONE { goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
#define MSG(mesg) { \
- fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
- fprintf(stderr, "(%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \
+ HDfprintf(stderr, "(%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -82,6 +82,12 @@
/* POSIX I/O macros */
+#ifdef H5_HAVE_WIN32_API
+/* Can't link against the library, so this test will use the older, non-Unicode
+ * _open() call on Windows.
+ */
+#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#endif /* H5_HAVE_WIN32_API */
#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
#define POSIXOPEN(fn, F) HDopen(fn, F, 0600)
#define POSIXCLOSE(F) HDclose(F)
@@ -188,7 +194,7 @@ do_pio(parameters param)
break;
default:
/* unknown request */
- fprintf(stderr, "Unknown IO type request (%d)\n", iot);
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", iot);
GOTOERROR(FAIL);
}
@@ -207,21 +213,21 @@ do_pio(parameters param)
}
if (param.num_files < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of files must be >= 0 (%ld)\n",
param.num_files);
GOTOERROR(FAIL);
}
if (ndsets < 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of datasets per file must be >= 0 (%ld)\n",
ndsets);
GOTOERROR(FAIL);
}
if (param.num_procs <= 0 ) {
- fprintf(stderr,
+ HDfprintf(stderr,
"maximum number of process to use must be > 0 (%d)\n",
param.num_procs);
GOTOERROR(FAIL);
@@ -286,7 +292,7 @@ do_pio(parameters param)
/* output all of the times for all iterations */
if (myrank == 0)
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
}
for (nf = 1; nf <= param.num_files; nf++) {
@@ -296,7 +302,7 @@ do_pio(parameters param)
/* Open file for write */
char base_name[256];
- sprintf(base_name, "#pio_tmp_%lu", nf);
+ HDsprintf(base_name, "#pio_tmp_%lu", nf);
pio_create_filename(iot, base_name, fname, sizeof(fname));
if (pio_debug_level > 0)
HDfprintf(output, "rank %d: data filename=%s\n",
@@ -305,22 +311,21 @@ do_pio(parameters param)
/* Need barrier to make sure everyone starts at the same time */
MPI_Barrier(pio_comm_g);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_CREATE | PIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- hrc == SUCCESS;
- set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -334,20 +339,20 @@ do_pio(parameters param)
MPI_Barrier(pio_comm_g);
/* Open file for read */
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, PIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
+ io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(&res, &fd, &param, ndsets, nbytes, buf_size, buffer);
- set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -380,7 +385,7 @@ done:
/* release generic resources */
if(buffer)
- free(buffer);
+ HDfree(buffer);
res.ret_code = ret_code;
return res;
}
@@ -615,7 +620,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Prepare buffer for verifying data */
if (parms->verify)
- memset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
+ HDmemset(buffer,pio_mpi_rank_g+1,buf_size*blk_size);
} /* end else */
@@ -848,7 +853,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -856,7 +861,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -878,7 +883,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
case PHDF5:
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* 1D dataspace */
@@ -889,7 +894,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[0] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 1, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -902,25 +907,25 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
h5dims[1] = blk_size;
hrc = H5Pset_chunk(h5dcpl, 2, h5dims);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
}/* end else */
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, h5dcpl);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset Create failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Create failed\n");
GOTOERROR(FAIL);
}
hrc = H5Pclose(h5dcpl);
/* verifying the close of the dcpl */
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
break;
@@ -953,7 +958,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Write */
@@ -1384,7 +1389,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -1393,7 +1398,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -1450,7 +1455,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -1460,7 +1465,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -1470,7 +1475,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -1819,7 +1824,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1827,7 +1832,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
if(parms->collective) {
hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
@@ -1847,10 +1852,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
break;
case PHDF5:
- sprintf(dname, "Dataset_%ld", ndset);
+ HDsprintf(dname, "Dataset_%ld", ndset);
h5ds_id = H5DOPEN(fd->h5fd, dname);
if (h5ds_id < 0) {
- fprintf(stderr, "HDF5 Dataset open failed\n");
+ HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
@@ -1884,7 +1889,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end else */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
while (nbytes_xfer < bytes_count){
/* Read */
@@ -2339,7 +2344,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
} /* end while */
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
@@ -2348,7 +2353,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -2405,7 +2410,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -2415,7 +2420,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -2425,7 +2430,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -2456,7 +2461,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fd->posixfd = POSIXOPEN(fname, O_RDONLY);
if (fd->posixfd < 0 ) {
- fprintf(stderr, "POSIX File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2480,7 +2485,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
@@ -2488,13 +2493,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
/*filesize , set size to 0 explicitedly. */
mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_File_set_size failed\n");
+ HDfprintf(stderr, "MPI_File_set_size failed\n");
GOTOERROR(FAIL);
}
} else {
mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI File Open failed(%s)\n", fname);
+ HDfprintf(stderr, "MPI File Open failed(%s)\n", fname);
GOTOERROR(FAIL);
}
}
@@ -2503,19 +2508,19 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
case PHDF5:
if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
/* Set the file driver to the MPI-IO driver */
if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
/* Set the alignment of objects in HDF5 file */
if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
}
@@ -2525,13 +2530,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
else
fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl);
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
/* verifying the close of the acc_tpl */
if (H5Pclose(acc_tpl) < 0) {
- fprintf(stderr, "HDF5 Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Property List Close failed\n");
GOTOERROR(FAIL);
}
@@ -2560,7 +2565,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2571,7 +2576,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
mrc = MPI_File_close(&fd->mpifd);
if (mrc != MPI_SUCCESS){
- fprintf(stderr, "MPI File close failed\n");
+ HDfprintf(stderr, "MPI File close failed\n");
GOTOERROR(FAIL);
}
@@ -2582,7 +2587,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
@@ -2616,7 +2621,7 @@ do_cleanupfile(iotype iot, char *fname)
if (clean_file_g){
switch (iot){
case POSIXIO:
- remove(fname);
+ HDremove(fname);
break;
case MPIO:
case PHDF5:
@@ -2634,9 +2639,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, TSTART);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -2645,9 +2650,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_READ, TSTART);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTART);
err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_READ, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_READ, TSTOP);
return err;
}
@@ -2655,9 +2660,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, TSTART);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
@@ -2665,9 +2670,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf,
int count, MPI_Datatype datatype, MPI_Status *status)
{
int err;
- set_time(timer_g, HDF5_MPI_WRITE, TSTART);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTART);
err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status);
- set_time(timer_g, HDF5_MPI_WRITE, TSTOP);
+ io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP);
return err;
}
diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c
index 597629e..9f4d116 100644
--- a/tools/test/perform/pio_perf.c
+++ b/tools/test/perform/pio_perf.c
@@ -277,13 +277,13 @@ struct options {
unsigned interleaved; /* Interleaved vs. contiguous blocks */
unsigned collective; /* Collective vs. independent I/O */
unsigned dim2d; /* 1D vs. 2D geometry */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
off_t h5_alignment; /* alignment in HDF5 file */
off_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
};
typedef struct _minmax {
@@ -339,12 +339,12 @@ main(int argc, char **argv)
ret = MPI_Comm_size(MPI_COMM_WORLD, &comm_world_nprocs_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_size call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -353,12 +353,12 @@ main(int argc, char **argv)
ret = MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank_g);
if (ret != MPI_SUCCESS) {
- fprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
+ HDfprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname);
if (ret == MPI_ERR_COMM)
- fprintf(stderr, "invalid MPI communicator\n");
+ HDfprintf(stderr, "invalid MPI communicator\n");
else
- fprintf(stderr, "invalid argument\n");
+ HDfprintf(stderr, "invalid argument\n");
exit_value = EXIT_FAILURE;
goto finish;
@@ -376,7 +376,7 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
perror(opts->output_file);
goto finish;
}
@@ -587,74 +587,74 @@ run_test(iotype iot, parameters parms, struct options *opts)
res = do_pio(parms);
/* gather all of the "mpi write" times */
- t = get_time(res.timers, HDF5_MPI_WRITE);
+ t = io_time_get(res.timers, HDF5_MPI_WRITE);
get_minmax(&write_mpi_mm, t);
write_mpi_mm_table[i] = write_mpi_mm;
/* gather all of the "write" times */
- t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
get_minmax(&write_mm, t);
write_mm_table[i] = write_mm;
/* gather all of the "write" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
get_minmax(&write_gross_mm, t);
write_gross_mm_table[i] = write_gross_mm;
/* gather all of the raw "write" times */
- t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
get_minmax(&write_raw_mm, t);
write_raw_mm_table[i] = write_raw_mm;
/* gather all of the file open times (time from open to first write) */
- t = get_time(res.timers, HDF5_FILE_WRITE_OPEN);
+ t = io_time_get(res.timers, HDF5_FILE_WRITE_OPEN);
get_minmax(&write_open_mm, t);
write_open_mm_table[i] = write_open_mm;
/* gather all of the file close times (time from last write to close) */
- t = get_time(res.timers, HDF5_FILE_WRITE_CLOSE);
+ t = io_time_get(res.timers, HDF5_FILE_WRITE_CLOSE);
get_minmax(&write_close_mm, t);
write_close_mm_table[i] = write_close_mm;
if (!parms.h5_write_only) {
/* gather all of the "mpi read" times */
- t = get_time(res.timers, HDF5_MPI_READ);
+ t = io_time_get(res.timers, HDF5_MPI_READ);
get_minmax(&read_mpi_mm, t);
read_mpi_mm_table[i] = read_mpi_mm;
/* gather all of the "read" times */
- t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
get_minmax(&read_mm, t);
read_mm_table[i] = read_mm;
/* gather all of the "read" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
get_minmax(&read_gross_mm, t);
read_gross_mm_table[i] = read_gross_mm;
/* gather all of the raw "read" times */
- t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
get_minmax(&read_raw_mm, t);
read_raw_mm_table[i] = read_raw_mm;
/* gather all of the file open times (time from open to first read) */
- t = get_time(res.timers, HDF5_FILE_READ_OPEN);
+ t = io_time_get(res.timers, HDF5_FILE_READ_OPEN);
get_minmax(&read_open_mm, t);
read_open_mm_table[i] = read_open_mm;
/* gather all of the file close times (time from last read to close) */
- t = get_time(res.timers, HDF5_FILE_READ_CLOSE);
+ t = io_time_get(res.timers, HDF5_FILE_READ_CLOSE);
get_minmax(&read_close_mm, t);
read_close_mm_table[i] = read_close_mm;
@@ -667,7 +667,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -733,7 +733,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -925,7 +925,7 @@ create_comm_world(int num_procs, int *doing_pio)
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
if (num_procs > nprocs) {
- fprintf(stderr,
+ HDfprintf(stderr,
"number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n",
num_procs, nprocs);
goto error_done;
@@ -936,7 +936,7 @@ create_comm_world(int num_procs, int *doing_pio)
mrc = MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &pio_comm_g);
if (mrc != MPI_SUCCESS) {
- fprintf(stderr, "MPI_Comm_split failed\n");
+ HDfprintf(stderr, "MPI_Comm_split failed\n");
goto error_done;
}
@@ -1065,9 +1065,9 @@ output_report(const char *fmt, ...)
if (myrank == 0) {
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
}
@@ -1087,10 +1087,10 @@ print_indent(register int indent)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
}
@@ -1115,11 +1115,11 @@ static void
print_io_api(long io_types)
{
if (io_types & PIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & PIO_MPI)
- HDfprintf(output, "mpiio ");
+ HDfprintf(output, "mpiio ");
if (io_types & PIO_HDF5)
- HDfprintf(output, "phdf5 ");
+ HDfprintf(output, "phdf5 ");
HDfprintf(output, "\n");
}
@@ -1128,7 +1128,7 @@ report_parameters(struct options *opts)
{
int rank = comm_world_rank_g;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "rank %d: ==== Parameters ====\n", rank);
HDfprintf(output, "rank %d: IO API=", rank);
@@ -1303,9 +1303,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= PIO_POSIX;
} else {
- fprintf(stderr, "pio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1345,17 +1345,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
if (!isdigit(buf[j])) {
- fprintf(stderr, "pio_perf: invalid --debug option %s\n",
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
pio_debug_level = atoi(buf);
@@ -1379,8 +1379,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1396,13 +1396,13 @@ parse_command_line(int argc, char *argv[])
cl_opts->num_bpp = parse_size_directive(opt_arg);
break;
case 'F':
- cl_opts->num_files = atoi(opt_arg);
+ cl_opts->num_files = HDatoi(opt_arg);
break;
case 'g':
cl_opts->dim2d = 1;
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'I':
cl_opts->interleaved = 1;
@@ -1411,10 +1411,10 @@ parse_command_line(int argc, char *argv[])
cl_opts->output_file = opt_arg;
break;
case 'p':
- cl_opts->min_num_procs = atoi(opt_arg);
+ cl_opts->min_num_procs = HDatoi(opt_arg);
break;
case 'P':
- cl_opts->max_num_procs = atoi(opt_arg);
+ cl_opts->max_num_procs = HDatoi(opt_arg);
break;
case 'T':
cl_opts->h5_threshold = parse_size_directive(opt_arg);
@@ -1432,7 +1432,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1526,8 +1526,8 @@ parse_size_directive(const char *size)
s *= ONE_GB;
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1540,7 +1540,7 @@ parse_size_directive(const char *size)
* Return: Nothing
* Programmer: Bill Wendling, 31. October 2001
* Modifications:
- * Added 2D testing (Christian Chilan, 10. August 2005)
+ * Added 2D testing (Christian Chilan, 10. August 2005)
*/
static void
usage(const char *prog)
@@ -1550,125 +1550,125 @@ usage(const char *prog)
MPI_Comm_rank(pio_comm_g, &myrank);
if (myrank == 0) {
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h, --help Print a usage message and exit\n");
- printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
- printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h, --help Print a usage message and exit\n");
+ HDprintf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n");
+ HDprintf(" -A AL, --api=AL Which APIs to test [default: all of them]\n");
#if 0
- printf(" -b, --binary The elusive binary option\n");
+ HDprintf(" -b, --binary The elusive binary option\n");
#endif /* 0 */
- printf(" -B S, --block-size=S Block size within transfer buffer\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
- printf(" [default: contiguous storage]\n");
- printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
- printf(" [default: independent I/O)\n");
- printf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
- printf(" -D DL, --debug=DL Indicate the debugging level\n");
- printf(" [default: no debugging]\n");
- printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
- printf(" (see below for description)\n");
- printf(" [default: 256K for 1D, 8K for 2D]\n");
- printf(" -F N, --num-files=N Number of files [default: 1]\n");
- printf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
- printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
- printf(" -I, --interleaved Interleaved access pattern\n");
- printf(" (see below for example)\n");
- printf(" [default: Contiguous access pattern]\n");
- printf(" -o F, --output=F Output raw data into file F [default: none]\n");
- printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
- printf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
- printf(" [default: all MPI_COMM_WORLD processes ]\n");
- printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
- printf(" [default: 1]\n");
- printf(" -w, --write-only Perform write tests not the read tests\n");
- printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
- printf(" (see below for description)\n");
- printf(" [default: half the number of bytes per process\n");
- printf(" per dataset]\n");
- printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
- printf(" [default: the number of bytes per process per\n");
- printf(" dataset]\n");
- printf("\n");
- printf(" F - is a filename.\n");
- printf(" N - is an integer >=0.\n");
- printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" phdf5 - Parallel HDF5\n");
- printf(" mpiio - MPI-I/O\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: --api=mpiio,phdf5\n");
- printf("\n");
- printf(" Dataset size:\n");
- printf(" Depending on the selected geometry, each test dataset is either a linear\n");
- printf(" array of size bytes-per-process * num-processes, or a square array of size\n");
- printf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
- printf("\n");
- printf(" Block size vs. Transfer buffer size:\n");
- printf(" buffer-size controls the size of the memory buffer, which is broken into\n");
- printf(" blocks and written to the file. Depending on the selected geometry, each\n");
- printf(" block can be a linear array of size block-size or a square array of size\n");
- printf(" block-size x block-size. The arrangement in which blocks are written is\n");
- printf(" determined by the access pattern.\n");
- printf("\n");
- printf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
- printf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
- printf(" or buffer-size x block-size if interleaved pattern is selected.\n");
- printf("\n");
- printf(" Interleaved and Contiguous patterns in 1D geometry:\n");
- printf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
- printf(" into num-processes regions and each process writes data to its own region.\n");
- printf(" When interleaved blocks are written to a dataset, space for the first\n");
- printf(" block of the first process is allocated in the dataset, then space is\n");
- printf(" allocated for the first block of the second process, etc. until space is\n");
- printf(" allocated for the first block of each process, then space is allocated for\n");
- printf(" the second block of the first process, the second block of the second\n");
- printf(" process, etc.\n");
- printf("\n");
- printf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
- printf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
- printf(" requests to complete access to the dataset.\n");
- printf(" Contiguous blocks of the first transfer request are written like so:\n");
- printf(" 1111----2222----3333----\n");
- printf(" Interleaved blocks of the first transfer request are written like so:\n");
- printf(" 123123123123------------\n");
- printf(" The actual number of I/O operations involved in a transfer request\n");
- printf(" depends on the access pattern and communication mode.\n");
- printf(" When using independent I/O with interleaved pattern, each process\n");
- printf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
- printf(" If collective I/O is turned on, the combined content of the buffers of\n");
- printf(" the 3 processes will be written using one collective I/O operation\n");
- printf(" per transfer request.\n");
- printf("\n");
- printf(" For information about access patterns in 2D geometry, please refer to the\n");
- printf(" HDF5 Reference Manual.\n");
- printf("\n");
- printf(" DL - is a list of debugging flags. Valid values are:\n");
- printf(" 1 - Minimal\n");
- printf(" 2 - Not quite everything\n");
- printf(" 3 - Everything\n");
- printf(" 4 - The kitchen sink\n");
- printf(" r - Raw data I/O throughput information\n");
- printf(" t - Times as well as throughputs\n");
- printf(" v - Verify data correctness\n");
- printf("\n");
- printf(" Example: --debug=2,r,t\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
- printf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
+ HDprintf(" -B S, --block-size=S Block size within transfer buffer\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -c, --chunk Create HDF5 datasets using chunked storage\n");
+ HDprintf(" [default: contiguous storage]\n");
+ HDprintf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n");
+ HDprintf(" [default: independent I/O)\n");
+ HDprintf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n");
+ HDprintf(" -D DL, --debug=DL Indicate the debugging level\n");
+ HDprintf(" [default: no debugging]\n");
+ HDprintf(" -e S, --num-bytes=S Number of bytes per process per dataset\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: 256K for 1D, 8K for 2D]\n");
+ HDprintf(" -F N, --num-files=N Number of files [default: 1]\n");
+ HDprintf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n");
+ HDprintf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n");
+ HDprintf(" -I, --interleaved Interleaved access pattern\n");
+ HDprintf(" (see below for example)\n");
+ HDprintf(" [default: Contiguous access pattern]\n");
+ HDprintf(" -o F, --output=F Output raw data into file F [default: none]\n");
+ HDprintf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n");
+ HDprintf(" -P N, --max-num-processes=N Maximum number of processes to use\n");
+ HDprintf(" [default: all MPI_COMM_WORLD processes ]\n");
+ HDprintf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -w, --write-only Perform write tests not the read tests\n");
+ HDprintf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n");
+ HDprintf(" (see below for description)\n");
+ HDprintf(" [default: half the number of bytes per process\n");
+ HDprintf(" per dataset]\n");
+ HDprintf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n");
+ HDprintf(" [default: the number of bytes per process per\n");
+ HDprintf(" dataset]\n");
+ HDprintf("\n");
+ HDprintf(" F - is a filename.\n");
+ HDprintf(" N - is an integer >=0.\n");
+ HDprintf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" phdf5 - Parallel HDF5\n");
+ HDprintf(" mpiio - MPI-I/O\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: --api=mpiio,phdf5\n");
+ HDprintf("\n");
+ HDprintf(" Dataset size:\n");
+ HDprintf(" Depending on the selected geometry, each test dataset is either a linear\n");
+ HDprintf(" array of size bytes-per-process * num-processes, or a square array of size\n");
+ HDprintf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n");
+ HDprintf("\n");
+ HDprintf(" Block size vs. Transfer buffer size:\n");
+ HDprintf(" buffer-size controls the size of the memory buffer, which is broken into\n");
+ HDprintf(" blocks and written to the file. Depending on the selected geometry, each\n");
+ HDprintf(" block can be a linear array of size block-size or a square array of size\n");
+ HDprintf(" block-size x block-size. The arrangement in which blocks are written is\n");
+ HDprintf(" determined by the access pattern.\n");
+ HDprintf("\n");
+ HDprintf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n");
+ HDprintf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n");
+ HDprintf(" or buffer-size x block-size if interleaved pattern is selected.\n");
+ HDprintf("\n");
+ HDprintf(" Interleaved and Contiguous patterns in 1D geometry:\n");
+ HDprintf(" When contiguous access pattern is chosen, the dataset is evenly divided\n");
+ HDprintf(" into num-processes regions and each process writes data to its own region.\n");
+ HDprintf(" When interleaved blocks are written to a dataset, space for the first\n");
+ HDprintf(" block of the first process is allocated in the dataset, then space is\n");
+ HDprintf(" allocated for the first block of the second process, etc. until space is\n");
+ HDprintf(" allocated for the first block of each process, then space is allocated for\n");
+ HDprintf(" the second block of the first process, the second block of the second\n");
+ HDprintf(" process, etc.\n");
+ HDprintf("\n");
+ HDprintf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n");
+ HDprintf(" buffer size, and 64KB block size, each process must issue 2 transfer\n");
+ HDprintf(" requests to complete access to the dataset.\n");
+ HDprintf(" Contiguous blocks of the first transfer request are written like so:\n");
+ HDprintf(" 1111----2222----3333----\n");
+ HDprintf(" Interleaved blocks of the first transfer request are written like so:\n");
+ HDprintf(" 123123123123------------\n");
+ HDprintf(" The actual number of I/O operations involved in a transfer request\n");
+ HDprintf(" depends on the access pattern and communication mode.\n");
+ HDprintf(" When using independent I/O with interleaved pattern, each process\n");
+ HDprintf(" performs 4 small non-contiguous I/O operations per transfer request.\n");
+ HDprintf(" If collective I/O is turned on, the combined content of the buffers of\n");
+ HDprintf(" the 3 processes will be written using one collective I/O operation\n");
+ HDprintf(" per transfer request.\n");
+ HDprintf("\n");
+ HDprintf(" For information about access patterns in 2D geometry, please refer to the\n");
+ HDprintf(" HDF5 Reference Manual.\n");
+ HDprintf("\n");
+ HDprintf(" DL - is a list of debugging flags. Valid values are:\n");
+ HDprintf(" 1 - Minimal\n");
+ HDprintf(" 2 - Not quite everything\n");
+ HDprintf(" 3 - Everything\n");
+ HDprintf(" 4 - The kitchen sink\n");
+ HDprintf(" r - Raw data I/O throughput information\n");
+ HDprintf(" t - Times as well as throughputs\n");
+ HDprintf(" v - Verify data correctness\n");
+ HDprintf("\n");
+ HDprintf(" Example: --debug=2,r,t\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n");
+ HDprintf(" HDF5_PARAPREFIX Paralllel data files prefix\n");
fflush(stdout);
} /* end if */
} /* end usage() */
@@ -1685,7 +1685,7 @@ usage(const char *prog)
int
main(void)
{
- printf("No parallel IO performance because parallel is not configured\n");
+ HDprintf("No parallel IO performance because parallel is not configured\n");
return EXIT_SUCCESS;
} /* end main */
diff --git a/tools/test/perform/pio_standalone.c b/tools/test/perform/pio_standalone.c
index bd5fb6f..022e390 100644
--- a/tools/test/perform/pio_standalone.c
+++ b/tools/test/perform/pio_standalone.c
@@ -162,118 +162,8 @@ print_version(const char *progname)
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-
-/** From h5test.c **/
-
#ifdef H5_HAVE_PARALLEL
MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
#endif
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value=0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
- char *next, *valp;
-
-
- valp = envp = next = HDstrdup(envp);
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char *key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = calloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- /* eat up any ending white spaces */
- endp = &namep[strlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
-
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY+1];
- char value[MPI_MAX_INFO_VAL+1];
- int flag;
- int i, nkeys;
-
- printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
- if (info==MPI_INFO_NULL){
- printf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- printf("object has %d items\n", nkeys);
- for (i=0; i<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h
index a40cff8..e6db2e8 100644
--- a/tools/test/perform/pio_standalone.h
+++ b/tools/test/perform/pio_standalone.h
@@ -294,6 +294,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -355,6 +356,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c
index 4fead3f..07a39cb 100644
--- a/tools/test/perform/sio_engine.c
+++ b/tools/test/perform/sio_engine.c
@@ -41,7 +41,7 @@
#define GOTOERROR(errcode) { ret_code = errcode; goto done; }
#define ERRMSG(mesg) { \
- fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
+ HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \
mesg, (int)__LINE__, __FILE__); \
}
@@ -54,6 +54,12 @@
} while(0)
/* POSIX I/O macros */
+#ifdef H5_HAVE_WIN32_API
+/* Can't link against the library, so this test will use the older, non-Unicode
+ * _open() call on Windows.
+ */
+#define HDopen(S,F,...) _open(S, F | _O_BINARY, __VA_ARGS__)
+#endif /* H5_HAVE_WIN32_API */
#define POSIXCREATE(fn) HDopen(fn, O_CREAT|O_TRUNC|O_RDWR, 0600)
#define POSIXOPEN(fn, F) HDopen(fn, F, 0600)
#define POSIXCLOSE(F) HDclose(F)
@@ -192,7 +198,7 @@ do_sio(parameters param, results *res)
if (sio_debug_level >= 4)
/* output all of the times for all iterations */
- fprintf(output, "Timer details:\n");
+ HDfprintf(output, "Timer details:\n");
/*
* Write performance measurement
@@ -206,18 +212,18 @@ do_sio(parameters param, results *res)
HDfprintf(output, "data filename=%s\n",
fname);
- set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_CREATE | SIO_WRITE);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART);
hrc = do_write(res, &fd, &param, buffer);
- set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_write failed");
/* Close file for write */
hrc = do_fclose(iot, &fd);
- set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
if (!param.h5_write_only) {
@@ -226,19 +232,19 @@ do_sio(parameters param, results *res)
*/
/* Open file for read */
- set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART);
hrc = do_fopen(&param, fname, &fd, SIO_READ);
VRFY((hrc == SUCCESS), "do_fopen failed");
- set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART);
hrc = do_read(res, &fd, &param, buffer);
- set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_read failed");
/* Close file for read */
hrc = do_fclose(iot, &fd);
- set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP);
VRFY((hrc == SUCCESS), "do_fclose failed");
}
@@ -258,7 +264,7 @@ done:
case HDF5:
if (fd.h5fd != -1)
hrc = do_fclose(iot, &fd);
- break;
+ break;
default:
/* unknown request */
HDassert(0 && "Unknown IO type");
@@ -484,7 +490,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -506,7 +512,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
h5dcpl = H5Pcreate(H5P_DATASET_CREATE);
if (h5dcpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -514,12 +520,12 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Set the chunk size to be the same as the buffer size */
hrc = H5Pset_chunk(h5dcpl, rank, h5chunk);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Property List Set failed\n");
+ HDfprintf(stderr, "HDF5 Property List Set failed\n");
GOTOERROR(FAIL);
} /* end if */
} /* end if */
- sprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes);
h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE,
h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT);
@@ -544,19 +550,19 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
}
/* Start "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART);
/* Perform write */
hrc = dset_write(rank-1, fd, parms, buffer);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset write\n");
+ HDfprintf(stderr, "Error in dataset write\n");
GOTOERROR(FAIL);
}
/* Stop "raw data" write timer */
- set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP);
/* Calculate write time */
@@ -565,7 +571,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -578,7 +584,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -588,7 +594,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -598,7 +604,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -679,7 +685,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer)
VRFY((hrc >= 0), "H5Dwrite");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -831,7 +837,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
/* Create the dataset transfer property list */
h5dxpl = H5Pcreate(H5P_DATASET_XFER);
if (h5dxpl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
break;
@@ -850,14 +856,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
break;
case HDF5:
- sprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
+ HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes);
h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT);
if (h5ds_id < 0) {
HDfprintf(stderr, "HDF5 Dataset open failed\n");
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -866,16 +872,16 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
} /* end switch */
/* Start "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART);
hrc = dset_read(rank-1, fd, parms, buffer, buffer2);
if (hrc < 0) {
- fprintf(stderr, "Error in dataset read\n");
+ HDfprintf(stderr, "Error in dataset read\n");
GOTOERROR(FAIL);
}
/* Stop "raw data" read timer */
- set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
+ io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP);
/* Calculate read time */
@@ -884,7 +890,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer)
hrc = H5Dclose(h5ds_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Close failed\n");
GOTOERROR(FAIL);
}
@@ -897,7 +903,7 @@ done:
if (h5dset_space_id != -1) {
hrc = H5Sclose(h5dset_space_id);
if (hrc < 0){
- fprintf(stderr, "HDF5 Dataset Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Space Close failed\n");
ret_code = FAIL;
} else {
h5dset_space_id = -1;
@@ -907,7 +913,7 @@ done:
if (h5mem_space_id != -1) {
hrc = H5Sclose(h5mem_space_id);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Memory Space Close failed\n");
+ HDfprintf(stderr, "HDF5 Memory Space Close failed\n");
ret_code = FAIL;
} else {
h5mem_space_id = -1;
@@ -917,7 +923,7 @@ done:
if (h5dxpl != -1) {
hrc = H5Pclose(h5dxpl);
if (hrc < 0) {
- fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
+ HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n");
ret_code = FAIL;
} else {
h5dxpl = -1;
@@ -981,7 +987,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer,
h5dset_space_id, h5dxpl, buffer);
VRFY((hrc >= 0), "H5Dread");
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type);
@@ -1083,7 +1089,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
fapl = set_vfd(param);
if (fapl < 0) {
- fprintf(stderr, "HDF5 Property List Create failed\n");
+ HDfprintf(stderr, "HDF5 Property List Create failed\n");
GOTOERROR(FAIL);
}
@@ -1104,11 +1110,11 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags)
if (fd->h5fd < 0) {
- fprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
+ HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname);
GOTOERROR(FAIL);
}
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type);
@@ -1170,7 +1176,7 @@ set_vfd(parameters *param)
HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
memb_fapl[mt] = H5P_DEFAULT;
- sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
memb_name[mt] = sv[mt];
memb_addr[mt] = (haddr_t)MAX(mt - 1,0) * (HADDR_MAX / 10);
}
@@ -1219,7 +1225,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
rc = POSIXCLOSE(fd->posixfd);
if (rc != 0){
- fprintf(stderr, "POSIX File Close failed\n");
+ HDfprintf(stderr, "POSIX File Close failed\n");
GOTOERROR(FAIL);
}
@@ -1230,13 +1236,13 @@ do_fclose(iotype iot, file_descr *fd /*out*/)
hrc = H5Fclose(fd->h5fd);
if (hrc < 0) {
- fprintf(stderr, "HDF5 File Close failed\n");
+ HDfprintf(stderr, "HDF5 File Close failed\n");
GOTOERROR(FAIL);
}
fd->h5fd = -1;
break;
-
+
default:
/* unknown request */
HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
@@ -1256,7 +1262,15 @@ done:
* Programmer: Albert Cheng 2001/12/12
* Modifications: Support for file drivers. Christian Chilan, April, 2008
*/
- static void
+/* Disable warning for "format not a string literal" here -QAK */
+/*
+ * This pragma only needs to surround the snprintf() calls with
+ * 'temp' in the code below, but early (4.4.7, at least) gcc only
+ * allows diagnostic pragmas to be toggled outside of functions.
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
+static void
do_cleanupfile(iotype iot, char *filename)
{
char temp[2048];
@@ -1269,12 +1283,12 @@ do_cleanupfile(iotype iot, char *filename)
if (clean_file_g){
switch (iot) {
- case POSIXIO:
- HDremove(filename);
- break;
+ case POSIXIO:
+ HDremove(filename);
+ break;
- case HDF5:
- driver = H5Pget_driver(fapl);
+ case HDF5:
+ driver = H5Pget_driver(fapl);
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
@@ -1307,14 +1321,15 @@ do_cleanupfile(iotype iot, char *filename)
HDremove(filename);
}
H5Pclose(fapl);
- break;
-
- default:
- /* unknown request */
- HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
- HDassert(0 && "Unknown IO type");
- break;
- }
+ break;
+
+ default:
+ /* unknown request */
+ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot);
+ HDassert(0 && "Unknown IO type");
+ break;
+ }
}
}
+#pragma GCC diagnostic pop
diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c
index e77b99e..a56558e 100644
--- a/tools/test/perform/sio_perf.c
+++ b/tools/test/perform/sio_perf.c
@@ -98,7 +98,7 @@ static const char *progname = "h5perf_serial";
* It seems that only the options that accept additional information
* such as dataset size (-e) require the colon next to it.
*/
-static const char *s_opts = "a:A:B:b:c:Cd:D:e:F:G:ghi:Imno:p:P:r:stT:v:wx:X:";
+static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:";
static struct long_options l_opts[] = {
{ "align", require_arg, 'a' },
{ "alig", require_arg, 'a' },
@@ -281,14 +281,14 @@ struct options {
int buf_rank; /* Rank */
int order_rank; /* Rank */
int chk_rank; /* Rank */
- int print_times; /* print times as well as throughputs */
- int print_raw; /* print raw data throughput info */
+ int print_times; /* print times as well as throughputs */
+ int print_raw; /* print raw data throughput info */
hsize_t h5_alignment; /* alignment in HDF5 file */
hsize_t h5_threshold; /* threshold for alignment in HDF5 file */
- int h5_use_chunks; /* Make HDF5 dataset chunked */
- int h5_write_only; /* Perform the write tests only */
- int h5_extendable; /* Perform the write tests only */
- int verify; /* Verify data correctness */
+ int h5_use_chunks; /* Make HDF5 dataset chunked */
+ int h5_write_only; /* Perform the write tests only */
+ int h5_extendable; /* Perform the write tests only */
+ int verify; /* Verify data correctness */
vfdtype vfd; /* File driver */
size_t page_buffer_size;
size_t page_size;
@@ -333,7 +333,7 @@ main(int argc, char **argv)
/* Initialize h5tools lib */
h5tools_init();
#endif
-
+
output = stdout;
opts = parse_command_line(argc, argv);
@@ -345,8 +345,8 @@ main(int argc, char **argv)
if (opts->output_file) {
if ((output = HDfopen(opts->output_file, "w")) == NULL) {
- fprintf(stderr, "%s: cannot open output file\n", progname);
- perror(opts->output_file);
+ HDfprintf(stderr, "%s: cannot open output file\n", progname);
+ HDperror(opts->output_file);
goto finish;
}
}
@@ -356,7 +356,7 @@ main(int argc, char **argv)
run_test_loop(opts);
finish:
- free(opts);
+ HDfree(opts);
return exit_value;
}
@@ -385,8 +385,8 @@ static void
run_test_loop(struct options *opts)
{
parameters parms;
- int i;
- size_t buf_bytes;
+ int i;
+ size_t buf_bytes;
/* load options into parameter structure */
parms.num_files = opts->num_files;
@@ -498,50 +498,50 @@ run_test(iotype iot, parameters parms, struct options *opts)
do_sio(parms, &res);
/* gather all of the "sys write" times */
- t = get_time(res.timers, HDF5_MPI_WRITE);
+ t = io_time_get(res.timers, HDF5_MPI_WRITE);
get_minmax(&write_sys_mm, t);
write_sys_mm_table[i] = write_sys_mm;
/* gather all of the "write" times */
- t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS);
get_minmax(&write_mm, t);
write_mm_table[i] = write_mm;
/* gather all of the "write" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS);
get_minmax(&write_gross_mm, t);
write_gross_mm_table[i] = write_gross_mm;
/* gather all of the raw "write" times */
- t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS);
get_minmax(&write_raw_mm, t);
write_raw_mm_table[i] = write_raw_mm;
if (!parms.h5_write_only) {
/* gather all of the "mpi read" times */
- t = get_time(res.timers, HDF5_MPI_READ);
+ t = io_time_get(res.timers, HDF5_MPI_READ);
get_minmax(&read_sys_mm, t);
read_sys_mm_table[i] = read_sys_mm;
/* gather all of the "read" times */
- t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS);
get_minmax(&read_mm, t);
read_mm_table[i] = read_mm;
/* gather all of the "read" times from open to close */
- t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS);
get_minmax(&read_gross_mm, t);
read_gross_mm_table[i] = read_gross_mm;
/* gather all of the raw "read" times */
- t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS);
+ t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS);
get_minmax(&read_raw_mm, t);
read_raw_mm_table[i] = read_gross_mm;
@@ -552,7 +552,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
/*
* Show various statistics
*/
- /* Write statistics */
+ /* Write statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw write" times */
@@ -598,7 +598,7 @@ run_test(iotype iot, parameters parms, struct options *opts)
output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size);
if (!parms.h5_write_only) {
- /* Read statistics */
+ /* Read statistics */
/* Print the raw data throughput if desired */
if (opts->print_raw) {
/* accumulate and output the max, min, and average "raw read" times */
@@ -647,16 +647,16 @@ run_test(iotype iot, parameters parms, struct options *opts)
}
/* clean up our mess */
- free(write_sys_mm_table);
- free(write_mm_table);
- free(write_gross_mm_table);
- free(write_raw_mm_table);
+ HDfree(write_sys_mm_table);
+ HDfree(write_mm_table);
+ HDfree(write_gross_mm_table);
+ HDfree(write_raw_mm_table);
if (!parms.h5_write_only) {
- free(read_sys_mm_table);
- free(read_mm_table);
- free(read_gross_mm_table);
- free(read_raw_mm_table);
+ HDfree(read_sys_mm_table);
+ HDfree(read_mm_table);
+ HDfree(read_gross_mm_table);
+ HDfree(read_raw_mm_table);
}
return ret_value;
@@ -790,9 +790,9 @@ output_report(const char *fmt, ...)
{
va_list ap;
- va_start(ap, fmt);
- vfprintf(output, fmt, ap);
- va_end(ap);
+ HDva_start(ap, fmt);
+ HDvfprintf(output, fmt, ap);
+ HDva_end(ap);
}
/*
@@ -806,10 +806,10 @@ output_report(const char *fmt, ...)
static void
print_indent(register int indent)
{
- indent *= TAB_SPACE;
+ indent *= TAB_SPACE;
- for (; indent > 0; --indent)
- fputc(' ', output);
+ for (; indent > 0; --indent)
+ HDfputc(' ', output);
}
static void
@@ -833,9 +833,9 @@ static void
print_io_api(long io_types)
{
if (io_types & SIO_POSIX)
- HDfprintf(output, "posix ");
+ HDfprintf(output, "posix ");
if (io_types & SIO_HDF5)
- HDfprintf(output, "hdf5 ");
+ HDfprintf(output, "hdf5 ");
HDfprintf(output, "\n");
}
@@ -845,7 +845,7 @@ report_parameters(struct options *opts)
int i, rank;
rank = opts->dset_rank;
- print_version("HDF5 Library"); /* print library version */
+ print_version("HDF5 Library"); /* print library version */
HDfprintf(output, "==== Parameters ====\n");
HDfprintf(output, "IO API=");
@@ -1004,7 +1004,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
if (!HDstrcasecmp(buf, "hdf5")) {
@@ -1012,9 +1012,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(buf, "posix")) {
cl_opts->io_types |= SIO_POSIX;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
if (*end == '\0')
@@ -1043,7 +1043,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->chk_size[j] = parse_size_directive(buf);
@@ -1071,17 +1071,17 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
- if (strlen(buf) > 1 || isdigit(buf[0])) {
+ if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) {
size_t j;
for (j = 0; j < 10 && buf[j] != '\0'; ++j)
- if (!isdigit(buf[j])) {
- fprintf(stderr, "sio_perf: invalid --debug option %s\n",
+ if (!HDisdigit(buf[j])) {
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n",
buf);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
sio_debug_level = atoi(buf);
@@ -1105,8 +1105,8 @@ parse_command_line(int argc, char *argv[])
cl_opts->verify = TRUE;
break;
default:
- fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1129,7 +1129,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->dset_size[j] = parse_size_directive(buf);
@@ -1147,7 +1147,7 @@ parse_command_line(int argc, char *argv[])
break;
case 'i':
- cl_opts->num_iters = atoi(opt_arg);
+ cl_opts->num_iters = HDatoi(opt_arg);
break;
case 'o':
cl_opts->output_file = opt_arg;
@@ -1171,9 +1171,9 @@ parse_command_line(int argc, char *argv[])
} else if (!HDstrcasecmp(opt_arg, "direct")) {
cl_opts->vfd=direct;
} else {
- fprintf(stderr, "sio_perf: invalid --api option %s\n",
+ HDfprintf(stderr, "sio_perf: invalid --api option %s\n",
opt_arg);
- exit(EXIT_FAILURE);
+ HDexit(EXIT_FAILURE);
}
break;
case 'w':
@@ -1193,7 +1193,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->buf_size[j] = parse_size_directive(buf);
@@ -1221,7 +1221,7 @@ parse_command_line(int argc, char *argv[])
HDmemset(buf, '\0', sizeof(buf));
for (i = 0; *end != '\0' && *end != ','; ++end)
- if (isalnum(*end) && i < 10)
+ if (HDisalnum(*end) && i < 10)
buf[i++] = *end;
cl_opts->order[j] = (int)parse_size_directive(buf);
@@ -1243,7 +1243,7 @@ parse_command_line(int argc, char *argv[])
case '?':
default:
usage(progname);
- free(cl_opts);
+ HDfree(cl_opts);
return NULL;
}
}
@@ -1339,8 +1339,8 @@ parse_size_directive(const char *size)
break;
default:
- fprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
- exit(EXIT_FAILURE);
+ HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr);
+ HDexit(EXIT_FAILURE);
}
}
@@ -1357,72 +1357,72 @@ parse_size_directive(const char *size)
static void
usage(const char *prog)
{
- print_version(prog);
- printf("usage: %s [OPTIONS]\n", prog);
- printf(" OPTIONS\n");
- printf(" -h Print an usage message and exit\n");
- printf(" -A AL Which APIs to test\n");
- printf(" [default: all of them]\n");
- printf(" -c SL Selects chunked storage and defines chunks dimensions\n");
- printf(" and sizes\n");
- printf(" [default: Off]\n");
- printf(" -e SL Dimensions and sizes of dataset\n");
- printf(" [default: 100,200]\n");
- printf(" -i N Number of iterations to perform\n");
- printf(" [default: 1]\n");
- printf(" -r NL Dimension access order (see below for description)\n");
- printf(" [default: 1,2]\n");
- printf(" -t Selects extendable dimensions for HDF5 dataset\n");
- printf(" [default: Off]\n");
- printf(" -v VFD Selects file driver for HDF5 access\n");
- printf(" [default: sec2]\n");
- printf(" -w Perform write tests, not the read tests\n");
- printf(" [default: Off]\n");
- printf(" -x SL Dimensions and sizes of the transfer buffer\n");
- printf(" [default: 10,20]\n");
- printf("\n");
- printf(" N - is an integer > 0.\n");
- printf("\n");
- printf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
- printf(" K - Kilobyte (%d)\n", ONE_KB);
- printf(" M - Megabyte (%d)\n", ONE_MB);
- printf(" G - Gigabyte (%d)\n", ONE_GB);
- printf("\n");
- printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
- printf("\n");
- printf(" AL - is an API list. Valid values are:\n");
- printf(" hdf5 - HDF5\n");
- printf(" posix - POSIX\n");
- printf("\n");
- printf(" Example: -A posix,hdf5\n");
- printf("\n");
- printf(" NL - is list of integers (N) separated by commas.\n");
- printf("\n");
- printf(" Example: 1,2,3\n");
- printf("\n");
- printf(" SL - is list of size specifiers (S) separated by commas.\n");
- printf("\n");
- printf(" Example: 2K,2K,3K\n");
- printf("\n");
- printf(" The example defines an object (dataset, tranfer buffer) with three\n");
- printf(" dimensions. Be aware that as the number of dimensions increases, the\n");
- printf(" the total size of the object increases exponentially.\n");
- printf("\n");
- printf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
- printf(" sec2, stdio, core, split, multi, family, direct\n");
- printf("\n");
- printf(" Dimension access order:\n");
- printf(" Data access starts at the cardinal origin of the dataset using the\n");
- printf(" transfer buffer. The next access occurs on a dataset region next to\n");
- printf(" the previous one. For a multidimensional dataset, there are several\n");
- printf(" directions as to where to proceed. This can be specified in the dimension\n");
- printf(" access order. For example, -r 1,2 states that the tool should traverse\n");
- printf(" dimension 1 first, and then dimension 2.\n");
- printf("\n");
- printf(" Environment variables:\n");
- printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
- printf(" HDF5_PREFIX Data file prefix\n");
- printf("\n");
- fflush(stdout);
+ print_version(prog);
+ HDprintf("usage: %s [OPTIONS]\n", prog);
+ HDprintf(" OPTIONS\n");
+ HDprintf(" -h Print an usage message and exit\n");
+ HDprintf(" -A AL Which APIs to test\n");
+ HDprintf(" [default: all of them]\n");
+ HDprintf(" -c SL Selects chunked storage and defines chunks dimensions\n");
+ HDprintf(" and sizes\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -e SL Dimensions and sizes of dataset\n");
+ HDprintf(" [default: 100,200]\n");
+ HDprintf(" -i N Number of iterations to perform\n");
+ HDprintf(" [default: 1]\n");
+ HDprintf(" -r NL Dimension access order (see below for description)\n");
+ HDprintf(" [default: 1,2]\n");
+ HDprintf(" -t Selects extendable dimensions for HDF5 dataset\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -v VFD Selects file driver for HDF5 access\n");
+ HDprintf(" [default: sec2]\n");
+ HDprintf(" -w Perform write tests, not the read tests\n");
+ HDprintf(" [default: Off]\n");
+ HDprintf(" -x SL Dimensions and sizes of the transfer buffer\n");
+ HDprintf(" [default: 10,20]\n");
+ HDprintf("\n");
+ HDprintf(" N - is an integer > 0.\n");
+ HDprintf("\n");
+ HDprintf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n");
+ HDprintf(" K - Kilobyte (%d)\n", ONE_KB);
+ HDprintf(" M - Megabyte (%d)\n", ONE_MB);
+ HDprintf(" G - Gigabyte (%d)\n", ONE_GB);
+ HDprintf("\n");
+ HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB);
+ HDprintf("\n");
+ HDprintf(" AL - is an API list. Valid values are:\n");
+ HDprintf(" hdf5 - HDF5\n");
+ HDprintf(" posix - POSIX\n");
+ HDprintf("\n");
+ HDprintf(" Example: -A posix,hdf5\n");
+ HDprintf("\n");
+ HDprintf(" NL - is list of integers (N) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 1,2,3\n");
+ HDprintf("\n");
+ HDprintf(" SL - is list of size specifiers (S) separated by commas.\n");
+ HDprintf("\n");
+ HDprintf(" Example: 2K,2K,3K\n");
+ HDprintf("\n");
+ HDprintf(" The example defines an object (dataset, tranfer buffer) with three\n");
+ HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n");
+ HDprintf(" the total size of the object increases exponentially.\n");
+ HDprintf("\n");
+ HDprintf(" VFD - is an HDF5 file driver specifier. Valid values are:\n");
+ HDprintf(" sec2, stdio, core, split, multi, family, direct\n");
+ HDprintf("\n");
+ HDprintf(" Dimension access order:\n");
+ HDprintf(" Data access starts at the cardinal origin of the dataset using the\n");
+ HDprintf(" transfer buffer. The next access occurs on a dataset region next to\n");
+ HDprintf(" the previous one. For a multidimensional dataset, there are several\n");
+ HDprintf(" directions as to where to proceed. This can be specified in the dimension\n");
+ HDprintf(" access order. For example, -r 1,2 states that the tool should traverse\n");
+ HDprintf(" dimension 1 first, and then dimension 2.\n");
+ HDprintf("\n");
+ HDprintf(" Environment variables:\n");
+ HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n");
+ HDprintf(" HDF5_PREFIX Data file prefix\n");
+ HDprintf("\n");
+ HDfflush(stdout);
} /* end usage() */
diff --git a/tools/test/perform/sio_standalone.c b/tools/test/perform/sio_standalone.c
index dfdbc55..ac191e5 100644
--- a/tools/test/perform/sio_standalone.c
+++ b/tools/test/perform/sio_standalone.c
@@ -162,122 +162,3 @@ print_version(const char *progname)
H5_VERS_SUBRELEASE[0] ? "-" : "", H5_VERS_SUBRELEASE);
}
-
-
-/** From h5test.c **/
-
-#ifdef H5_HAVE_PARALLEL
-MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */
-#endif
-
-#if 0
-int
-h5_set_info_object(void)
-{
- char *envp; /* environment pointer */
- int ret_value=0;
-
- /* handle any MPI INFO hints via $HDF5_MPI_INFO */
- if ((envp = getenv("HDF5_MPI_INFO")) != NULL){
- char *next, *valp;
-
-
- valp = envp = next = HDstrdup(envp);
-
- /* create an INFO object if not created yet */
- if (h5_io_info_g == MPI_INFO_NULL)
- MPI_Info_create(&h5_io_info_g);
-
- do {
- size_t len;
- char *key_val, *endp, *namep;
-
- if (*valp == ';')
- valp++;
-
- /* copy key/value pair into temporary buffer */
- len = strcspn(valp, ";");
- next = &valp[len];
- key_val = calloc(1, len + 1);
-
- /* increment the next pointer past the terminating semicolon */
- if (*next == ';')
- ++next;
-
- namep = HDstrncpy(key_val, valp, len);
-
- /* pass up any beginning whitespaces */
- while (*namep && (*namep == ' ' || *namep == '\t'))
- namep++;
-
- /* eat up any ending white spaces */
- endp = &namep[strlen(namep) - 1];
-
- while (endp && (*endp == ' ' || *endp == '\t'))
- *endp-- = '\0';
-
- /* find the '=' */
-
- valp = HDstrchr(namep, '=');
-
- if (valp != NULL) { /* it's a valid key/value pairing */
- char *tmp_val = valp + 1;
-
- /* change '=' to \0, move valp down one */
- *valp-- = '\0';
-
- /* eat up ending whitespace on the "key" part */
- while (*valp == ' ' || *valp == '\t')
- *valp-- = '\0';
-
- valp = tmp_val;
-
- /* eat up beginning whitespace on the "value" part */
- while (*valp == ' ' || *valp == '\t')
- *valp++ = '\0';
-
- /* actually set the darned thing */
- if (MPI_SUCCESS != MPI_Info_set(h5_io_info_g, namep, valp)) {
- printf("MPI_Info_set failed\n");
- ret_value = -1;
- }
- }
-
- valp = next;
- HDfree(key_val);
- } while (next && *next);
-
- HDfree(envp);
- }
-
- return ret_value;
-}
-
-
-void
-h5_dump_info_object(MPI_Info info)
-{
- char key[MPI_MAX_INFO_KEY+1];
- char value[MPI_MAX_INFO_VAL+1];
- int flag;
- int i, nkeys;
-
- printf("Dumping MPI Info Object(%d) (up to %d bytes per item):\n", (int)info,
- MPI_MAX_INFO_VAL);
- if (info==MPI_INFO_NULL){
- printf("object is MPI_INFO_NULL\n");
- }
- else {
- MPI_Info_get_nkeys(info, &nkeys);
- printf("object has %d items\n", nkeys);
- for (i=0; i<nkeys; i++){
- MPI_Info_get_nthkey(info, i, key);
- MPI_Info_get(info, key, MPI_MAX_INFO_VAL, value, &flag);
- printf("%s=%s\n", key, value);
- }
-
- }
-}
-
-#endif
-
diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h
index e73a6b5..5ce922b 100644
--- a/tools/test/perform/sio_standalone.h
+++ b/tools/test/perform/sio_standalone.h
@@ -316,6 +316,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDpipe(F) pipe(F)
#define HDpow(X,Y) pow(X,Y)
/* printf() variable arguments */
+#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__)
#define HDputc(C,F) putc(C,F)
#define HDputchar(C) putchar(C)
#define HDputs(S) puts(S)
@@ -377,6 +378,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...);
#define HDsnprintf snprintf /*varargs*/
#endif
/* sprintf() variable arguments */
+#define HDsprintf sprintf /*varargs*/
#define HDsqrt(X) sqrt(X)
#ifdef H5_HAVE_RAND_R
H5_DLL void HDsrand(unsigned int seed);
diff --git a/tools/test/perform/zip_perf.c b/tools/test/perform/zip_perf.c
index 0636d3b..e301bb3 100644
--- a/tools/test/perform/zip_perf.c
+++ b/tools/test/perform/zip_perf.c
@@ -419,7 +419,9 @@ fill_with_random_data(Bytef *src, uLongf src_len)
buf += rc;
len -= (size_t)rc;
}
- } else {
+ HDclose(fd);
+ }
+ else {
HDfprintf(stdout, "Using random() for random data\n");
for (u = 0; u < src_len; ++u)
@@ -557,7 +559,7 @@ main(int argc, char **argv)
int opt;
prog = argv[0];
-
+
/* Initialize h5tools lib */
h5tools_init();