From b07681512ed04b696eef781829de55088c9b689b Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 25 Apr 2025 15:07:18 -0500 Subject: [PATCH 01/14] Generate VOL-specific tests for h5copy --- config/cmake/HDFMacros.cmake | 10 + tools/test/h5copy/CMakeTests.cmake | 665 +++++++++++++++++++---------- 2 files changed, 454 insertions(+), 221 deletions(-) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 54d6230f5f8..b2351bcf5d0 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -378,6 +378,16 @@ macro (HDFTEST_COPY_FILE src dest target) list (APPEND ${target}_list "${dest}") endmacro () +macro (HDFTEST_REPACK_FILE src dest target dest_vol dest_vol_info) + add_custom_command( + OUTPUT "${dest}" + COMMAND "${CMAKE_CROSSCOMPILING_EMULATOR}" + ARGS $ --src-vol-name=native --dst-vol-name=${dest_vol} --dst-vol-info=${dest_vol_info} "${src}" "${dest}" + DEPENDS "${src}" + ) + list (APPEND ${target}_list "${dest}") +endmacro () + macro (HDF_DIR_PATHS package_prefix) option (HDF5_USE_GNU_DIRS "ON to use GNU Coding Standard install directory variables, OFF to use historical settings" OFF) if (HDF5_USE_GNU_DIRS) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 3972495f525..6bfacece1bc 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -39,7 +39,11 @@ ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + foreach (external_vol_tgt ${HDF5_EXTERNAL_VOL_TARGETS}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/${external_vol_tgt}") + endforeach() + # Setup testfiles foreach (listfiles ${LIST_HDF5_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${listfiles}" "${PROJECT_BINARY_DIR}/testfiles/${listfiles}" "h5copy_files") endforeach () @@ -47,7 +51,44 @@ foreach (listothers ${LIST_OTHER_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/expected/${listothers}" "${PROJECT_BINARY_DIR}/testfiles/${listothers}" "h5copy_files") endforeach () - add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) + + # Setup testfiles for any external VOL connectors + foreach (external_vol_tgt ${HDF5_EXTERNAL_VOL_TARGETS}) + set (vol_env "") + set (vol_plugin_paths "${CMAKE_BINARY_DIR}/${HDF5_INSTALL_BIN_DIR}") + + get_target_property (ext_vol_name "${external_vol_tgt}" HDF5_VOL_NAME) + + # If this VOL has an info string, separate it from the VOL name before calling repack + string(FIND ${ext_vol_name} " " idx) + if (idx GREATER -1) + math(EXPR next "${idx} + 1") + string(SUBSTRING ${ext_vol_name} ${next} -1 ext_vol_info ) + string(SUBSTRING ${ext_vol_name} 0 ${idx} ext_vol_name) + else() + set(ext_vol_info "") + endif() + + foreach (listfiles ${LIST_HDF5_TEST_FILES}) + HDFTEST_REPACK_FILE("${PROJECT_SOURCE_DIR}/testfiles/${listfiles}" + "${PROJECT_BINARY_DIR}/testfiles/${external_vol_tgt}/${listfiles}" + "h5copy_files" + ${ext_vol_name} + ${ext_vol_info} + ) + endforeach () + + foreach (listothers ${LIST_OTHER_TEST_FILES}) + HDFTEST_REPACK_FILE("${PROJECT_SOURCE_DIR}/expected/${listothers}" + "${PROJECT_BINARY_DIR}/testfiles/${external_vol_tgt}/${listothers}" + "h5copy_files" + ${ext_vol_name} + ${ext_vol_info} + ) + endforeach () + endforeach() + + add_custom_target(h5copy_files ALL COMMENT "Copying files needed by h5copy tests" DEPENDS ${h5copy_files_list}) ############################################################################## ############################################################################## @@ -58,18 +99,26 @@ # # Perform h5copy according to passing parameters # - macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) + macro (ADD_H5_F_TEST testname vol env resultcode infile fparam vparam sparam srcname dparam dstname) # 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 + NAME H5COPY_F-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) + set_tests_properties (H5COPY_F-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" + ) add_test ( - NAME H5COPY_F-${testname} + NAME H5COPY_F-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) + set_tests_properties (H5COPY_F-${testname}${vol} PROPERTIES + DEPENDS H5COPY_F-${testname}-clear-objects${vol} + ENVIRONMENT "${env}" + ) if ("H5COPY_F-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") set_tests_properties (H5COPY_F-${testname} PROPERTIES DISABLED true) endif () @@ -77,40 +126,56 @@ # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_F-${testname}-DIFF + NAME H5COPY_F-${testname}-DIFF${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) + set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY_F-${testname} + ENVIRONMENT "${env}" + ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY_F-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DISABLED true) + if ("H5COPY_F-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY_F-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + NAME H5COPY_F-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF) + set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF) else () - set_tests_properties (H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_F-${testname}) + set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}) endif () endmacro () - macro (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST testname vol env resultcode infile vparam sparam srcname dparam dstname) # 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 + NAME H5COPY-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) + set_tests_properties(H5COPY-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" + ) add_test ( - NAME H5COPY-${testname} + NAME H5COPY-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + set_tests_properties (H5COPY-${testname}${vol} PROPERTIES + DEPENDS H5COPY-${testname}-clear-objects${vol} + ENVIRONMENT "${env}" + ) if ("H5COPY-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") set_tests_properties (H5COPY-${testname} PROPERTIES DISABLED true) endif () @@ -118,29 +183,38 @@ # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY-${testname}-DIFF + NAME H5COPY-${testname}-DIFF${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY-${testname}${vol} + ENVIRONMENT "${env}" + ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DISABLED true) + if ("H5COPY-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + NAME H5COPY-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" + ) + if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF) else () - set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}) endif () endmacro () - macro (ADD_SKIP_H5_TEST testname skipresultfile) + macro (ADD_SKIP_H5_TEST testname vol skipresultfile) if (NOT HDF5_USING_ANALYSIS_TOOL) add_test ( NAME H5COPY-${testname}-${skipresultfile} @@ -150,101 +224,139 @@ endif () endmacro () - macro (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST2 testname vol env resultcode infile psparam pdparam vparam sparam srcname dparam dstname) # 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 + NAME H5COPY-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + + set_tests_properties(H5COPY-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) add_test ( - NAME H5COPY-${testname}-prefill + NAME H5COPY-${testname}-prefill${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) + set_tests_properties (H5COPY-${testname}-prefill${vol} PROPERTIES + DEPENDS H5COPY-${testname}-clear-objects${vol} + ENVIRONMENT "${ENV}" + ) if ("H5COPY-${testname}-prefill" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DISABLED true) + set_tests_properties (H5COPY-${testname}-prefill${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY-${testname} + NAME H5COPY-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) - if ("H5COPY-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname} PROPERTIES DISABLED true) + set_tests_properties (H5COPY-${testname}${vol} PROPERTIES + DEPENDS H5COPY-${testname}-prefill${vol} + ENVIRONMENT "${ENV}" + ) + if ("H5COPY-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-${testname}${vol} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY-${testname}-DIFF + NAME H5COPY-${testname}-DIFF${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY-${testname}${vol} + ENVIRONMENT "${ENV}" + ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DISABLED true) + if ("H5COPY-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + NAME H5COPY-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES + ENVIRONMENT "${ENV}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF) else () - set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}) endif () endmacro () - macro (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) + macro (ADD_H5_TEST_SAME testname vol env resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) # 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 + NAME H5COPY_SAME-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY_SAME-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${ENV}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) - add_test ( - NAME H5COPY_SAME-${testname}-prefill + NAME H5COPY_SAME-${testname}-prefill${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - if ("H5COPY_SAME-${testname}-prefill" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DISABLED true) + set_tests_properties (H5COPY_SAME-${testname}-prefill${vol} PROPERTIES + DEPENDS H5COPY_SAME-${testname}-clear-objects${vol} + ENVIRONMENT "${ENV}" + ) + if ("H5COPY_SAME-${testname}-prefill${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_SAME-${testname}-prefill${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_SAME-${testname} + NAME H5COPY_SAME-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -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) - if ("H5COPY_SAME-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DISABLED true) + set_tests_properties (H5COPY_SAME-${testname}${vol} PROPERTIES + DEPENDS H5COPY_SAME-${testname}-prefill${vol} + ENVIRONMENT "${ENV}" + ) + if ("H5COPY_SAME-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_SAME-${testname}${vol} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_SAME-${testname}-DIFF + NAME H5COPY_SAME-${testname}-DIFF${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) + set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY_SAME-${testname}${vol} + ENVIRONMENT "${ENV}" + ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY_SAME-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DISABLED true) + if ("H5COPY_SAME-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY_SAME-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + NAME H5COPY_SAME-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES + ENVIRONMENT "${ENV}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_SAME-${testname}-DIFF) + set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_SAME-${testname}-DIFF${vol}) else () - set_tests_properties (H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_SAME-${testname}) + set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_SAME-${testname}${vol}) endif () endmacro () @@ -252,21 +364,26 @@ # Similar to ADD_H5_TEST macro. Compare to outputs from source & target # files instead of checking with h5ls. # - macro (ADD_H5_CMP_TEST testname resultcode result_errcheck infile vparam sparam srcname dparam dstname) + macro (ADD_H5_CMP_TEST testname vol env resultcode result_errcheck infile vparam sparam srcname dparam dstname) # 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 + NAME H5COPY-CMP-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY-CMP-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + add_test (NAME H5COPY-CMP-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5COPY-CMP-${testname} + NAME H5COPY-CMP-${testname}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -280,27 +397,49 @@ -P "${HDF_RESOURCES_DIR}/grepTest.cmake" ) endif () - set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) - if ("H5COPY-CMP-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DISABLED true) + set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES + DEPENDS H5COPY-CMP-${testname}-clear-objects${vol} + ENVIRONMENT "${env}" + ) + if ("H5COPY-CMP-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY-CMP-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + NAME H5COPY-CMP-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY-CMP-${testname}-clean-objects${vol} PROPERTIES + DEPENDS H5COPY-CMP-${testname} + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) - set_tests_properties (H5COPY-CMP-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-CMP-${testname}) endmacro () - macro (ADD_H5_UD_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + macro (ADD_H5_UD_TEST testname vol env resultcode infile sparam srcname dparam dstname cmpfile) + string(FIND "${env}" "HDF5_PLUGIN_PATH=" vol_plugin_path_posn) + if (vol_plugin_path_posn GREATER -1) + # Grab path string after HDF5_PLUGIN_PATH= + math(EXPR vol_plugin_path_posn "${vol_plugin_path_posn} + 17") + string(SUBSTRING "${env}" ${vol_plugin_path_posn} -1 vol_plugin_path) + else() + set(vol_plugin_path "") + endif() + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # 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 + NAME H5COPY_UD-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}.out.h5 + ) + set_tests_properties(H5COPY_UD-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) if ("${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_UD-${testname} + NAME H5COPY_UD-${testname}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -311,13 +450,13 @@ -D "TEST_REFERENCE=./testfiles/${infile}.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) else () add_test ( - NAME H5COPY_UD-${testname} + NAME H5COPY_UD-${testname}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -328,17 +467,20 @@ -D "TEST_REFERENCE=./testfiles/${infile}.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY_UD-${testname} PROPERTIES DEPENDS H5COPY_UD-${testname}-clear-objects) + set_tests_properties (H5COPY_UD-${testname}${vol} PROPERTIES DEPENDS + H5COPY_UD-${testname}-clear-objects${vol} + ENVIRONMENT "${env}" + ) if ("H5COPY_UD-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") set_tests_properties (H5COPY_UD-${testname} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD-${testname}-DIFF + NAME H5COPY_UD-${testname}-DIFF${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -349,32 +491,54 @@ -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) - if ("H5COPY_UD-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DISABLED true) + set_tests_properties (H5COPY_UD-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY_UD-${testname} + ENVIRONMENT "${env}" + ) + if ("H5COPY_UD-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_UD-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5 + NAME H5COPY_UD-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY_UD-${testname}-clean-objects${vol} PROPERTIES + DEPENDS H5COPY_UD-${testname}-DIFF + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) - set_tests_properties (H5COPY_UD-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_UD-${testname}-DIFF) endif () endmacro () - macro (ADD_H5_UD_ERR_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) + macro (ADD_H5_UD_ERR_TEST testname vol env resultcode infile sparam srcname dparam dstname cmpfile) + string(FIND "${env}" "HDF5_PLUGIN_PATH=" vol_plugin_path_posn) + if (vol_plugin_path_posn GREATER -1) + # Grab path string after HDF5_PLUGIN_PATH= + math(EXPR vol_plugin_path_posn "${vol_plugin_path_posn} + 17") + string(SUBSTRING "${env}" ${vol_plugin_path_posn} -1 vol_plugin_path) + else() + set(vol_plugin_path "") + endif() + if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_UD_ERR-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5 + NAME H5COPY_UD_ERR-${testname}-clear-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}_ERR.out.h5 + ) + set_tests_properties (H5COPY_UD_ERR-${testname}-clear-objects${vol} PROPERTIES + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$|" ) if ("${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_UD_ERR-${testname} + NAME H5COPY_UD_ERR-${testname}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -386,13 +550,13 @@ -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) else () add_test ( - NAME H5COPY_UD_ERR-${testname} + NAME H5COPY_UD_ERR-${testname}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -404,17 +568,20 @@ -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" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clear-objects) + set_tests_properties (H5COPY_UD_ERR-${testname}${vol} PROPERTIES + DEPENDS H5COPY_UD_ERR-${testname}-clear-objects${vol} + ENVIRONMENT "${env}" + ) if ("H5COPY_UD_ERR-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DISABLED true) + set_tests_properties (H5COPY_UD_ERR-${testname}${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD_ERR-${testname}-DIFF + NAME H5COPY_UD_ERR-${testname}-DIFF${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -425,32 +592,40 @@ -D "TEST_REFERENCE=./testfiles/${testname}_ERR.out.h5.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}) - if ("H5COPY_UD_ERR-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DISABLED true) + set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF${vol} PROPERTIES + DEPENDS H5COPY_UD_ERR-${testname} + ENVIRONMENT "${env}" + ) + if ("H5COPY_UD_ERR-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF${vol} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD_ERR-${testname}-clean-objects - COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5 + NAME H5COPY_UD_ERR-${testname}-clean-objects${vol} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}_ERR.out.h5 + ) + set_tests_properties (H5COPY_UD_ERR-${testname}-clean-objects${vol} PROPERTIES + DEPENDS H5COPY_UD_ERR-${testname}-DIFF${vol} + ENVIRONMENT "${env}" + # h5delete will return an error code if targeted file does not exist - accept any result + PASS_REGULAR_EXPRESSION "^$" ) - set_tests_properties (H5COPY_UD_ERR-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-DIFF) endif () endmacro () - macro (ADD_SIMPLE_TEST resultfile resultcode) + macro (ADD_SIMPLE_TEST resultfile vol env resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ${ARGN}) + add_test (NAME H5COPY-${resultfile}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ${ARGN}) if (${resultcode}) - set_tests_properties (H5COPY-${resultfile} PROPERTIES WILL_FAIL "true") + set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5COPY-${resultfile} + NAME H5COPY-${resultfile}${vol} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -462,11 +637,12 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY-${resultfile} PROPERTIES + set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + ENVIRONMENT "${env}" ) - if ("H5COPY-${resultfile}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${resultfile} PROPERTIES DISABLED true) + if ("H5COPY-${resultfile}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES DISABLED true) endif () endmacro () @@ -497,124 +673,171 @@ set (USE_FILTER_SZIP "true") endif () -# Test for help flag - ADD_SIMPLE_TEST (h5copy_help1 0 -h) - ADD_SIMPLE_TEST (h5copy_help2 0 --help) +# Add a test for the native connector and each external VOL connector +# TBD: Will need to be modified to support using fetchcontent for multiple connectors in one build + if (DEFINED HDF5_EXTERNAL_VOL_TARGETS) + set(max_idx 1) + else() + set(max_idx 0) + endif() + + foreach(idx RANGE 0 ${max_idx}) + if (${idx} EQUAL 0) + set(vol_name "-native") + set(vol_env "") + else () + # An external VOL connector + set(vol_env "") + + # Retrieve VOL connector name/info + math(EXPR ext_idx "${idx} - 1") + list(GET HDF5_EXTERNAL_VOL_TARGETS ${ext_idx} ext_vol_tgt) + get_target_property(vol_conn_string ${ext_vol_tgt} HDF5_VOL_NAME) + string(FIND ${vol_conn_string} " " space_pos) + # math(EXPR space_pos "${space_pos} + 1") + string(SUBSTRING ${vol_conn_string} 0 ${space_pos} vol_name) + string(CONCAT vol_name "-" ${vol_name}) + + list(APPEND vol_env "HDF5_VOL_CONNECTOR=${vol_conn_string}") + + # Set up HDF5_PLUGIN_PATH + set (vol_plugin_paths "${CMAKE_BINARY_DIR}/${HDF5_INSTALL_BIN_DIR}") + get_target_property(vol_lib_targets "${ext_vol_tgt}" HDF5_VOL_TARGETS) + + # Retrieve plugin path for connector if not default + foreach (lib_target ${vol_lib_targets}) + get_target_property (lib_target_output_dir "${lib_target}" LIBRARY_OUTPUT_DIRECTORY) + if (NOT "${lib_target_output_dir}" STREQUAL "lib_target_output_dir-NOTFOUND" + AND NOT "${lib_target_output_dir}" STREQUAL "" + AND NOT "${lib_target_output_dir}" STREQUAL "${CMAKE_BINARY_DIR}/${HDF5_INSTALL_BIN_DIR}") + set (vol_plugin_paths "${vol_plugin_paths}${CMAKE_SEP}${lib_target_output_dir}") + endif () + endforeach () + + list(APPEND vol_env "HDF5_PLUGIN_PATH=${vol_plugin_paths}") + + list(GET vol_env 1 vol_plugin_path) + endif () - # "Test copying various forms of datasets" - ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 -v -s simple -d simple) - ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) - ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 -v -s compact -d compact) - ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 -v -s compound -d compound) + # Test for help flag + ADD_SIMPLE_TEST (h5copy_help1 "${vol_name}" "${vol_env}" 0 -h) + ADD_SIMPLE_TEST (h5copy_help2 "${vol_name}" "${vol_env}" 0 --help) - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) - else () - ADD_H5_TEST (compressed 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) - endif () + # "Test copying various forms of datasets" + ADD_H5_TEST (simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s simple -d simple) + ADD_H5_TEST (chunk "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) + ADD_H5_TEST (compact "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compact -d compact) + ADD_H5_TEST (compound "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d compound) - ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) - ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) - ADD_H5_TEST (dset_attr 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (compressed "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + else () + ADD_H5_TEST (compressed "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + endif () - # "Test copying dataset within group in source file to root of destination" - ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) + ADD_H5_TEST (named_vl "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) + ADD_H5_TEST (nested_vl "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) + ADD_H5_TEST (dset_attr "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) - # "Test copying & renaming dataset" - ADD_H5_TEST (dsrename 0 ${HDF_FILE1}.h5 -v -s compound -d rename) + # "Test copying dataset within group in source file to root of destination" + ADD_H5_TEST (simple_top "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) - # "Test copying empty, 'full' & 'nested' groups" - ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) - else () - ADD_H5_TEST (grp_dsets 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) - endif () - ADD_H5_TEST (grp_attr 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) - - # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST2 (simple_group 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - - if (USE_FILTER_DEFLATE) - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) - else () - # "Test copying & renaming group" - ADD_H5_TEST (grp_rename 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) - # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) - endif () + # "Test copying & renaming dataset" + ADD_H5_TEST (dsrename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d rename) - # "Test copying objects into group that doesn't exist yet in destination file" - ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) - ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) - ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) - if (USE_FILTER_DEFLATE) - ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - else () - ADD_H5_TEST (E_F_grp_dsets 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) - endif () + # "Test copying empty, 'full' & 'nested' groups" + ADD_H5_TEST (grp_empty "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (grp_dsets "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + else () + ADD_H5_TEST (grp_dsets "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + endif () + ADD_H5_TEST (grp_attr "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) -############# COPY REFERENCES ############## + # "Test copying dataset within group in source file to group in destination" + ADD_H5_TEST2 (simple_group "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) - # "Test copying object and region references" - ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) + if (USE_FILTER_DEFLATE) + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + else () + # "Test copying & renaming group" + ADD_H5_TEST (grp_rename "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + # "Test copying 'full' group hierarchy into group in destination file" + ADD_H5_TEST2 (grp_dsets_rename "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + endif () -############# COPY EXT LINKS ############## + # "Test copying objects into group that doesn't exist yet in destination file" + ADD_H5_TEST (A_B1_simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) + ADD_H5_TEST (C_D_simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) + if (USE_FILTER_DEFLATE) + ADD_H5_TEST (E_F_grp_dsets "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + else () + ADD_H5_TEST (E_F_grp_dsets "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + endif () - # "Test copying external link directly without -f ext" - ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) + ############# COPY REFERENCES ############## - # "Test copying external link directly with -f ext" - ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) + # "Test copying object and region references" + ADD_H5_F_TEST (region_ref "${vol_name}" "${vol_env}" 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) - # "Test copying dangling external link (no obj) directly without -f ext" - ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) + ############# COPY EXT LINKS ############## - # "Test copying dangling external link (no obj) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) + # "Test copying external link directly without -f ext" + ADD_H5_TEST (ext_link "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) - # "Test copying dangling external link (no file) directly without -f ext" - ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) + # "Test copying external link directly with -f ext" + ADD_H5_F_TEST (ext_link_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) - # "Test copying dangling external link (no file) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) + # "Test copying dangling external link (no obj) directly without -f ext" + ADD_H5_TEST (ext_dangle_noobj "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) - # "Test copying a group contains external links without -f ext" - ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) + # "Test copying dangling external link (no obj) directly with -f ext" + ADD_H5_F_TEST (ext_dangle_noobj_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) - # "Test copying a group contains external links with -f ext" - ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) + # "Test copying dangling external link (no file) directly without -f ext" + ADD_H5_TEST (ext_dangle_nofile "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) -############# Test misc. ############## + # "Test copying dangling external link (no file) directly with -f ext" + ADD_H5_F_TEST (ext_dangle_nofile_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) - #----------------------------------------------------------------- - # "Test copying object into group which doesn't exist, without -p" - # - ADD_H5_CMP_TEST (h5copy_misc1 1 "h5copy error" ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) + # "Test copying a group contains external links without -f ext" + ADD_H5_TEST (ext_link_group "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) - #------------------------------------------- - # "Test copying objects to the same file " - # - # - dataset - ADD_H5_TEST_SAME (samefile1 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) - # - group with some datasets - if (USE_FILTER_DEFLATE) - ADD_H5_TEST_SAME (samefile2 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) - else () - ADD_H5_TEST_SAME (samefile2 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) - endif () + # "Test copying a group contains external links with -f ext" + ADD_H5_F_TEST (ext_link_group_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) -############################################################################## -### P L U G I N T E S T S -############################################################################## -if (BUILD_SHARED_LIBS) - ADD_H5_UD_TEST (h5copy_plugin_test 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) - ADD_H5_UD_ERR_TEST (h5copy_plugin_fail 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) -endif () + ############# Test misc. ############## + + #----------------------------------------------------------------- + # "Test copying object into group which doesn't exist, without -p" + # + ADD_H5_CMP_TEST (h5copy_misc1 "${vol_name}" "${vol_env}" 1 "h5copy error" ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) + + #------------------------------------------- + # "Test copying objects to the same file " + # + # - dataset + ADD_H5_TEST_SAME (samefile1 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) + # - group with some datasets + if (USE_FILTER_DEFLATE) + ADD_H5_TEST_SAME (samefile2 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + else () + ADD_H5_TEST_SAME (samefile2 "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + endif () + + ############################################################################## + ### P L U G I N T E S T S + ############################################################################## + if (BUILD_SHARED_LIBS) + ADD_H5_UD_TEST (h5copy_plugin_test "${vol_name}" "${vol_env}" 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) + ADD_H5_UD_ERR_TEST (h5copy_plugin_fail "${vol_name}" "${vol_env}" 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) + endif () +endforeach() \ No newline at end of file From 80d539c2108a025d5547b80952b3b3cab573800a Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 25 Apr 2025 15:16:56 -0500 Subject: [PATCH 02/14] Add h5copy tests to VOL workflows --- .github/workflows/vol.yml | 2 ++ .github/workflows/vol_adios2.yml | 5 +++++ .github/workflows/vol_async.yml | 5 +++++ .github/workflows/vol_cache.yml | 5 +++++ .github/workflows/vol_ext_passthru.yml | 5 +++++ .github/workflows/vol_log.yml | 5 +++++ .github/workflows/vol_rest.yml | 18 +++++++++++++++++- 7 files changed, 44 insertions(+), 1 deletion(-) diff --git a/.github/workflows/vol.yml b/.github/workflows/vol.yml index 92ba43bcf03..6f2a1ffdbaf 100644 --- a/.github/workflows/vol.yml +++ b/.github/workflows/vol.yml @@ -5,6 +5,8 @@ on: workflow_dispatch: schedule: - cron: "0 11 * * *" + push: + # TODO for testing permissions: contents: read diff --git a/.github/workflows/vol_adios2.yml b/.github/workflows/vol_adios2.yml index e92a1472195..445de574481 100644 --- a/.github/workflows/vol_adios2.yml +++ b/.github/workflows/vol_adios2.yml @@ -117,3 +117,8 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "parallel" . + + - name: Test HDF5 ADIOS2 VOL connector with HDF5 tools + working-directory: ${{ github.workspace }}/hdf5/build + run: | + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-adios2" diff --git a/.github/workflows/vol_async.yml b/.github/workflows/vol_async.yml index a48838ffeb4..7b72802d043 100644 --- a/.github/workflows/vol_async.yml +++ b/.github/workflows/vol_async.yml @@ -92,3 +92,8 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-async" . + + - name: Test HDF5 tools with asynchronous I/O VOL connector + working-directory: ${{ github.workspace }}/hdf5/build + run: | + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-async" diff --git a/.github/workflows/vol_cache.yml b/.github/workflows/vol_cache.yml index 58eecfc0d5d..057eeac825b 100644 --- a/.github/workflows/vol_cache.yml +++ b/.github/workflows/vol_cache.yml @@ -162,3 +162,8 @@ jobs: if: ${{ ! matrix.async }} run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-cache" . + + - name: Test HDF5 cache VOL connector with HDF5 tools + working-directory: ${{ github.workspace }}/hdf5/build + run: | + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-cache" diff --git a/.github/workflows/vol_ext_passthru.yml b/.github/workflows/vol_ext_passthru.yml index b72d98f8a03..318c0f2f316 100644 --- a/.github/workflows/vol_ext_passthru.yml +++ b/.github/workflows/vol_ext_passthru.yml @@ -62,3 +62,8 @@ jobs: working-directory: ${{ github.workspace }}/hdf5/build run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-external-passthrough" . + + - name: Test HDF5 tools with external passthrough VOL connector + working-directory: ${{ github.workspace }}/hdf5/build + run: | + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-pass_through_ext" diff --git a/.github/workflows/vol_log.yml b/.github/workflows/vol_log.yml index 5dadbe6e8c5..7f0620eb9d4 100644 --- a/.github/workflows/vol_log.yml +++ b/.github/workflows/vol_log.yml @@ -87,3 +87,8 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "parallel" . + + - name: Test HDF5 tools with Log-based VOL connector + working-directory: ${{ github.workspace }}/hdf5/build + run: | + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-log" diff --git a/.github/workflows/vol_rest.yml b/.github/workflows/vol_rest.yml index 0887614a596..07a673436f2 100644 --- a/.github/workflows/vol_rest.yml +++ b/.github/workflows/vol_rest.yml @@ -191,4 +191,20 @@ jobs: HSDS_ENDPOINT=http+unix://%2Ftmp%2Fhs%2Fsn_1.sock \ ROOT_DIR=${{github.workspace}}/hsdsdata \ BUCKET_NAME=hsdstest \ - ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" . \ No newline at end of file + ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" . + + - name: Test HDF5 tools with REST VOL connector + working-directory: ${{github.workspace}}/hdf5/build/ + run: | + sudo \ + HDF5_PLUGIN_PATH="${{ runner.workspace }}/hdf5_build/lib" \ + HDF5_VOL_CONNECTOR=REST \ + ADMIN_USERNAME=admin ADMIN_PASSWORD=admin \ + USER_NAME=test_user1 USER_PASSWORD=test \ + USER2_NAME=test_user2 USER2_PASSWORD=test \ + HSDS_USERNAME=test_user1 HSDS_PASSWORD=test \ + HSDS_PATH=/home/test_user1/ HDF5_API_TEST_PATH_PREFIX=/home/test_user1/ \ + HSDS_ENDPOINT=http+unix://%2Ftmp%2Fhs%2Fsn_1.sock \ + ROOT_DIR=${{github.workspace}}/hsdsdata \ + BUCKET_NAME=hsdstest \ + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-rest" From bc6774de0c95c08fc3c95193501d8fdbcfe58261 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 25 Apr 2025 16:09:11 -0500 Subject: [PATCH 03/14] Fix repack macro for terminal connectors --- config/cmake/HDFMacros.cmake | 2 +- tools/test/h5copy/CMakeTests.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index b2351bcf5d0..6ebfe0efd6d 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -382,7 +382,7 @@ macro (HDFTEST_REPACK_FILE src dest target dest_vol dest_vol_info) add_custom_command( OUTPUT "${dest}" COMMAND "${CMAKE_CROSSCOMPILING_EMULATOR}" - ARGS $ --src-vol-name=native --dst-vol-name=${dest_vol} --dst-vol-info=${dest_vol_info} "${src}" "${dest}" + ARGS $ --src-vol-name=native --dst-vol-name=${dest_vol} $<$>:--dst-vol-info=${dest_vol_info}> "${src}" "${dest}" DEPENDS "${src}" ) list (APPEND ${target}_list "${dest}") diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 6bfacece1bc..ba783a1d21f 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -66,7 +66,7 @@ string(SUBSTRING ${ext_vol_name} ${next} -1 ext_vol_info ) string(SUBSTRING ${ext_vol_name} 0 ${idx} ext_vol_name) else() - set(ext_vol_info "") + set(ext_vol_info "NONE") endif() foreach (listfiles ${LIST_HDF5_TEST_FILES}) From 3cb8f3a12c68e9181d74f0c5d122d1b9cf68e92a Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 25 Apr 2025 17:03:52 -0500 Subject: [PATCH 04/14] Remove workflow trigger change --- .github/workflows/vol.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/vol.yml b/.github/workflows/vol.yml index 6f2a1ffdbaf..92ba43bcf03 100644 --- a/.github/workflows/vol.yml +++ b/.github/workflows/vol.yml @@ -5,8 +5,6 @@ on: workflow_dispatch: schedule: - cron: "0 11 * * *" - push: - # TODO for testing permissions: contents: read From 5ac57c766ef5457740cd2edb3e5df4097a75be88 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 25 Apr 2025 17:12:20 -0500 Subject: [PATCH 05/14] Disable h5copy tests for certain workflows --- .github/workflows/vol_adios2.yml | 5 ----- .github/workflows/vol_cache.yml | 2 +- .github/workflows/vol_log.yml | 5 ----- .github/workflows/vol_rest.yml | 5 ++++- 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/vol_adios2.yml b/.github/workflows/vol_adios2.yml index 445de574481..e92a1472195 100644 --- a/.github/workflows/vol_adios2.yml +++ b/.github/workflows/vol_adios2.yml @@ -117,8 +117,3 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "parallel" . - - - name: Test HDF5 ADIOS2 VOL connector with HDF5 tools - working-directory: ${{ github.workspace }}/hdf5/build - run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-adios2" diff --git a/.github/workflows/vol_cache.yml b/.github/workflows/vol_cache.yml index 057eeac825b..e150b317dcb 100644 --- a/.github/workflows/vol_cache.yml +++ b/.github/workflows/vol_cache.yml @@ -166,4 +166,4 @@ jobs: - name: Test HDF5 cache VOL connector with HDF5 tools working-directory: ${{ github.workspace }}/hdf5/build run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-cache" + ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*async" diff --git a/.github/workflows/vol_log.yml b/.github/workflows/vol_log.yml index 7f0620eb9d4..5dadbe6e8c5 100644 --- a/.github/workflows/vol_log.yml +++ b/.github/workflows/vol_log.yml @@ -87,8 +87,3 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "parallel" . - - - name: Test HDF5 tools with Log-based VOL connector - working-directory: ${{ github.workspace }}/hdf5/build - run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-log" diff --git a/.github/workflows/vol_rest.yml b/.github/workflows/vol_rest.yml index 07a673436f2..5437c1cc928 100644 --- a/.github/workflows/vol_rest.yml +++ b/.github/workflows/vol_rest.yml @@ -193,6 +193,9 @@ jobs: BUCKET_NAME=hsdstest \ ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" . + # The VOL connector doesn't factor the current working directory into the HSDS paths it tries to access, + # so the h5copy tests fail due to being unable to find the unexpected files. + # Just run the help tests. - name: Test HDF5 tools with REST VOL connector working-directory: ${{github.workspace}}/hdf5/build/ run: | @@ -207,4 +210,4 @@ jobs: HSDS_ENDPOINT=http+unix://%2Ftmp%2Fhs%2Fsn_1.sock \ ROOT_DIR=${{github.workspace}}/hsdsdata \ BUCKET_NAME=hsdstest \ - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-rest" + ctest --build-config ${{ inputs.build_mode }} -VV -R "h5copy_help" From 2ca79003dcb9c6d32fe3d5ed6e312e9896dba53a Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Mon, 28 Apr 2025 10:21:33 -0500 Subject: [PATCH 06/14] Fix incorrect plugin path --- tools/test/h5copy/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index ba783a1d21f..beb8fab767d 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -568,7 +568,7 @@ -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) From b2456545378a0611871c28aa8a6289f0fb1ac7df Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Mon, 28 Apr 2025 10:47:15 -0500 Subject: [PATCH 07/14] Fix missing OR operator in regex --- tools/test/h5copy/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index beb8fab767d..49142e22c68 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -611,7 +611,7 @@ DEPENDS H5COPY_UD_ERR-${testname}-DIFF${vol} ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result - PASS_REGULAR_EXPRESSION "^$" + PASS_REGULAR_EXPRESSION "^$|" ) endif () endmacro () From 0d7a287776823f21d813b20cedd828f739395092 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Mon, 28 Apr 2025 10:54:21 -0500 Subject: [PATCH 08/14] Fix inconsistent test names --- tools/test/h5copy/CMakeTests.cmake | 42 +++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 49142e22c68..80887725012 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -119,8 +119,8 @@ DEPENDS H5COPY_F-${testname}-clear-objects${vol} ENVIRONMENT "${env}" ) - if ("H5COPY_F-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_F-${testname} PROPERTIES DISABLED true) + if ("H5COPY_F-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_F-${testname}${vol} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test @@ -130,7 +130,7 @@ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_F-${testname} + DEPENDS H5COPY_F-${testname}${vol} ENVIRONMENT "${env}" ) if ("${resultcode}" STREQUAL "1") @@ -150,9 +150,9 @@ PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF) + set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF${vol}) else () - set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}) + set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}${vol}) endif () endmacro () @@ -176,8 +176,8 @@ DEPENDS H5COPY-${testname}-clear-objects${vol} ENVIRONMENT "${env}" ) - if ("H5COPY-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname} PROPERTIES DISABLED true) + if ("H5COPY-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY-${testname}${vol} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test @@ -208,19 +208,19 @@ ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF${vol}) else () - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}${vol}) endif () endmacro () macro (ADD_SKIP_H5_TEST testname vol skipresultfile) if (NOT HDF5_USING_ANALYSIS_TOOL) add_test ( - NAME H5COPY-${testname}-${skipresultfile} + NAME H5COPY-${testname}-${skipresultfile}${vol} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" ) - set_property(TEST H5COPY-${testname}-${skipresultfile} PROPERTY DISABLED true) + set_property(TEST H5COPY-${testname}-${skipresultfile}${vol} PROPERTY DISABLED true) endif () endmacro () @@ -245,7 +245,7 @@ DEPENDS H5COPY-${testname}-clear-objects${vol} ENVIRONMENT "${ENV}" ) - if ("H5COPY-${testname}-prefill" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + if ("H5COPY-${testname}-prefill${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") set_tests_properties (H5COPY-${testname}-prefill${vol} PROPERTIES DISABLED true) endif () @@ -287,9 +287,9 @@ PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF${vol}) else () - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}) + set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}${vol}) endif () endmacro () @@ -409,7 +409,7 @@ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) set_tests_properties (H5COPY-CMP-${testname}-clean-objects${vol} PROPERTIES - DEPENDS H5COPY-CMP-${testname} + DEPENDS H5COPY-CMP-${testname}${vol} ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" @@ -476,8 +476,8 @@ H5COPY_UD-${testname}-clear-objects${vol} ENVIRONMENT "${env}" ) - if ("H5COPY_UD-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD-${testname} PROPERTIES DISABLED true) + if ("H5COPY_UD-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (H5COPY_UD-${testname}${vol} PROPERTIES DISABLED true) endif () add_test ( NAME H5COPY_UD-${testname}-DIFF${vol} @@ -496,7 +496,7 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) set_tests_properties (H5COPY_UD-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_UD-${testname} + DEPENDS H5COPY_UD-${testname}${vol} ENVIRONMENT "${env}" ) if ("H5COPY_UD-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") @@ -507,7 +507,7 @@ COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}.out.h5 ) set_tests_properties (H5COPY_UD-${testname}-clean-objects${vol} PROPERTIES - DEPENDS H5COPY_UD-${testname}-DIFF + DEPENDS H5COPY_UD-${testname}-DIFF${vol} ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" @@ -577,7 +577,7 @@ DEPENDS H5COPY_UD_ERR-${testname}-clear-objects${vol} ENVIRONMENT "${env}" ) - if ("H5COPY_UD_ERR-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + if ("H5COPY_UD_ERR-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") set_tests_properties (H5COPY_UD_ERR-${testname}${vol} PROPERTIES DISABLED true) endif () add_test ( @@ -597,7 +597,7 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_UD_ERR-${testname} + DEPENDS H5COPY_UD_ERR-${testname}${vol} ENVIRONMENT "${env}" ) if ("H5COPY_UD_ERR-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") From 608864571e3b9ba6aa4f2209010a8d10c3a61f1c Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Mon, 28 Apr 2025 11:11:12 -0500 Subject: [PATCH 09/14] Replace colon with generic path separator --- tools/test/h5copy/CMakeTests.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 80887725012..3787b0c4bed 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -450,7 +450,7 @@ -D "TEST_REFERENCE=./testfiles/${infile}.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) @@ -467,7 +467,7 @@ -D "TEST_REFERENCE=./testfiles/${infile}.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) @@ -491,7 +491,7 @@ -D "TEST_REFERENCE=./testfiles/${testname}.out.h5.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) @@ -550,7 +550,7 @@ -D "TEST_MASK_ERROR=true" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) @@ -568,7 +568,7 @@ -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:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) @@ -592,7 +592,7 @@ -D "TEST_REFERENCE=./testfiles/${testname}_ERR.out.h5.txt" -D "TEST_APPEND=EXIT CODE:" -D "TEST_ENV_VAR=HDF5_PLUGIN_PATH" - -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins:${vol_plugin_path}" + -D "TEST_ENV_VALUE=${CMAKE_BINARY_DIR}/plugins${CMAKE_SEP}${vol_plugin_path}" -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) From d83e543dec0dd48150607d7014269b12ed10e45e Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Apr 2025 09:27:46 -0500 Subject: [PATCH 10/14] Rename h5copy tests --- tools/test/h5copy/CMakeTests.cmake | 270 +++++++++++++++-------------- 1 file changed, 137 insertions(+), 133 deletions(-) diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 3787b0c4bed..f72568db514 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -15,6 +15,12 @@ ### T E S T I N G ### ############################################################################## ############################################################################## + # System-independent path separator + if (WIN32) + set (CMAKE_SEP "\;") + else () + set (CMAKE_SEP ":") + endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -102,261 +108,261 @@ macro (ADD_H5_F_TEST testname vol env resultcode infile fparam vparam sparam srcname dparam dstname) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_F-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_F-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY_F-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) add_test ( - NAME H5COPY_F-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_F-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY_F-${testname}${vol} PROPERTIES - DEPENDS H5COPY_F-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_F-${testname}-clear-objects ENVIRONMENT "${env}" ) - if ("H5COPY_F-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_F-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_F-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_F-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_F-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_F-${testname} ENVIRONMENT "${env}" ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY_F-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_F-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY_F-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_F-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-clean-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY_F-${testname}-DIFF) else () - set_tests_properties (H5COPY_F-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_F-${testname}${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY_F-${testname}) endif () endmacro () macro (ADD_H5_TEST testname vol env resultcode infile vparam sparam srcname dparam dstname) # Remove any output file left over from previous test run add_test ( - NAME H5COPY-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties(H5COPY-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties(HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) add_test ( - NAME H5COPY-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY-${testname}${vol} PROPERTIES - DEPENDS H5COPY-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects ENVIRONMENT "${env}" ) - if ("H5COPY-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-DIFF COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-${testname} ENVIRONMENT "${env}" ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}-DIFF) else () - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}) endif () endmacro () macro (ADD_SKIP_H5_TEST testname vol skipresultfile) if (NOT HDF5_USING_ANALYSIS_TOOL) add_test ( - NAME H5COPY-${testname}-${skipresultfile}${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-${skipresultfile} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${testname}-${skipresultfile} ${ARGN}" ) - set_property(TEST H5COPY-${testname}-${skipresultfile}${vol} PROPERTY DISABLED true) + set_property(TEST HDF5_VOL_${vol}-H5COPY-${testname}-${skipresultfile} PROPERTY DISABLED true) endif () endmacro () macro (ADD_H5_TEST2 testname vol env resultcode infile psparam pdparam vparam sparam srcname dparam dstname) # Remove any output file left over from previous test run add_test ( - NAME H5COPY-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties(H5COPY-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties(HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) add_test ( - NAME H5COPY-${testname}-prefill${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-prefill COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - set_tests_properties (H5COPY-${testname}-prefill${vol} PROPERTIES - DEPENDS H5COPY-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-prefill PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}-clear-objects ENVIRONMENT "${ENV}" ) - if ("H5COPY-${testname}-prefill${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-prefill${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${testname}-prefill" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-prefill PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY-${testname}${vol} PROPERTIES - DEPENDS H5COPY-${testname}-prefill${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}-prefill ENVIRONMENT "${ENV}" ) - if ("H5COPY-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-DIFF COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-${testname} ENVIRONMENT "${ENV}" ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-DIFF PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES ENVIRONMENT "${ENV}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}-DIFF${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}-DIFF) else () - set_tests_properties (H5COPY-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY-${testname}${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY-${testname}) endif () endmacro () macro (ADD_H5_TEST_SAME testname vol env resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_SAME-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY_SAME-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clear-objects PROPERTIES ENVIRONMENT "${ENV}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) add_test ( - NAME H5COPY_SAME-${testname}-prefill${vol} + NAME HDF5_VOL_${vol}-H5COPY_SAME-${testname}-prefill COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - set_tests_properties (H5COPY_SAME-${testname}-prefill${vol} PROPERTIES - DEPENDS H5COPY_SAME-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-prefill PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clear-objects ENVIRONMENT "${ENV}" ) - if ("H5COPY_SAME-${testname}-prefill${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname}-prefill${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_SAME-${testname}-prefill" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-prefill PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_SAME-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_SAME-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - set_tests_properties (H5COPY_SAME-${testname}${vol} PROPERTIES - DEPENDS H5COPY_SAME-${testname}-prefill${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_SAME-${testname}-prefill ENVIRONMENT "${ENV}" ) - if ("H5COPY_SAME-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_SAME-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname} PROPERTIES DISABLED true) endif () # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_SAME-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) - set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_SAME-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_SAME-${testname} ENVIRONMENT "${ENV}" ) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () - if ("H5COPY_SAME-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_SAME-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF PROPERTIES DISABLED true) endif () endif () add_test ( - NAME H5COPY_SAME-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clean-objects PROPERTIES ENVIRONMENT "${ENV}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if (NOT "${resultcode}" STREQUAL "2") - set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_SAME-${testname}-DIFF${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY_SAME-${testname}-DIFF) else () - set_tests_properties (H5COPY_SAME-${testname}-clean-objects${vol} PROPERTIES DEPENDS H5COPY_SAME-${testname}${vol}) + set_tests_properties (HDF5_VOL_${vol}-H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS HDF5_VOL_${vol}-H5COPY_SAME-${testname}) endif () endmacro () @@ -367,23 +373,23 @@ macro (ADD_H5_CMP_TEST testname vol env resultcode result_errcheck infile vparam sparam srcname dparam dstname) # Remove any output file left over from previous test run add_test ( - NAME H5COPY-CMP-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-CMP-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY-CMP-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY-CMP-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-CMP-${testname}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + add_test (NAME HDF5_VOL_${vol}-H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if ("${resultcode}" STREQUAL "1") - set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5COPY-CMP-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -397,19 +403,19 @@ -P "${HDF_RESOURCES_DIR}/grepTest.cmake" ) endif () - set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES - DEPENDS H5COPY-CMP-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-CMP-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-CMP-${testname}-clear-objects ENVIRONMENT "${env}" ) - if ("H5COPY-CMP-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-CMP-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-CMP-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-CMP-${testname} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY-CMP-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY-CMP-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ./testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY-CMP-${testname}-clean-objects${vol} PROPERTIES - DEPENDS H5COPY-CMP-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY-CMP-${testname}-clean-objects PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY-CMP-${testname} ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" @@ -429,17 +435,17 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_UD-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}.out.h5 ) - set_tests_properties(H5COPY_UD-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties(HDF5_VOL_${vol}-H5COPY_UD-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if ("${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_UD-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -456,7 +462,7 @@ ) else () add_test ( - NAME H5COPY_UD-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -472,15 +478,15 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY_UD-${testname}${vol} PROPERTIES DEPENDS - H5COPY_UD-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD-${testname} PROPERTIES DEPENDS + HDF5_VOL_${vol}-H5COPY_UD-${testname}-clear-objects ENVIRONMENT "${env}" ) - if ("H5COPY_UD-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_UD-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD-${testname} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -495,19 +501,19 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (H5COPY_UD-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_UD-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_UD-${testname} ENVIRONMENT "${env}" ) - if ("H5COPY_UD-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_UD-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD-${testname}-DIFF PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}.out.h5 ) - set_tests_properties (H5COPY_UD-${testname}-clean-objects${vol} PROPERTIES - DEPENDS H5COPY_UD-${testname}-DIFF${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD-${testname}-clean-objects PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_UD-${testname}-DIFF ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" @@ -528,17 +534,17 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_UD_ERR-${testname}-clear-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-clear-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}_ERR.out.h5 ) - set_tests_properties (H5COPY_UD_ERR-${testname}-clear-objects${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-clear-objects PROPERTIES ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" ) if ("${resultcode}" STREQUAL "2") add_test ( - NAME H5COPY_UD_ERR-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -556,7 +562,7 @@ ) else () add_test ( - NAME H5COPY_UD_ERR-${testname}${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -573,15 +579,15 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY_UD_ERR-${testname}${vol} PROPERTIES - DEPENDS H5COPY_UD_ERR-${testname}-clear-objects${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname} PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-clear-objects ENVIRONMENT "${env}" ) - if ("H5COPY_UD_ERR-${testname}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD_ERR-${testname}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname} PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD_ERR-${testname}-DIFF${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -596,19 +602,19 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) - set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF${vol} PROPERTIES - DEPENDS H5COPY_UD_ERR-${testname}${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-DIFF PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname} ENVIRONMENT "${env}" ) - if ("H5COPY_UD_ERR-${testname}-DIFF${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-DIFF" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DISABLED true) endif () add_test ( - NAME H5COPY_UD_ERR-${testname}-clean-objects${vol} + NAME HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-clean-objects COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ testfiles/${testname}_ERR.out.h5 ) - set_tests_properties (H5COPY_UD_ERR-${testname}-clean-objects${vol} PROPERTIES - DEPENDS H5COPY_UD_ERR-${testname}-DIFF${vol} + set_tests_properties (HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-clean-objects PROPERTIES + DEPENDS HDF5_VOL_${vol}-H5COPY_UD_ERR-${testname}-DIFF ENVIRONMENT "${env}" # h5delete will return an error code if targeted file does not exist - accept any result PASS_REGULAR_EXPRESSION "^$|" @@ -619,13 +625,13 @@ macro (ADD_SIMPLE_TEST resultfile vol env resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-${resultfile}${vol} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ${ARGN}) + add_test (NAME HDF5_VOL_${vol}-H5COPY-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $ ${ARGN}) if (${resultcode}) - set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES WILL_FAIL "true") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${resultfile} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5COPY-${resultfile}${vol} + NAME HDF5_VOL_${vol}-H5COPY-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$" @@ -637,12 +643,12 @@ -P "${HDF_RESOURCES_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" ENVIRONMENT "${env}" ) - if ("H5COPY-${resultfile}${vol}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") - set_tests_properties (H5COPY-${resultfile}${vol} PROPERTIES DISABLED true) + if ("HDF5_VOL_${vol}-H5COPY-${resultfile}" MATCHES "${HDF5_DISABLE_TESTS_REGEX}") + set_tests_properties (HDF5_VOL_${vol}-H5COPY-${resultfile} PROPERTIES DISABLED true) endif () endmacro () @@ -683,7 +689,7 @@ foreach(idx RANGE 0 ${max_idx}) if (${idx} EQUAL 0) - set(vol_name "-native") + set(vol_name "native") set(vol_env "") else () # An external VOL connector @@ -694,9 +700,7 @@ list(GET HDF5_EXTERNAL_VOL_TARGETS ${ext_idx} ext_vol_tgt) get_target_property(vol_conn_string ${ext_vol_tgt} HDF5_VOL_NAME) string(FIND ${vol_conn_string} " " space_pos) - # math(EXPR space_pos "${space_pos} + 1") string(SUBSTRING ${vol_conn_string} 0 ${space_pos} vol_name) - string(CONCAT vol_name "-" ${vol_name}) list(APPEND vol_env "HDF5_VOL_CONNECTOR=${vol_conn_string}") From a20d0ad6862e5a7bc1fd42f930c0f62d59857e64 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Apr 2025 09:45:21 -0500 Subject: [PATCH 11/14] Use consistent VOL name --- .github/workflows/vol_async.yml | 5 --- .github/workflows/vol_cache.yml | 7 +-- .github/workflows/vol_ext_passthru.yml | 5 --- .github/workflows/vol_rest.yml | 20 +-------- tools/test/h5copy/CMakeTests.cmake | 61 +++++++++++++++++++++++--- 5 files changed, 57 insertions(+), 41 deletions(-) diff --git a/.github/workflows/vol_async.yml b/.github/workflows/vol_async.yml index 7b72802d043..a48838ffeb4 100644 --- a/.github/workflows/vol_async.yml +++ b/.github/workflows/vol_async.yml @@ -92,8 +92,3 @@ jobs: if: false run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-async" . - - - name: Test HDF5 tools with asynchronous I/O VOL connector - working-directory: ${{ github.workspace }}/hdf5/build - run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-async" diff --git a/.github/workflows/vol_cache.yml b/.github/workflows/vol_cache.yml index e150b317dcb..b24c14896b6 100644 --- a/.github/workflows/vol_cache.yml +++ b/.github/workflows/vol_cache.yml @@ -161,9 +161,4 @@ jobs: # that this should be re-enabled in the future. if: ${{ ! matrix.async }} run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-cache" . - - - name: Test HDF5 cache VOL connector with HDF5 tools - working-directory: ${{ github.workspace }}/hdf5/build - run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*async" + ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-cache" . \ No newline at end of file diff --git a/.github/workflows/vol_ext_passthru.yml b/.github/workflows/vol_ext_passthru.yml index 318c0f2f316..b72d98f8a03 100644 --- a/.github/workflows/vol_ext_passthru.yml +++ b/.github/workflows/vol_ext_passthru.yml @@ -62,8 +62,3 @@ jobs: working-directory: ${{ github.workspace }}/hdf5/build run: | ctest --build-config ${{ inputs.build_mode }} -VV -R "HDF5_VOL_vol-external-passthrough" . - - - name: Test HDF5 tools with external passthrough VOL connector - working-directory: ${{ github.workspace }}/hdf5/build - run: | - ctest --build-config ${{ inputs.build_mode }} -VV -R "H5COPY.*-pass_through_ext" diff --git a/.github/workflows/vol_rest.yml b/.github/workflows/vol_rest.yml index 5437c1cc928..7f654fc6d99 100644 --- a/.github/workflows/vol_rest.yml +++ b/.github/workflows/vol_rest.yml @@ -192,22 +192,4 @@ jobs: ROOT_DIR=${{github.workspace}}/hsdsdata \ BUCKET_NAME=hsdstest \ ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" . - - # The VOL connector doesn't factor the current working directory into the HSDS paths it tries to access, - # so the h5copy tests fail due to being unable to find the unexpected files. - # Just run the help tests. - - name: Test HDF5 tools with REST VOL connector - working-directory: ${{github.workspace}}/hdf5/build/ - run: | - sudo \ - HDF5_PLUGIN_PATH="${{ runner.workspace }}/hdf5_build/lib" \ - HDF5_VOL_CONNECTOR=REST \ - ADMIN_USERNAME=admin ADMIN_PASSWORD=admin \ - USER_NAME=test_user1 USER_PASSWORD=test \ - USER2_NAME=test_user2 USER2_PASSWORD=test \ - HSDS_USERNAME=test_user1 HSDS_PASSWORD=test \ - HSDS_PATH=/home/test_user1/ HDF5_API_TEST_PATH_PREFIX=/home/test_user1/ \ - HSDS_ENDPOINT=http+unix://%2Ftmp%2Fhs%2Fsn_1.sock \ - ROOT_DIR=${{github.workspace}}/hsdsdata \ - BUCKET_NAME=hsdstest \ - ctest --build-config ${{ inputs.build_mode }} -VV -R "h5copy_help" + \ No newline at end of file diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index f72568db514..3e1239c82d1 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -687,8 +687,8 @@ set(max_idx 0) endif() - foreach(idx RANGE 0 ${max_idx}) - if (${idx} EQUAL 0) + foreach(vol_idx RANGE 0 ${max_idx}) + if (${vol_idx} EQUAL 0) set(vol_name "native") set(vol_env "") else () @@ -696,14 +696,63 @@ set(vol_env "") # Retrieve VOL connector name/info - math(EXPR ext_idx "${idx} - 1") + math(EXPR ext_idx "${vol_idx} - 1") list(GET HDF5_EXTERNAL_VOL_TARGETS ${ext_idx} ext_vol_tgt) get_target_property(vol_conn_string ${ext_vol_tgt} HDF5_VOL_NAME) - string(FIND ${vol_conn_string} " " space_pos) - string(SUBSTRING ${vol_conn_string} 0 ${space_pos} vol_name) - list(APPEND vol_env "HDF5_VOL_CONNECTOR=${vol_conn_string}") + # The 'name' of the connector used to set up the test names is drawn from the path to its source + + # Set up number string to append to var name + set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS + set (vol_idx_fixed "${vol_idx}") + string (LENGTH "${vol_idx_fixed}" vol_idx_len) + while (vol_idx_len LESS vol_idx_num_digits) + string (PREPEND vol_idx_fixed "0") + math (EXPR vol_idx_len "${vol_idx_len}+1") + endwhile () + + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") + set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) + set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") + elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) + set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") + endif() + + if ("${HDF5_VOL_SOURCE}" STREQUAL "") + message(FATALE_ERROR "${HDF5_VOL_SOURCE} was unexpectedly empty") + endif() + + # Deal with trailing slash in path for LOCAL_DIR case + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + # Erase trailing slash + string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE}) + endif() + + # Extract the name of the VOL connector + string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) + if (hdf5_vol_name_pos EQUAL -1) + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") + message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") + elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") + endif() + endif () + + math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1") + + string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name) + string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}") + string (STRIP "${hdf5_vol_name}" hdf5_vol_name) + string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper) + string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower) + set (vol_name "${hdf5_vol_name_lower}") + # string(FIND ${vol_conn_string} " " space_pos) + # string(SUBSTRING ${vol_conn_string} 0 ${space_pos} vol_name) + # Set up HDF5_PLUGIN_PATH set (vol_plugin_paths "${CMAKE_BINARY_DIR}/${HDF5_INSTALL_BIN_DIR}") get_target_property(vol_lib_targets "${ext_vol_tgt}" HDF5_VOL_TARGETS) From 158fb3a7c1463e8488454ea3ca3bae737e8aacbf Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Apr 2025 10:06:26 -0500 Subject: [PATCH 12/14] Factor out shared logic into a load vol macro --- CMakeVOL.cmake | 48 +------- config/cmake/HDF5Macros.cmake | 55 +++++++++ tools/test/h5copy/CMakeTests.cmake | 180 +++++++++++------------------ 3 files changed, 124 insertions(+), 159 deletions(-) diff --git a/CMakeVOL.cmake b/CMakeVOL.cmake index 17550a49147..fb279b25fbb 100644 --- a/CMakeVOL.cmake +++ b/CMakeVOL.cmake @@ -11,6 +11,7 @@ # include (FetchContent) +include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) # Function to retrieve all of the CMake targets generated # in a directory and all its subdirectories @@ -89,51 +90,10 @@ if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT" OR HDF5_VOL_ALLOW_EXTERNAL MATCHES "LO set (HDF5_EXTERNAL_VOL_TARGETS "") foreach (vol_idx RANGE 1 ${HDF5_MAX_EXTERNAL_VOLS}) - # Generate fixed-width index number prepended with 0s - # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS - set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS - set (vol_idx_fixed "${vol_idx}") - string (LENGTH "${vol_idx_fixed}" vol_idx_len) - while (vol_idx_len LESS vol_idx_num_digits) - string (PREPEND vol_idx_fixed "0") - math (EXPR vol_idx_len "${vol_idx_len}+1") - endwhile () - - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") - set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) - set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") - elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) - set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") - endif() - - if (NOT "${HDF5_VOL_SOURCE}" STREQUAL "") - # Deal with trailing slash in path for LOCAL_DIR case - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - # Erase trailing slash - string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE}) - endif() - - # Extract the name of the VOL connector - string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) - if (hdf5_vol_name_pos EQUAL -1) - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") - message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") - elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") - endif() - endif () - - math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1") - - string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name) - string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}") - string (STRIP "${hdf5_vol_name}" hdf5_vol_name) - string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper) - string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower) + # Retrieve name from URL/path + LOAD_VOL_NAME(${vol_idx}) + if (NOT ${hdf5_vol_name} STREQUAL "") message (VERBOSE "Building VOL connector '${hdf5_vol_name}' with FetchContent from source ${HDF5_VOL_SOURCE}") # Set some cache variables that can be set by users when building diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index e1bb13315f5..d8cf9e1c523 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -118,3 +118,58 @@ macro (H5_CREATE_VFD_DIR) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") endforeach () endmacro () + +# Retrieve the name of the VOL specified by the +# HDF5_VOL_URLXX/HDF5_VOL_PATHXX variables. +# Output vars are hdf5_vol_name, hdf5_vol_name_upper, hdf5_vol_name_lower +macro(LOAD_VOL_NAME index) + # Generate fixed-width index number prepended with 0s + # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS + set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS + set (vol_idx_fixed "${vol_idx}") + string (LENGTH "${vol_idx_fixed}" vol_idx_len) + while (vol_idx_len LESS vol_idx_num_digits) + string (PREPEND vol_idx_fixed "0") + math (EXPR vol_idx_len "${vol_idx_len}+1") + endwhile () + + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") + set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) + set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") + elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") + mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) + set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") + endif() + + if ("${HDF5_VOL_SOURCE}" STREQUAL "") + set (hdf5_vol_name "") + set (hdf5_vol_name_upper "") + set (hdf5_vol_name_lower "") + else() + # Deal with trailing slash in path for LOCAL_DIR case + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + # Erase trailing slash + string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE}) + endif() + + # Extract the name of the VOL connector + string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) + if (hdf5_vol_name_pos EQUAL -1) + if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") + message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") + elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") + message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") + endif() + endif () + + math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1") + + string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name) + string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}") + string (STRIP "${hdf5_vol_name}" hdf5_vol_name) + string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper) + string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower) + endif() + endmacro() \ No newline at end of file diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 3e1239c82d1..466c7f1d6fa 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -9,18 +9,19 @@ # If you do not have access to either file, you may request a copy from # help@hdfgroup.org. # - +include (${HDF_RESOURCES_DIR}/HDF5Macros.cmake) + +# System-independent path separator +if (WIN32) + set (CMAKE_SEP "\;") +else () + set (CMAKE_SEP ":") +endif () ############################################################################## ############################################################################## ### T E S T I N G ### ############################################################################## ############################################################################## - # System-independent path separator - if (WIN32) - set (CMAKE_SEP "\;") - else () - set (CMAKE_SEP ":") - endif () # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory @@ -679,80 +680,29 @@ set (USE_FILTER_SZIP "true") endif () -# Add a test for the native connector and each external VOL connector -# TBD: Will need to be modified to support using fetchcontent for multiple connectors in one build - if (DEFINED HDF5_EXTERNAL_VOL_TARGETS) - set(max_idx 1) - else() - set(max_idx 0) - endif() - - foreach(vol_idx RANGE 0 ${max_idx}) + # Add a test for the native connector and each external VOL connector + foreach (vol_idx RANGE 0 ${HDF5_MAX_EXTERNAL_VOLS}) + # First, populate VOL info to be passed to tests if (${vol_idx} EQUAL 0) - set(vol_name "native") + set(hdf5_vol_name_lower "native") set(vol_env "") else () # An external VOL connector set(vol_env "") + # The 'name' of the connector used to set up the test names is drawn from the path to its source + LOAD_VOL_NAME(ext_idx) + + if ("${hdf5_vol_name}" STREQUAL "") + continue() + endif() + # Retrieve VOL connector name/info math(EXPR ext_idx "${vol_idx} - 1") list(GET HDF5_EXTERNAL_VOL_TARGETS ${ext_idx} ext_vol_tgt) get_target_property(vol_conn_string ${ext_vol_tgt} HDF5_VOL_NAME) list(APPEND vol_env "HDF5_VOL_CONNECTOR=${vol_conn_string}") - # The 'name' of the connector used to set up the test names is drawn from the path to its source - - # Set up number string to append to var name - set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS - set (vol_idx_fixed "${vol_idx}") - string (LENGTH "${vol_idx_fixed}" vol_idx_len) - while (vol_idx_len LESS vol_idx_num_digits) - string (PREPEND vol_idx_fixed "0") - math (EXPR vol_idx_len "${vol_idx_len}+1") - endwhile () - - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") - set (HDF5_VOL_URL${vol_idx_fixed} "" CACHE STRING "Git repository URL of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_URL${vol_idx_fixed}) - set (HDF5_VOL_SOURCE "${HDF5_VOL_URL${vol_idx_fixed}}") - elseif(HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - set (HDF5_VOL_PATH${vol_idx_fixed} "" CACHE STRING "Path to the source directory of an external HDF5 VOL connector to build") - mark_as_advanced (HDF5_VOL_PATH${vol_idx_fixed}) - set (HDF5_VOL_SOURCE "${HDF5_VOL_PATH${vol_idx_fixed}}") - endif() - - if ("${HDF5_VOL_SOURCE}" STREQUAL "") - message(FATALE_ERROR "${HDF5_VOL_SOURCE} was unexpectedly empty") - endif() - - # Deal with trailing slash in path for LOCAL_DIR case - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - # Erase trailing slash - string (REGEX REPLACE "/$" "" HDF5_VOL_SOURCE ${HDF5_VOL_SOURCE}) - endif() - - # Extract the name of the VOL connector - string (FIND "${HDF5_VOL_SOURCE}" "/" hdf5_vol_name_pos REVERSE) - if (hdf5_vol_name_pos EQUAL -1) - if (HDF5_VOL_ALLOW_EXTERNAL MATCHES "GIT") - message (SEND_ERROR "Invalid URL '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_URL${vol_idx_fixed}") - elseif (HDF5_VOL_ALLOW_EXTERNAL MATCHES "LOCAL_DIR") - message (SEND_ERROR "Invalid source path '${HDF5_VOL_SOURCE}' specified for HDF5_VOL_PATH${vol_idx_fixed}") - endif() - endif () - - math (EXPR hdf5_vol_name_pos "${hdf5_vol_name_pos}+1") - - string (SUBSTRING "${HDF5_VOL_SOURCE}" ${hdf5_vol_name_pos} -1 hdf5_vol_name) - string (REPLACE ".git" "" hdf5_vol_name "${hdf5_vol_name}") - string (STRIP "${hdf5_vol_name}" hdf5_vol_name) - string (TOUPPER "${hdf5_vol_name}" hdf5_vol_name_upper) - string (TOLOWER "${hdf5_vol_name}" hdf5_vol_name_lower) - set (vol_name "${hdf5_vol_name_lower}") - # string(FIND ${vol_conn_string} " " space_pos) - # string(SUBSTRING ${vol_conn_string} 0 ${space_pos} vol_name) - # Set up HDF5_PLUGIN_PATH set (vol_plugin_paths "${CMAKE_BINARY_DIR}/${HDF5_INSTALL_BIN_DIR}") get_target_property(vol_lib_targets "${ext_vol_tgt}" HDF5_VOL_TARGETS) @@ -773,124 +723,124 @@ endif () # Test for help flag - ADD_SIMPLE_TEST (h5copy_help1 "${vol_name}" "${vol_env}" 0 -h) - ADD_SIMPLE_TEST (h5copy_help2 "${vol_name}" "${vol_env}" 0 --help) + ADD_SIMPLE_TEST (h5copy_help1 "${hdf5_vol_name_lower}" "${vol_env}" 0 -h) + ADD_SIMPLE_TEST (h5copy_help2 "${hdf5_vol_name_lower}" "${vol_env}" 0 --help) # "Test copying various forms of datasets" - ADD_H5_TEST (simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s simple -d simple) - ADD_H5_TEST (chunk "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) - ADD_H5_TEST (compact "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compact -d compact) - ADD_H5_TEST (compound "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d compound) + ADD_H5_TEST (simple "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s simple -d simple) + ADD_H5_TEST (chunk "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s chunk -d chunk) + ADD_H5_TEST (compact "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compact -d compact) + ADD_H5_TEST (compound "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d compound) if (USE_FILTER_DEFLATE) - ADD_H5_TEST (compressed "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + ADD_H5_TEST (compressed "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compressed -d compressed) else () - ADD_H5_TEST (compressed "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) + ADD_H5_TEST (compressed "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s compressed -d compressed) endif () - ADD_H5_TEST (named_vl "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) - ADD_H5_TEST (nested_vl "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) - ADD_H5_TEST (dset_attr "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) + ADD_H5_TEST (named_vl "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s named_vl -d named_vl) + ADD_H5_TEST (nested_vl "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s nested_vl -d nested_vl) + ADD_H5_TEST (dset_attr "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s dset_attr -d dset_attr) # "Test copying dataset within group in source file to root of destination" - ADD_H5_TEST (simple_top "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) + ADD_H5_TEST (simple_top "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets/simple -d simple_top) # "Test copying & renaming dataset" - ADD_H5_TEST (dsrename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d rename) + ADD_H5_TEST (dsrename "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s compound -d rename) # "Test copying empty, 'full' & 'nested' groups" - ADD_H5_TEST (grp_empty "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) + ADD_H5_TEST (grp_empty "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_empty -d grp_empty) if (USE_FILTER_DEFLATE) - ADD_H5_TEST (grp_dsets "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + ADD_H5_TEST (grp_dsets "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) else () - ADD_H5_TEST (grp_dsets "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) - ADD_H5_TEST (grp_nested "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) + ADD_H5_TEST (grp_dsets "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_dsets) + ADD_H5_TEST (grp_nested "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_nested -d grp_nested) endif () - ADD_H5_TEST (grp_attr "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) + ADD_H5_TEST (grp_attr "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_attr -d grp_attr) # "Test copying dataset within group in source file to group in destination" - ADD_H5_TEST2 (simple_group "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) + ADD_H5_TEST2 (simple_group "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_dsets -v -s /grp_dsets/simple -d /grp_dsets/simple_group) if (USE_FILTER_DEFLATE) # "Test copying & renaming group" - ADD_H5_TEST (grp_rename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + ADD_H5_TEST (grp_rename "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + ADD_H5_TEST2 (grp_dsets_rename "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) else () # "Test copying & renaming group" - ADD_H5_TEST (grp_rename "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) + ADD_H5_TEST (grp_rename "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -v -s grp_dsets -d grp_rename) # "Test copying 'full' group hierarchy into group in destination file" - ADD_H5_TEST2 (grp_dsets_rename "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) + ADD_H5_TEST2 (grp_dsets_rename "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 grp_dsets grp_rename -v -s grp_dsets -d /grp_rename/grp_dsets) endif () # "Test copying objects into group that doesn't exist yet in destination file" - ADD_H5_TEST (A_B1_simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) - ADD_H5_TEST (A_B2_simple2 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) - ADD_H5_TEST (C_D_simple "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) + ADD_H5_TEST (A_B1_simple "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B1/simple) + ADD_H5_TEST (A_B2_simple2 "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s simple -d /A/B2/simple2) + ADD_H5_TEST (C_D_simple "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets/simple -d /C/D/simple) if (USE_FILTER_DEFLATE) - ADD_H5_TEST (E_F_grp_dsets "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + ADD_H5_TEST (E_F_grp_dsets "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) else () - ADD_H5_TEST (E_F_grp_dsets "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) - ADD_H5_TEST (G_H_grp_nested "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) + ADD_H5_TEST (E_F_grp_dsets "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_dsets -d /E/F/grp_dsets) + ADD_H5_TEST (G_H_grp_nested "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 -vp -s /grp_nested -d /G/H/grp_nested) endif () ############# COPY REFERENCES ############## # "Test copying object and region references" - ADD_H5_F_TEST (region_ref "${vol_name}" "${vol_env}" 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) + ADD_H5_F_TEST (region_ref "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE2}.h5 ref -v -s / -d /COPY) ############# COPY EXT LINKS ############## # "Test copying external link directly without -f ext" - ADD_H5_TEST (ext_link "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) + ADD_H5_TEST (ext_link "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_dset -d /copy1_dset) # "Test copying external link directly with -f ext" - ADD_H5_F_TEST (ext_link_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) + ADD_H5_F_TEST (ext_link_f "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset) # "Test copying dangling external link (no obj) directly without -f ext" - ADD_H5_TEST (ext_dangle_noobj "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) + ADD_H5_TEST (ext_dangle_noobj "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1) # "Test copying dangling external link (no obj) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_noobj_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) + ADD_H5_F_TEST (ext_dangle_noobj_f "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2) # "Test copying dangling external link (no file) directly without -f ext" - ADD_H5_TEST (ext_dangle_nofile "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) + ADD_H5_TEST (ext_dangle_nofile "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1) # "Test copying dangling external link (no file) directly with -f ext" - ADD_H5_F_TEST (ext_dangle_nofile_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) + ADD_H5_F_TEST (ext_dangle_nofile_f "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2) # "Test copying a group contains external links without -f ext" - ADD_H5_TEST (ext_link_group "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) + ADD_H5_TEST (ext_link_group "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 -v -s /group_ext -d /copy1_group) # "Test copying a group contains external links with -f ext" - ADD_H5_F_TEST (ext_link_group_f "${vol_name}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) + ADD_H5_F_TEST (ext_link_group_f "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_EXT_SRC_FILE}.h5 ext -v -s /group_ext -d /copy2_group) ############# Test misc. ############## #----------------------------------------------------------------- # "Test copying object into group which doesn't exist, without -p" # - ADD_H5_CMP_TEST (h5copy_misc1 "${vol_name}" "${vol_env}" 1 "h5copy error" ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) + ADD_H5_CMP_TEST (h5copy_misc1 "${hdf5_vol_name_lower}" "${vol_env}" 1 "h5copy error" ${HDF_FILE1}.h5 -v -s /simple -d /g1/g2/simple) #------------------------------------------- # "Test copying objects to the same file " # # - dataset - ADD_H5_TEST_SAME (samefile1 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) + ADD_H5_TEST_SAME (samefile1 "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 /simple /simple -v -s /simple -d /simple_cp) # - group with some datasets if (USE_FILTER_DEFLATE) - ADD_H5_TEST_SAME (samefile2 "${vol_name}" "${vol_env}" 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + ADD_H5_TEST_SAME (samefile2 "${hdf5_vol_name_lower}" "${vol_env}" 0 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) else () - ADD_H5_TEST_SAME (samefile2 "${vol_name}" "${vol_env}" 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) + ADD_H5_TEST_SAME (samefile2 "${hdf5_vol_name_lower}" "${vol_env}" 2 ${HDF_FILE1}.h5 /grp_dsets /grp_dsets -v -s /grp_dsets -d /grp_dsets_cp) endif () ############################################################################## ### P L U G I N T E S T S ############################################################################## if (BUILD_SHARED_LIBS) - ADD_H5_UD_TEST (h5copy_plugin_test "${vol_name}" "${vol_env}" 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) - ADD_H5_UD_ERR_TEST (h5copy_plugin_fail "${vol_name}" "${vol_env}" 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) + ADD_H5_UD_TEST (h5copy_plugin_test "${hdf5_vol_name_lower}" "${vol_env}" 0 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5 ) + ADD_H5_UD_ERR_TEST (h5copy_plugin_fail "${hdf5_vol_name_lower}" "${vol_env}" 2 tudfilter.h5 -s /dynlibud -d /dynlibud tudfilter2.h5) endif () endforeach() \ No newline at end of file From 397ade0ee5e0fc82ab436a335d42ff3493981bbe Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Apr 2025 10:12:48 -0500 Subject: [PATCH 13/14] Exclude H5COPY tests from REST VOL CI --- .github/workflows/vol_rest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/vol_rest.yml b/.github/workflows/vol_rest.yml index 7f654fc6d99..1594afdb1dd 100644 --- a/.github/workflows/vol_rest.yml +++ b/.github/workflows/vol_rest.yml @@ -191,5 +191,5 @@ jobs: HSDS_ENDPOINT=http+unix://%2Ftmp%2Fhs%2Fsn_1.sock \ ROOT_DIR=${{github.workspace}}/hsdsdata \ BUCKET_NAME=hsdstest \ - ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" . + ctest --build-config ${{ inputs.build_mode }} -VV -R "h5_api" -E "H5COPY" . \ No newline at end of file From e0e07ab9694f4432fed7cd2f9a26a727e46fa51d Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Tue, 29 Apr 2025 10:38:32 -0500 Subject: [PATCH 14/14] Correct macro index usage --- config/cmake/HDF5Macros.cmake | 2 +- tools/test/h5copy/CMakeTests.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index d8cf9e1c523..b3ae7243eee 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -122,7 +122,7 @@ endmacro () # Retrieve the name of the VOL specified by the # HDF5_VOL_URLXX/HDF5_VOL_PATHXX variables. # Output vars are hdf5_vol_name, hdf5_vol_name_upper, hdf5_vol_name_lower -macro(LOAD_VOL_NAME index) +macro(LOAD_VOL_NAME vol_idx) # Generate fixed-width index number prepended with 0s # so VOL sources come in order from 1 - HDF5_MAX_EXTERNAL_VOLS set (vol_idx_num_digits 2) # Based on HDF5_MAX_EXTERNAL_VOLS diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 466c7f1d6fa..b60fc4caaa1 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -691,7 +691,7 @@ endif () set(vol_env "") # The 'name' of the connector used to set up the test names is drawn from the path to its source - LOAD_VOL_NAME(ext_idx) + LOAD_VOL_NAME(${vol_idx}) if ("${hdf5_vol_name}" STREQUAL "") continue()