diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2021-10-28 12:49:28 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-28 12:49:28 (GMT) |
commit | fabdce56efbc0aed942770414bef36c9fd81c878 (patch) | |
tree | 7c648e37dfb87b629b803ab4dcf507bf9e4e6071 | |
parent | 07a3a1c70b4b276497d5f837296c54930b5d675a (diff) | |
download | hdf5-fabdce56efbc0aed942770414bef36c9fd81c878.zip hdf5-fabdce56efbc0aed942770414bef36c9fd81c878.tar.gz hdf5-fabdce56efbc0aed942770414bef36c9fd81c878.tar.bz2 |
Split dir create into separate macro (#1141)
* Split dir create into separate macro
* Correct VFD settings
-rw-r--r-- | c++/test/CMakeVFDTests.cmake | 1 | ||||
-rw-r--r-- | config/cmake/ConfigureChecks.cmake | 2 | ||||
-rw-r--r-- | config/cmake/HDF5Macros.cmake | 3 | ||||
-rw-r--r-- | test/CMakeLists.txt | 42 | ||||
-rw-r--r-- | test/CMakeVFDTests.cmake | 1 | ||||
-rw-r--r-- | testpar/CMakeVFDTests.cmake | 1 | ||||
-rw-r--r-- | tools/test/h5dump/CMakeVFDTests.cmake | 1 | ||||
-rw-r--r-- | tools/test/h5repack/CMakeVFDTests.cmake | 1 |
8 files changed, 31 insertions, 21 deletions
diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake index 4f3d137..ced9b0c 100644 --- a/c++/test/CMakeVFDTests.cmake +++ b/c++/test/CMakeVFDTests.cmake @@ -15,6 +15,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## +H5_CREATE_VFD_DIR() ############################################################################## ############################################################################## diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 263cedf..7b9d603 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -195,7 +195,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 diff --git a/config/cmake/HDF5Macros.cmake b/config/cmake/HDF5Macros.cmake index 1a0e8b3..8b8b334 100644 --- a/config/cmake/HDF5Macros.cmake +++ b/config/cmake/HDF5Macros.cmake @@ -93,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 () diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 37e6af6..4e543fd 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -555,9 +555,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) @@ -752,24 +752,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) diff --git a/test/CMakeVFDTests.cmake b/test/CMakeVFDTests.cmake index 130b0bf..e08e4d2 100644 --- a/test/CMakeVFDTests.cmake +++ b/test/CMakeVFDTests.cmake @@ -16,6 +16,7 @@ ############################################################################## ############################################################################## # included from CMakeTests.cmake +H5_CREATE_VFD_DIR() # create more test folders for each VFD foreach (vfdtest ${VFD_LIST}) diff --git a/testpar/CMakeVFDTests.cmake b/testpar/CMakeVFDTests.cmake index 12df1e9..d6a4025 100644 --- a/testpar/CMakeVFDTests.cmake +++ b/testpar/CMakeVFDTests.cmake @@ -15,6 +15,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## +H5_CREATE_VFD_DIR() set (H5P_VFD_TESTS t_pflush1 diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake index b6e0bea..7ab8c1f 100644 --- a/tools/test/h5dump/CMakeVFDTests.cmake +++ b/tools/test/h5dump/CMakeVFDTests.cmake @@ -15,6 +15,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## +H5_CREATE_VFD_DIR() # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake index e50414f..f8ac10b 100644 --- a/tools/test/h5repack/CMakeVFDTests.cmake +++ b/tools/test/h5repack/CMakeVFDTests.cmake @@ -15,6 +15,7 @@ ### T E S T I N G ### ############################################################################## ############################################################################## +H5_CREATE_VFD_DIR() ############################################################################## ############################################################################## |