From 16cbd591cdac327da2d1576ab8751c14dbb40760 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 17 Dec 2018 12:01:20 -0600 Subject: align H5Arename behavior with H5Arename_by_name --- src/H5A.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 74b0148..739cce2 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1201,10 +1201,12 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) H5TRACE3("e", "i*s*s", loc_id, old_name, new_name); /* check arguments */ - if(!old_name || !new_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "name is nil") if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") + if(!old_name || !*old_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no old attribute name") + if(!new_name || !*new_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new attribute name") /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_name, new_name)) { -- cgit v0.12 From b4fe787bb9fe4bfc4709a124df59dd987c9a09d2 Mon Sep 17 00:00:00 2001 From: Jordan Henderson Date: Mon, 17 Dec 2018 14:25:55 -0600 Subject: Add test for H5Arename NULL/empty attribute name fix Split checking of NULL vs. empty string arguments --- src/H5A.c | 12 +++++--- test/tattr.c | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 104 insertions(+), 5 deletions(-) diff --git a/src/H5A.c b/src/H5A.c index 739cce2..cb8e310 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -1203,10 +1203,14 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) /* check arguments */ if(H5I_ATTR == H5I_get_type(loc_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute") - if(!old_name || !*old_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no old attribute name") - if(!new_name || !*new_name) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new attribute name") + if(!old_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be NULL") + if(!*old_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be an empty string") + if(!new_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be NULL") + if(!*new_name) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be an empty string") /* Avoid thrashing things if the names are the same */ if(HDstrcmp(old_name, new_name)) { diff --git a/test/tattr.c b/test/tattr.c index 63a0580..9d80050 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -146,6 +146,10 @@ float attr_data5=-5.123F; /* Test data for 5th attribute */ /* Used by test_attr_info_null_info_pointer() */ #define GET_INFO_NULL_POINTER_ATTR_NAME "NullInfoPointerAttr" +/* Used by test_attr_rename_invalid_name() */ +#define INVALID_RENAME_TEST_ATTR_NAME "InvalidRenameTestAttr" +#define INVALID_RENAME_TEST_NEW_ATTR_NAME "InvalidRenameTestNewAttr" + /* Attribute iteration struct */ typedef struct { @@ -5894,7 +5898,7 @@ test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl) hid_t attr; hid_t sid; - /* Create dataspace for dataset & attributes */ + /* Create dataspace for attribute */ sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); @@ -5938,6 +5942,95 @@ test_attr_info_null_info_pointer(hid_t fcpl, hid_t fapl) } +/*************************************************************** +** +** test_attr_rename_invalid_name(): A test to ensure that +** passing a NULL or empty attribute name to +** H5Arename(_by_name) doesn't cause bad behavior. +** +****************************************************************/ +static void +test_attr_rename_invalid_name(hid_t fcpl, hid_t fapl) +{ + herr_t err_ret = -1; + hid_t fid; + hid_t attr; + hid_t sid; + + /* Create dataspace for attribute */ + sid = H5Screate(H5S_SCALAR); + CHECK(sid, FAIL, "H5Screate"); + + /* Create file */ + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, fcpl, fapl); + CHECK(fid, FAIL, "H5Fcreate"); + + /* Create attribute */ + attr = H5Acreate2(fid, INVALID_RENAME_TEST_ATTR_NAME, H5T_NATIVE_UINT, sid, H5P_DEFAULT, H5P_DEFAULT); + CHECK(attr, FAIL, "H5Acreate2"); + + H5E_BEGIN_TRY { + err_ret = H5Arename(fid, NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename"); + + H5E_BEGIN_TRY { + err_ret = H5Arename(fid, "", INVALID_RENAME_TEST_NEW_ATTR_NAME); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename"); + + H5E_BEGIN_TRY { + err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, NULL); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename"); + + H5E_BEGIN_TRY { + err_ret = H5Arename(fid, INVALID_RENAME_TEST_ATTR_NAME, ""); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename"); + + H5E_BEGIN_TRY { + err_ret = H5Arename_by_name(fid, ".", NULL, INVALID_RENAME_TEST_NEW_ATTR_NAME, H5P_DEFAULT); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename_by_name"); + + H5E_BEGIN_TRY { + err_ret = H5Arename_by_name(fid, ".", "", INVALID_RENAME_TEST_NEW_ATTR_NAME, H5P_DEFAULT); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename_by_name"); + + H5E_BEGIN_TRY { + err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, NULL, H5P_DEFAULT); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename_by_name"); + + H5E_BEGIN_TRY { + err_ret = H5Arename_by_name(fid, ".", INVALID_RENAME_TEST_ATTR_NAME, "", H5P_DEFAULT); + } H5E_END_TRY; + + CHECK(err_ret, SUCCEED, "H5Arename_by_name"); + + /* Close dataspace */ + err_ret = H5Sclose(sid); + CHECK(err_ret, FAIL, "H5Sclose"); + + /* Close attribute */ + err_ret = H5Aclose(attr); + CHECK(err_ret, FAIL, "H5Aclose"); + + /* Close file */ + err_ret = H5Fclose(fid); + CHECK(err_ret, FAIL, "H5Fclose"); +} + + /**************************************************************** ** ** test_attr_delete_by_idx(): Test basic H5A (attribute) code. @@ -10939,6 +11032,7 @@ test_attr(void) test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */ test_attr_many(new_format, my_fcpl, my_fapl); /* Test storing lots of attributes */ test_attr_info_null_info_pointer(my_fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */ + test_attr_rename_invalid_name(my_fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */ /* Attribute creation order tests */ test_attr_corder_create_basic(my_fcpl, my_fapl);/* Test creating an object w/attribute creation order info */ @@ -10984,6 +11078,7 @@ test_attr(void) test_attr_deprec(fcpl, my_fapl); /* Test deprecated API routines */ test_attr_many(new_format, fcpl, my_fapl); /* Test storing lots of attributes */ test_attr_info_null_info_pointer(fcpl, my_fapl); /* Test passing a NULL attribute info pointer to H5Aget_info(_by_name/_by_idx) */ + test_attr_rename_invalid_name(fcpl, my_fapl); /* Test passing a NULL or empty attribute name to H5Arename(_by_name) */ /* New attribute API routine tests, on old-format storage */ test_attr_info_by_idx(new_format, fcpl, my_fapl); /* Test querying attribute info by index */ -- cgit v0.12 From 7e8923957fdf18ce95e4947145950e382cf0585a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Dec 2018 15:11:17 -0600 Subject: HDFFV-10656 Add CHECK_VOL support to CMake --- CMakeLists.txt | 7 + MANIFEST | 8 + c++/test/CMakeTests.cmake | 63 ++----- c++/test/CMakeVFDTests.cmake | 65 +++++++ c++/test/CMakeVOLTests.cmake | 19 ++ config/cmake/volTest.cmake | 76 ++++++++ examples/CMakeTests.cmake | 18 +- release_docs/INSTALL_CMake.txt | 1 + test/CMakeTests.cmake | 10 + test/CMakeVOLTests.cmake | 322 ++++++++++++++++++++++++++++++++ testpar/CMakeTests.cmake | 20 ++ testpar/CMakeVFDTests.cmake | 57 ++++++ testpar/CMakeVOLTests.cmake | 19 ++ tools/test/h5repack/CMakeTests.cmake | 58 ++---- tools/test/h5repack/CMakeVFDTests.cmake | 65 +++++++ tools/test/h5repack/CMakeVOLTests.cmake | 55 ++++++ 16 files changed, 767 insertions(+), 96 deletions(-) create mode 100644 c++/test/CMakeVFDTests.cmake create mode 100644 c++/test/CMakeVOLTests.cmake create mode 100644 config/cmake/volTest.cmake create mode 100644 test/CMakeVOLTests.cmake create mode 100644 testpar/CMakeVFDTests.cmake create mode 100644 testpar/CMakeVOLTests.cmake create mode 100644 tools/test/h5repack/CMakeVFDTests.cmake create mode 100644 tools/test/h5repack/CMakeVOLTests.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index e2fb000..8433163 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,6 +756,13 @@ if (BUILD_TESTING) mark_as_advanced (HDF5_TEST_FHEAP_VFD) endif () + option (HDF5_TEST_VOL "Execute tests with different VOLs" OFF) + mark_as_advanced (HDF5_TEST_VOL) + if (HDF5_TEST_VOL) + option (HDF5_TEST_FHEAP_VOL "Execute tests with different VOLs" ON) + mark_as_advanced (HDF5_TEST_FHEAP_VOL) + endif () + option (HDF_TEST_EXPRESS "Control testing framework (0-3)" "0") mark_as_advanced (HDF_TEST_EXPRESS) diff --git a/MANIFEST b/MANIFEST index c3c7ffc..01e0e20 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3207,6 +3207,7 @@ ./config/cmake/UseJavaSymlinks.cmake ./config/cmake/userblockTest.cmake ./config/cmake/vfdTest.cmake +./config/cmake/volTest.cmake ./config/cmake/wait_H5Tinit.cmake ./config/cmake_ext_mod/ConfigureChecks.cmake @@ -3247,6 +3248,8 @@ ./c++/src/CMakeLists.txt ./c++/test/CMakeLists.txt ./c++/test/CMakeTests.cmake +./c++/test/CMakeVFDTests.cmake +./c++/test/CMakeVOLTests.cmake ./examples/CMakeLists.txt ./examples/CMakeTests.cmake ./examples/run-all-ex.sh @@ -3286,10 +3289,13 @@ ./test/CMakeLists.txt ./test/CMakeTests.cmake ./test/CMakeVFDTests.cmake +./test/CMakeVOLTests.cmake ./test/flushrefreshTest.cmake ./test/ShellTests.cmake ./testpar/CMakeLists.txt ./testpar/CMakeTests.cmake +./testpar/CMakeVFDTests.cmake +./testpar/CMakeVOLTests.cmake ./tools/CMakeLists.txt ./tools/lib/CMakeLists.txt ./tools/src/CMakeLists.txt @@ -3322,6 +3328,8 @@ ./tools/src/h5repack/CMakeLists.txt ./tools/test/h5repack/CMakeLists.txt ./tools/test/h5repack/CMakeTests.cmake +./tools/test/h5repack/CMakeVFDTests.cmake +./tools/test/h5repack/CMakeVOLTests.cmake ./tools/src/h5stat/CMakeLists.txt ./tools/test/h5stat/CMakeLists.txt ./tools/test/h5stat/CMakeTests.cmake diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 6de801e..a1c07f7 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -47,55 +47,22 @@ else () endif () set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) -if (HDF5_TEST_VFD) - - set (VFD_LIST - sec2 - stdio - core - split - multi - family - ) - - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## - macro (ADD_VFD_TEST vfdname resultcode) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") - add_test ( - NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tattr_basic.h5 - tattr_compound.h5 - tattr_dtype.h5 - tattr_multi.h5 - tattr_scalar.h5 - tfattrs.h5 - titerate.h5 - ) - add_test ( - NAME CPP_VFD-${vfdname}-cpp_testhdf5 - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=cpp_testhdf5" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) - set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) - endif () - endmacro () +if (HDF5_TEST_VFD) + include (CMakeVFDTests.cmake) +endif () - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () +############################################################################## +############################################################################## +### V O L T E S T S ### +############################################################################## +############################################################################## +if (HDF5_TEST_VOL) + include (CMakeVOLTests.cmake) endif () diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake new file mode 100644 index 0000000..996a20f --- /dev/null +++ b/c++/test/CMakeVFDTests.cmake @@ -0,0 +1,65 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + set (VFD_LIST + sec2 + stdio + core + split + multi + family + ) + + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif () + + macro (ADD_VFD_TEST vfdname resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") + add_test ( + NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + tattr_basic.h5 + tattr_compound.h5 + tattr_dtype.h5 + tattr_multi.h5 + tattr_scalar.h5 + tfattrs.h5 + titerate.h5 + ) + add_test ( + NAME CPP_VFD-${vfdname}-cpp_testhdf5 + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=cpp_testhdf5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) + set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT 30) + endif () + endmacro () + + # Run test with different Virtual File Driver + foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + endforeach () diff --git a/c++/test/CMakeVOLTests.cmake b/c++/test/CMakeVOLTests.cmake new file mode 100644 index 0000000..be3ecc2 --- /dev/null +++ b/c++/test/CMakeVOLTests.cmake @@ -0,0 +1,19 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + set (VOL_LIST + ) diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake new file mode 100644 index 0000000..27da8a5 --- /dev/null +++ b/config/cmake/volTest.cmake @@ -0,0 +1,76 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# +# volTest.cmake executes a command and captures the output in a file. Command uses specified VOL. +# Exit status of command can also be compared. + +# arguments checking +if (NOT TEST_PROGRAM) + message (FATAL_ERROR "Require TEST_PROGRAM to be defined") +endif () +if (NOT TEST_FOLDER) + message ( FATAL_ERROR "Require TEST_FOLDER to be defined") +endif () +if (NOT TEST_VOL) + message (FATAL_ERROR "Require TEST_VOL to be defined") +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) +endif () + +if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) +endif () + +# if there is not an error reference file add the error output to the stdout file +#if (NOT TEST_ERRREF) +# set (ERROR_APPEND 1) +#endif () + +message (STATUS "USING ${TEST_VOL} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") + +set (ENV{HDF5_VOL_CONNECTOR} "${TEST_VOL}") + +# run the test program, capture the stdout/stderr and the result var +execute_process ( + COMMAND ${TEST_PROGRAM} ${TEST_ARGS} + WORKING_DIRECTORY ${TEST_FOLDER} + RESULT_VARIABLE TEST_RESULT + OUTPUT_FILE ${TEST_OUTPUT}.out + ERROR_FILE ${TEST_OUTPUT}.err + OUTPUT_VARIABLE TEST_OUT + ERROR_VARIABLE TEST_ERROR +) + +message (STATUS "COMMAND Result: ${TEST_RESULT}") + +# if the .err file exists and ERRROR_APPEND is enabled +if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + file (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}.out "${TEST_STREAM}") +endif () + +# if the return value is !=${TEST_EXPECT} bail out +if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}") + if (NOT TEST_NOERRDISPLAY) + if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.out) + file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.out TEST_STREAM) + message (STATUS "Output USING ${TEST_VOL}:\n${TEST_STREAM}") + endif () + endif () + message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}") +endif () + +message (STATUS "COMMAND Error: ${TEST_ERROR}") + +# everything went fine... +message ("Passed: The ${TEST_PROGRAM} program used vol ${TEST_VOL}") diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index dd4766a..6b4504b 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -181,9 +181,9 @@ ### Windows pops up a modal permission dialog on this test if (H5_HAVE_PARALLEL AND NOT WIN32) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-ph5example COMMAND $) else () - add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}" + add_test (NAME EXAMPLES_PAR-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -195,14 +195,14 @@ ) endif () if (NOT "${last_test}" STREQUAL "") - set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test}) + set_tests_properties (EXAMPLES_PAR-ph5example PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "EXAMPLES-ph5example") + set (last_test "EXAMPLES_PAR-ph5example") if (BUILD_SHARED_LIBS) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME EXAMPLES-shared-ph5example COMMAND $) + add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND $) else () - add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}" + add_test (NAME EXAMPLES_PAR-shared-ph5example COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -213,10 +213,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) + set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared) if (NOT "${last_test}" STREQUAL "") - set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test}) + set_tests_properties (EXAMPLES_PAR-shared-ph5example PROPERTIES DEPENDS ${last_test}) endif () - set (last_test "EXAMPLES-shared-ph5example") + set (last_test "EXAMPLES_PAR-shared-ph5example") endif () endif () diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index edd876a..1c00fde 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -651,6 +651,7 @@ HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" HDF5_TEST_VFD "Execute tests with different VFDs" OFF +HDF5_TEST_VOL "Execute tests with different VOLs" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index 1c26def..26faba6 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -1127,6 +1127,16 @@ endif () ############################################################################## ############################################################################## +### V O L T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VOL) + include (CMakeVOLTests.cmake) +endif () + +############################################################################## +############################################################################## ### T H E G E N E R A T O R S ### ############################################################################## ############################################################################## diff --git a/test/CMakeVOLTests.cmake b/test/CMakeVOLTests.cmake new file mode 100644 index 0000000..39fa2a6 --- /dev/null +++ b/test/CMakeVOLTests.cmake @@ -0,0 +1,322 @@ + +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## +# included from CMakeTests.cmake + +set (VOL_LIST + vol_native + vol_pass_through1 + vol_pass_through2 +) + +set (vol_native native) +set (vol_pass_through1 "pass_through under_vol=0\;under_info={}") +set (vol_pass_through2 "pass_through under_vol=505\;under_info={under_vol=0\;under_info={}}") + +foreach (voltest ${VOL_LIST}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files") + if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}-shared") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}-shared/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${voltest}-shared/testfiles/plist_files") + endif () +endforeach () + +foreach (voltest ${VOL_LIST}) + foreach (h5_tfile ${HDF5_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${voltest}/${h5_tfile}" "HDF5_VOLTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}" "${PROJECT_BINARY_DIR}/${voltest}-shared/${h5_tfile}" "HDF5_VOLTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +foreach (voltest ${VOL_LIST}) + foreach (ref_file ${HDF5_REFERENCE_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${voltest}/${ref_file}" "HDF5_VOLTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file}" "${PROJECT_BINARY_DIR}/${voltest}-shared/${ref_file}" "HDF5_VOLTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +foreach (voltest ${VOL_LIST}) + foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${voltest}/${h5_file}" "HDF5_VOLTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/${h5_file}" "${HDF5_TEST_BINARY_DIR}/${voltest}-shared/${h5_file}" "HDF5_VOLTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +foreach (voltest ${VOL_LIST}) + foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files/${plistfile}" "HDF5_VOLTEST_LIB_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}/testfiles/plist_files/def_${plistfile}" "HDF5_VOLTEST_LIB_files") + if (BUILD_SHARED_LIBS) + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}-shared/testfiles/plist_files/${plistfile}" "HDF5_VOLTEST_LIBSH_files") + HDFTEST_COPY_FILE("${HDF5_TEST_SOURCE_DIR}/testfiles/plist_files/def_${plistfile}" "${PROJECT_BINARY_DIR}/${voltest}-shared/testfiles/plist_files/def_${plistfile}" "HDF5_VOLTEST_LIBSH_files") + endif () + endforeach () +endforeach () + +add_custom_target(HDF5_VOLTEST_LIB_files ALL COMMENT "Copying files needed by HDF5_VOLTEST_LIB tests" DEPENDS ${HDF5_VOLTEST_LIB_files_list}) +if (BUILD_SHARED_LIBS) + add_custom_target(HDF5_VOLTEST_LIBSH_files ALL COMMENT "Copying files needed by HDF5_VOLTEST_LIBSH tests" DEPENDS ${HDF5_VOLTEST_LIBSH_files_list}) +endif () + +############################################################################## +############################################################################## +### V O L T E S T S ### +############################################################################## +############################################################################## + + set (H5_VOL_SKIP_TESTS + cache + accum + fheap + big + vol + error_test + err_compat + tcheck_version + testmeta + links_env + ) + if (NOT CYGWIN) + list (REMOVE_ITEM H5_VOL_SKIP_TESTS big cache) + endif () + + # Windows only macro + macro (CHECK_VOL_TEST voltest volname volinfo resultcode) + if ("${voltest}" STREQUAL "flush1" OR "${voltest}" STREQUAL "flush2") + if ("${volname}" STREQUAL "multi" OR "${volname}" STREQUAL "split") + if (NOT BUILD_SHARED_LIBS AND NOT ${HDF_CFG_NAME} MATCHES "Debug") + add_test (NAME VOL-${volname}-${voltest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VOL-${volname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}-shared" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}-shared + ) + endif () + else () + add_test (NAME VOL-${volname}-${voltest} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VOL-${volname}-${voltest}" + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VOL-${volname}-${test}-shared + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VOL-${volname}-${voltest}-shared" + ) + endif () + endif () + else () + add_test (NAME VOL-${volname}-${voltest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VOL-${volname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}-shared" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}-shared + ) + endif () + endif () + else () + add_test (NAME VOL-${volname}-${voltest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} + ) + if (BUILD_SHARED_LIBS AND NOT "${voltest}" STREQUAL "cache") + add_test (NAME VOL-${volname}-${voltest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}-shared" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}-shared + ) + endif () + endif () + endmacro () + + macro (DO_VOL_TEST voltest volname volinfo resultcode) + #message(STATUS "${voltest}-${volname} with ${volinfo}") + add_test (NAME VOL-${volname}-${voltest} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VOL-${volname}-${voltest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-${voltest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}-shared" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-${voltest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}-shared + ) + endif () + endmacro () + + macro (ADD_VOL_TEST volname volinfo resultcode) + #message(STATUS "volname=${volname} volinfo=${volinfo}") + foreach (test ${H5_TESTS}) + if (NOT ${test} IN_LIST H5_VOL_SKIP_TESTS) + if (WIN32) + CHECK_VOL_TEST (${test} ${volname} "${volinfo}" ${resultcode}) + else () + DO_VOL_TEST (${test} ${volname} "${volinfo}" ${resultcode}) + endif () + endif () + endforeach () + set_tests_properties (VOL-${volname}-flush2 PROPERTIES DEPENDS VOL-${volname}-flush1) + set_tests_properties (VOL-${volname}-flush1 PROPERTIES TIMEOUT 10) + set_tests_properties (VOL-${volname}-flush2 PROPERTIES TIMEOUT 10) + set_tests_properties (VOL-${volname}-istore PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN) + set_tests_properties (VOL-${volname}-cache PROPERTIES TIMEOUT 1800) + endif () + if (BUILD_SHARED_LIBS) + set_tests_properties (VOL-${volname}-flush2-shared PROPERTIES DEPENDS VOL-${volname}-flush1-shared) + set_tests_properties (VOL-${volname}-flush1-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VOL-${volname}-flush2-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VOL-${volname}-istore-shared PROPERTIES TIMEOUT 1800) + if (NOT CYGWIN AND NOT WIN32) + set_tests_properties (VOL-${volname}-cache-shared PROPERTIES TIMEOUT 1800) + endif () + endif () + if (HDF5_TEST_FHEAP_VOL) + add_test (NAME VOL-${volname}-fheap + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-fheap" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-fheap PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname};HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname} + ) + if (BUILD_SHARED_LIBS) + add_test (NAME VOL-${volname}-fheap-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VOL:STRING=${volinfo}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${volname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${volname}-shared" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + set_tests_properties (VOL-${volname}-fheap-shared PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${volname}-shared;HDF5TestExpress=${HDF_TEST_EXPRESS}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${volname}-shared + ) + endif () + endif () + endmacro () + + # Run test with different Virtual File Driver + foreach (volname ${VOL_LIST}) + #message(STATUS "volname=${volname}") + foreach (volinfo IN LISTS ${volname}) + #message(STATUS "${volname} volinfo=${volinfo}") + ADD_VOL_TEST (${volname} "${volinfo}" 0) + endforeach () + endforeach () + diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 87470f3..ffe4cb5 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -27,6 +27,26 @@ endforeach () set_property (TEST TEST_PAR_t_pflush1 PROPERTY PASS_REGULAR_EXPRESSION "PASSED") set_tests_properties (TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VFD) + include (CMakeVFDTests.cmake) +endif () + +############################################################################## +############################################################################## +### V O L T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VOL) + include (CMakeVOLTests.cmake) +endif () + if (HDF5_TEST_VFD) set (VFD_LIST diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake new file mode 100644 index 0000000..b6b065f --- /dev/null +++ b/testpar/CMakeVFDTests.cmake @@ -0,0 +1,57 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + set (VFD_LIST + sec2 + stdio + core + split + multi + family + ) + + set (H5P_VFD_TESTS + t_pflush1 + t_pflush2 + ) + + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif () + + macro (ADD_VFD_TEST vfdname resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + foreach (test ${H5P_VFD_TESTS}) + add_test ( + NAME TEST_PAR_VFD-${vfdname}-${test} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${test}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + endforeach () + endif () + endmacro () + + # Run test with different Virtual File Driver + foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + endforeach () diff --git a/testpar/CMakeVOLTests.cmake b/testpar/CMakeVOLTests.cmake new file mode 100644 index 0000000..be3ecc2 --- /dev/null +++ b/testpar/CMakeVOLTests.cmake @@ -0,0 +1,19 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + set (VOL_LIST + ) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index ad468f0..d48f188 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -16,39 +16,6 @@ ############################################################################## ############################################################################## - if (HDF5_TEST_VFD) - set (VFD_LIST - sec2 - stdio - core - split - multi - family - ) - - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () - - macro (ADD_VFD_TEST vfdname resultcode) - add_test ( - NAME H5REPACK-VFD-${vfdname}-h5repacktest - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=h5repacktest" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - endmacro () - endif () - # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- @@ -1459,9 +1426,22 @@ if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (plugin_zero 0 h5repack_layout.h5 -v -f UD=250,0,0) endif () - if (HDF5_TEST_VFD) - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () - endif () +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VFD) + include (CMakeVFDTests.cmake) +endif () + +############################################################################## +############################################################################## +### V O L T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VOL) + include (CMakeVOLTests.cmake) +endif () diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake new file mode 100644 index 0000000..2042f31 --- /dev/null +++ b/tools/test/h5repack/CMakeVFDTests.cmake @@ -0,0 +1,65 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + set (VFD_LIST + sec2 + stdio + core + split + multi + family + ) + + if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) + endif () + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + macro (ADD_VFD_TEST vfdname resultcode) + add_test ( + NAME H5REPACK-VFD-${vfdname}-h5repacktest + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=h5repacktest" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") + endmacro () + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # Run test with different Virtual File Driver + foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) + endforeach () diff --git a/tools/test/h5repack/CMakeVOLTests.cmake b/tools/test/h5repack/CMakeVOLTests.cmake new file mode 100644 index 0000000..da19d59 --- /dev/null +++ b/tools/test/h5repack/CMakeVOLTests.cmake @@ -0,0 +1,55 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + + set (VOL_LIST + ) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + + macro (ADD_VOL_TEST volname resultcode) + add_test ( + NAME H5REPACK-VOL-${volname}-h5repacktest + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${volname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=h5repacktest" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -P "${HDF_RESOURCES_DIR}/volTest.cmake" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5REPACK-VOL-${volname}-h5repacktest PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5REPACK-VOL-${volname}-h5repacktest") + endmacro () + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + + # Run test with different VOL +# foreach (vol ${VOL_LIST}) +# ADD_VOL_TEST (${vol} 0) +# endforeach () -- cgit v0.12 From 3c8b00dbd8537528eb031ee0b8bb31297714fbf3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Dec 2018 15:35:37 -0600 Subject: HDFFV-10656 remove moved source --- testpar/CMakeTests.cmake | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index ffe4cb5..5f668cd 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -46,48 +46,3 @@ endif () if (HDF5_TEST_VOL) include (CMakeVOLTests.cmake) endif () - -if (HDF5_TEST_VFD) - - set (VFD_LIST - sec2 - stdio - core - split - multi - family - ) - - set (H5P_VFD_TESTS - t_pflush1 - t_pflush2 - ) - - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () - - macro (ADD_VFD_TEST vfdname resultcode) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - foreach (test ${H5P_VFD_TESTS}) - add_test ( - NAME TEST_PAR_VFD-${vfdname}-${test} - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${test}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" - ) - endforeach () - endif () - endmacro () - - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () - -endif () -- cgit v0.12 From 99d1f614f1b8a07a0e1f9694cf3665ed47d3eaee Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Dec 2018 10:39:15 -0600 Subject: Add reference file to list --- java/test/junit.sh.in | 1 + 1 file changed, 1 insertion(+) diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 42e16ee..add1af4 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -101,6 +101,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Obasic.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Ocreate.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Ocopy.txt $HDFTEST_HOME/testfiles/JUnit-TestH5PL.txt +$HDFTEST_HOME/testfiles/JUnit-TestH5VL.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Z.txt $HDFTEST_HOME/testfiles/JUnit-TestH5E.txt $HDFTEST_HOME/testfiles/JUnit-TestH5Edefault.txt -- cgit v0.12 From 909fa39bc75f850b0f32e48e9b0f1bcd9f1be573 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Dec 2018 11:41:02 -0600 Subject: Update option text --- CMakeLists.txt | 4 ++-- release_docs/INSTALL_CMake.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8433163..a16cb08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -756,10 +756,10 @@ if (BUILD_TESTING) mark_as_advanced (HDF5_TEST_FHEAP_VFD) endif () - option (HDF5_TEST_VOL "Execute tests with different VOLs" OFF) + option (HDF5_TEST_VOL "Execute tests with different VOL connectors" OFF) mark_as_advanced (HDF5_TEST_VOL) if (HDF5_TEST_VOL) - option (HDF5_TEST_FHEAP_VOL "Execute tests with different VOLs" ON) + option (HDF5_TEST_FHEAP_VOL "Execute fheap test with different VOL connectors" ON) mark_as_advanced (HDF5_TEST_FHEAP_VOL) endif () diff --git a/release_docs/INSTALL_CMake.txt b/release_docs/INSTALL_CMake.txt index 1c00fde..8acd35f 100644 --- a/release_docs/INSTALL_CMake.txt +++ b/release_docs/INSTALL_CMake.txt @@ -651,7 +651,7 @@ HDF5_PACKAGE_EXTLIBS "CPACK - include external libraries" HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF HDF_TEST_EXPRESS "Control testing framework (0-3)" "0" HDF5_TEST_VFD "Execute tests with different VFDs" OFF -HDF5_TEST_VOL "Execute tests with different VOLs" OFF +HDF5_TEST_VOL "Execute tests with different VOL connectors" OFF HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF HDF5_USE_110_API_DEFAULT "Use the HDF5 1.10.x API by default" OFF -- cgit v0.12 From 991996b25122ff010b9af1bbb6cc05be491ce038 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Dec 2018 12:22:32 -0600 Subject: Remove unused CMake files --- MANIFEST | 3 -- c++/test/CMakeTests.cmake | 10 ------ c++/test/CMakeVOLTests.cmake | 19 ------------ testpar/CMakeTests.cmake | 10 ------ testpar/CMakeVOLTests.cmake | 19 ------------ tools/test/h5repack/CMakeTests.cmake | 10 ------ tools/test/h5repack/CMakeVOLTests.cmake | 55 --------------------------------- 7 files changed, 126 deletions(-) delete mode 100644 c++/test/CMakeVOLTests.cmake delete mode 100644 testpar/CMakeVOLTests.cmake delete mode 100644 tools/test/h5repack/CMakeVOLTests.cmake diff --git a/MANIFEST b/MANIFEST index 01e0e20..4bc4b19 100644 --- a/MANIFEST +++ b/MANIFEST @@ -3249,7 +3249,6 @@ ./c++/test/CMakeLists.txt ./c++/test/CMakeTests.cmake ./c++/test/CMakeVFDTests.cmake -./c++/test/CMakeVOLTests.cmake ./examples/CMakeLists.txt ./examples/CMakeTests.cmake ./examples/run-all-ex.sh @@ -3295,7 +3294,6 @@ ./testpar/CMakeLists.txt ./testpar/CMakeTests.cmake ./testpar/CMakeVFDTests.cmake -./testpar/CMakeVOLTests.cmake ./tools/CMakeLists.txt ./tools/lib/CMakeLists.txt ./tools/src/CMakeLists.txt @@ -3329,7 +3327,6 @@ ./tools/test/h5repack/CMakeLists.txt ./tools/test/h5repack/CMakeTests.cmake ./tools/test/h5repack/CMakeVFDTests.cmake -./tools/test/h5repack/CMakeVOLTests.cmake ./tools/src/h5stat/CMakeLists.txt ./tools/test/h5stat/CMakeLists.txt ./tools/test/h5stat/CMakeTests.cmake diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index a1c07f7..02bff3e 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -56,13 +56,3 @@ set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects if (HDF5_TEST_VFD) include (CMakeVFDTests.cmake) endif () - -############################################################################## -############################################################################## -### V O L T E S T S ### -############################################################################## -############################################################################## - -if (HDF5_TEST_VOL) - include (CMakeVOLTests.cmake) -endif () diff --git a/c++/test/CMakeVOLTests.cmake b/c++/test/CMakeVOLTests.cmake deleted file mode 100644 index be3ecc2..0000000 --- a/c++/test/CMakeVOLTests.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - set (VOL_LIST - ) diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index 5f668cd..dffb813 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -36,13 +36,3 @@ set_tests_properties (TEST_PAR_t_pflush2 PROPERTIES DEPENDS TEST_PAR_t_pflush1) if (HDF5_TEST_VFD) include (CMakeVFDTests.cmake) endif () - -############################################################################## -############################################################################## -### V O L T E S T S ### -############################################################################## -############################################################################## - -if (HDF5_TEST_VOL) - include (CMakeVOLTests.cmake) -endif () diff --git a/testpar/CMakeVOLTests.cmake b/testpar/CMakeVOLTests.cmake deleted file mode 100644 index be3ecc2..0000000 --- a/testpar/CMakeVOLTests.cmake +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - set (VOL_LIST - ) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index d48f188..c2a2be7 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -1435,13 +1435,3 @@ endif () if (HDF5_TEST_VFD) include (CMakeVFDTests.cmake) endif () - -############################################################################## -############################################################################## -### V O L T E S T S ### -############################################################################## -############################################################################## - -if (HDF5_TEST_VOL) - include (CMakeVOLTests.cmake) -endif () diff --git a/tools/test/h5repack/CMakeVOLTests.cmake b/tools/test/h5repack/CMakeVOLTests.cmake deleted file mode 100644 index da19d59..0000000 --- a/tools/test/h5repack/CMakeVOLTests.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# -# Copyright by The HDF Group. -# All rights reserved. -# -# This file is part of HDF5. The full HDF5 copyright notice, including -# terms governing use, modification, and redistribution, is contained in -# the COPYING file, which can be found at the root of the source code -# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# - -############################################################################## -############################################################################## -### T E S T I N G ### -############################################################################## -############################################################################## - - set (VOL_LIST - ) - -############################################################################## -############################################################################## -### T H E T E S T S M A C R O S ### -############################################################################## -############################################################################## - - macro (ADD_VOL_TEST volname resultcode) - add_test ( - NAME H5REPACK-VOL-${volname}-h5repacktest - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${volname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=h5repacktest" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/volTest.cmake" - ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5REPACK-VOL-${volname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPACK-VOL-${volname}-h5repacktest") - endmacro () - -############################################################################## -############################################################################## -### T H E T E S T S ### -############################################################################## -############################################################################## - - # Run test with different VOL -# foreach (vol ${VOL_LIST}) -# ADD_VOL_TEST (${vol} 0) -# endforeach () -- cgit v0.12 From 9152547b766919eefb7163e17f0c03052a2d73f2 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Dec 2018 08:56:43 -0800 Subject: H5VLregister_by_value() should not set _BY_NAME when searching for plugins. --- src/H5VL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5VL.c b/src/H5VL.c index eedf68d..bf1201f 100644 --- a/src/H5VL.c +++ b/src/H5VL.c @@ -295,7 +295,7 @@ H5VLregister_connector_by_value(H5VL_class_value_t value, hid_t vipl_id) const H5VL_class_t *cls; /* Try loading the connector */ - key.vol.kind = H5VL_GET_CONNECTOR_BY_NAME; + key.vol.kind = H5VL_GET_CONNECTOR_BY_VALUE; key.vol.u.value = value; if(NULL == (cls = (const H5VL_class_t *)H5PL_load(H5PL_TYPE_VOL, &key))) HGOTO_ERROR(H5E_VOL, H5E_CANTINIT, H5I_INVALID_HID, "unable to load VOL connector") -- cgit v0.12 From 9cc406633c29d4167031dc85b950858f90163cbc Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 27 Dec 2018 14:00:32 -0800 Subject: Fixed plugin loading so it actually checks the plugin type. --- src/H5PLint.c | 15 +++++++++++++-- src/H5PLpkg.h | 2 ++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/H5PLint.c b/src/H5PLint.c index ded315a..8dec14b 100644 --- a/src/H5PLint.c +++ b/src/H5PLint.c @@ -311,6 +311,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, hbool_t *success, const void **plugin_info) { H5PL_HANDLE handle = NULL; + H5PL_get_plugin_type_t get_plugin_type = NULL; H5PL_get_plugin_info_t get_plugin_info = NULL; herr_t ret_value = SUCCEED; @@ -333,12 +334,22 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, HGOTO_DONE(SUCCEED) } + /* Return a handle for the function H5PLget_plugin_type in the dynamic library. + * The plugin library is supposed to define this function. + */ + if (NULL == (get_plugin_type = (H5PL_get_plugin_type_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_type"))) + HGOTO_DONE(SUCCEED) + /* Return a handle for the function H5PLget_plugin_info in the dynamic library. - * The plugin library is suppose to define this function. + * The plugin library is supposed to define this function. */ if (NULL == (get_plugin_info = (H5PL_get_plugin_info_t)H5PL_GET_LIB_FUNC(handle, "H5PLget_plugin_info"))) HGOTO_DONE(SUCCEED) + /* Check the plugin type and return if it doesn't match the one passed in */ + if(type != (H5PL_type_t)(*get_plugin_type)()) + HGOTO_DONE(SUCCEED) + /* Get the plugin information */ switch (type) { case H5PL_TYPE_FILTER: @@ -364,7 +375,7 @@ H5PL__open(const char *path, H5PL_type_t type, const H5PL_key_t *key, /* Get the plugin info */ if(NULL == (cls = (const H5VL_class_t *)(*get_plugin_info)())) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL driver info from plugin") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "can't get VOL connector info from plugin") /* Which kind of key are we looking for? */ if(key->vol.kind == H5VL_GET_CONNECTOR_BY_NAME) { diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index c3ad8f5..8c2367f 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -79,6 +79,7 @@ /* maximum size for expanding env vars */ # define H5PL_EXPAND_BUFFER_SIZE 32767 + typedef H5PL_type_t(__cdecl *H5PL_get_plugin_type_t)(void); typedef const void *(__cdecl *H5PL_get_plugin_info_t)(void); #else /* H5_HAVE_WIN32_API */ @@ -105,6 +106,7 @@ /* Clear error */ # define H5PL_CLR_ERROR HERROR(H5E_PLUGIN, H5E_CANTGET, "can't dlopen:%s", dlerror()) + typedef H5PL_type_t(*H5PL_get_plugin_type_t)(void); typedef const void *(*H5PL_get_plugin_info_t)(void); #endif /* H5_HAVE_WIN32_API */ -- cgit v0.12