Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.12 Merge Consolidate VFD create list macro #1132 #1133

Merged
merged 3 commits into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,9 @@ if (BUILD_TESTING)
if (HDF5_TEST_VFD)
option (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON)
mark_as_advanced (HDF5_TEST_FHEAP_VFD)

# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
H5_SET_VFD_LIST()
endif ()

option (HDF5_TEST_PASSTHROUGH_VOL "Execute tests with different passthrough VOL connectors" OFF)
Expand Down
3 changes: 1 addition & 2 deletions c++/test/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################

H5_SET_VFD_LIST()
H5_CREATE_VFD_DIR()

##############################################################################
##############################################################################
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ endif ()
# Header-check flags set in config/cmake_ext_mod/ConfigureChecks.cmake
# ----------------------------------------------------------------------
option (HDF5_ENABLE_MIRROR_VFD "Build the Mirror Virtual File Driver" OFF)
if (H5FD_ENABLE_MIRROR_VFD)
if (HDF5_ENABLE_MIRROR_VFD)
if ( ${HDF_PREFIX}_HAVE_NETINET_IN_H AND
${HDF_PREFIX}_HAVE_NETDB_H AND
${HDF_PREFIX}_HAVE_ARPA_INET_H AND
Expand Down
4 changes: 4 additions & 0 deletions config/cmake/HDF5Macros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ macro (H5_SET_LIB_OPTIONS libtarget libname libtype libpackage)
endif ()
endmacro ()

# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
macro (H5_SET_VFD_LIST)
set (VFD_LIST
sec2
Expand Down Expand Up @@ -92,7 +93,10 @@ macro (H5_SET_VFD_LIST)
if (H5_HAVE_WINDOWS)
set (VFD_LIST ${VFD_LIST} windows)
endif ()
endmacro ()

# Initialize the list of VFDs to be used for testing and create a test folder for each VFD
macro (H5_CREATE_VFD_DIR)
foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}")
endforeach ()
Expand Down
42 changes: 22 additions & 20 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -511,9 +511,9 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_thread_id_FORMAT thread_id)
endif ()

if (HDF5_BUILD_UTILS)
#-- Adding test for mirror_vfd
add_executable (mirror_vfd ${mirror_vfd_SOURCES})
if (HDF5_BUILD_UTILS) # requires mirror server
#-- Adding test for mirror_vfd
add_executable (mirror_vfd ${mirror_vfd_SOURCES})
target_include_directories (mirror_vfd PRIVATE "${HDF5_SRC_DIR};${HDF5_SRC_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (mirror_vfd STATIC)
Expand Down Expand Up @@ -695,24 +695,26 @@ if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_FORMAT use_append_chunk)
endif ()

set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk_mirror PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_chunk_mirror STATIC)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
else ()
TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)
if (HDF5_BUILD_UTILS) # requires mirror server
set (use_append_chunk_mirror_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk_mirror.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
add_executable (use_append_chunk_mirror ${use_append_chunk_mirror_SOURCES})
target_compile_options(use_append_chunk_mirror PRIVATE "${HDF5_CMAKE_C_FLAGS}")
target_include_directories (use_append_chunk_mirror PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
if (NOT BUILD_SHARED_LIBS)
TARGET_C_PROPERTIES (use_append_chunk_mirror STATIC)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIB_TARGET})
else ()
TARGET_C_PROPERTIES (use_append_chunk_mirror SHARED)
target_link_libraries (use_append_chunk_mirror PRIVATE ${HDF5_TEST_LIBSH_TARGET})
endif ()
set_target_properties (use_append_chunk_mirror PROPERTIES FOLDER test)

#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
#-----------------------------------------------------------------------------
# Add Target to clang-format
#-----------------------------------------------------------------------------
if (HDF5_ENABLE_FORMATTERS)
clang_format (HDF5_TEST_use_append_chunk_mirror_FORMAT use_append_chunk_mirror)
endif ()
endif ()

set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c ${HDF5_TEST_SOURCE_DIR}/use.h)
Expand Down
4 changes: 2 additions & 2 deletions test/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
##############################################################################
##############################################################################
# included from CMakeTests.cmake
H5_CREATE_VFD_DIR()

H5_SET_VFD_LIST()

# create more test folders for each VFD
foreach (vfdtest ${VFD_LIST})
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles")
file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}/testfiles/plist_files")
Expand Down
3 changes: 1 addition & 2 deletions testpar/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@
### T E S T I N G ###
##############################################################################
##############################################################################
H5_CREATE_VFD_DIR()

set (H5P_VFD_TESTS
t_pflush1
t_pflush2
)

H5_SET_VFD_LIST()

macro (ADD_VFD_TEST vfdname resultcode)
if (NOT HDF5_ENABLE_USING_MEMCHECKER)
foreach (h5_test ${H5P_VFD_TESTS})
Expand Down
3 changes: 1 addition & 2 deletions tools/test/h5dump/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################

H5_SET_VFD_LIST()
H5_CREATE_VFD_DIR()

# --------------------------------------------------------------------
# Copy all the HDF5 files from the source directory into the test directory
Expand Down
3 changes: 1 addition & 2 deletions tools/test/h5repack/CMakeVFDTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@
### T E S T I N G ###
##############################################################################
##############################################################################

H5_SET_VFD_LIST()
H5_CREATE_VFD_DIR()

##############################################################################
##############################################################################
Expand Down