2018-03-10 02:31:58 +08:00
|
|
|
cmake_minimum_required (VERSION 3.10)
|
2018-04-20 23:11:55 +08:00
|
|
|
project (HDF5_TEST C)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2013-03-16 02:28:37 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2013-03-28 00:11:21 +08:00
|
|
|
# Generate the H5srcdir_str.h file containing user settings needed by compilation
|
2013-03-16 02:28:37 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2018-04-18 04:57:51 +08:00
|
|
|
set (srcdir ${HDF5_TEST_SOURCE_DIR})
|
2014-03-12 06:07:13 +08:00
|
|
|
configure_file (${HDF5_TEST_SOURCE_DIR}/H5srcdir_str.h.in H5srcdir_str.h @ONLY)
|
2013-03-16 02:28:37 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
#################################################################################
|
2013-03-28 00:11:21 +08:00
|
|
|
# Define Test Library Sources
|
2018-02-28 02:57:07 +08:00
|
|
|
#################################################################################
|
2016-05-05 00:29:52 +08:00
|
|
|
set (TEST_LIB_SOURCES
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/h5test.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/testframe.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/cache_common.c
|
2017-01-27 03:34:12 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/swmr_common.c
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
set (TEST_LIB_HEADERS
|
2010-05-14 00:01:50 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/h5test.h
|
2016-05-05 00:29:52 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/cache_common.h
|
2017-01-27 03:34:12 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/swmr_common.h
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
2016-05-05 00:29:52 +08:00
|
|
|
add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_TEST_LIB_TARGET}
|
2018-05-10 03:29:44 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC)
|
|
|
|
target_link_libraries (${HDF5_TEST_LIB_TARGET}
|
|
|
|
PUBLIC ${LINK_LIBS} ${HDF5_LIB_TARGET}
|
|
|
|
PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
|
|
|
)
|
2014-03-12 05:14:57 +08:00
|
|
|
if (MINGW)
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TEST_LIB_TARGET} PRIVATE "wsock32.lib")
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC 0)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2015-08-05 23:56:58 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2016-05-05 00:29:52 +08:00
|
|
|
add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SOURCES} ${TEST_LIB_HEADERS})
|
2018-04-27 05:41:04 +08:00
|
|
|
target_include_directories(${HDF5_TEST_LIBSH_TARGET}
|
2018-05-10 03:29:44 +08:00
|
|
|
PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>"
|
2018-04-27 05:41:04 +08:00
|
|
|
INTERFACE "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
|
|
|
|
)
|
|
|
|
target_compile_definitions(${HDF5_TEST_LIBSH_TARGET}
|
2018-05-09 21:53:25 +08:00
|
|
|
PUBLIC "H5_BUILT_AS_DYNAMIC_LIB" $<$<BOOL:${HDF5_ENABLE_THREADSAFE}>:H5_HAVE_THREADSAFE>
|
2018-04-27 05:41:04 +08:00
|
|
|
)
|
|
|
|
TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED)
|
|
|
|
target_link_libraries (${HDF5_TEST_LIBSH_TARGET}
|
|
|
|
PUBLIC ${LINK_LIBS} ${HDF5_LIBSH_TARGET}
|
|
|
|
PRIVATE $<$<PLATFORM_ID:Windows>:ws2_32.lib>
|
|
|
|
)
|
2015-08-05 23:56:58 +08:00
|
|
|
if (MINGW)
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TEST_LIBSH_TARGET} PRIVATE "wsock32.lib")
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED "LIB")
|
2018-04-27 05:41:04 +08:00
|
|
|
set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES FOLDER libraries/test)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2015-08-05 23:56:58 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
#################################################################################
|
2017-11-09 09:52:44 +08:00
|
|
|
# If filter plugin tests can be tested
|
2018-02-28 02:57:07 +08:00
|
|
|
#################################################################################
|
2013-04-03 00:27:46 +08:00
|
|
|
# make plugins dir
|
2017-11-09 09:52:44 +08:00
|
|
|
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir1")
|
|
|
|
file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/filter_plugin_dir2")
|
2013-03-28 00:11:21 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2017-11-09 09:52:44 +08:00
|
|
|
# Define Filter Plugin Test Sources
|
2013-03-28 00:11:21 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-11-09 09:52:44 +08:00
|
|
|
set (FILTER_PLUGINS_FOR_DIR1
|
|
|
|
filter_plugin1_dsets
|
|
|
|
filter_plugin3_dsets
|
2013-03-28 00:11:21 +08:00
|
|
|
)
|
2017-11-09 09:52:44 +08:00
|
|
|
set (FILTER_PLUGINS_FOR_DIR2
|
|
|
|
filter_plugin2_dsets
|
|
|
|
filter_plugin4_groups
|
2013-04-03 03:12:06 +08:00
|
|
|
)
|
2013-03-28 00:11:21 +08:00
|
|
|
|
2017-11-09 09:52:44 +08:00
|
|
|
foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR1})
|
|
|
|
set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}")
|
|
|
|
set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}")
|
|
|
|
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
|
2013-03-28 00:11:21 +08:00
|
|
|
|
2017-11-09 09:52:44 +08:00
|
|
|
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
|
2017-11-09 09:52:44 +08:00
|
|
|
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
|
2013-03-28 00:11:21 +08:00
|
|
|
|
2013-04-03 00:27:46 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2017-11-09 09:52:44 +08:00
|
|
|
# Copy the filter plugin to a plugins folder
|
2013-04-03 00:27:46 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
add_custom_command (
|
2017-11-09 09:52:44 +08:00
|
|
|
TARGET ${HDF5_TEST_PLUGIN_TARGET}
|
2013-04-03 00:27:46 +08:00
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2015-06-10 02:48:03 +08:00
|
|
|
ARGS -E copy_if_different
|
2017-11-09 09:52:44 +08:00
|
|
|
"$<TARGET_FILE:${HDF5_TEST_PLUGIN_TARGET}>"
|
|
|
|
"${CMAKE_BINARY_DIR}/filter_plugin_dir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_TARGET}>"
|
2013-04-03 00:27:46 +08:00
|
|
|
)
|
2017-01-11 07:09:53 +08:00
|
|
|
endforeach ()
|
2013-04-03 03:12:06 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
foreach (plugin_name ${FILTER_PLUGINS_FOR_DIR2})
|
2017-11-09 09:52:44 +08:00
|
|
|
set (HDF5_TEST_PLUGIN_CORENAME "${plugin_name}")
|
|
|
|
set (HDF5_TEST_PLUGIN_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TEST_PLUGIN_CORENAME}")
|
|
|
|
set (HDF5_TEST_PLUGIN_TARGET ${HDF5_TEST_PLUGIN_CORENAME})
|
2013-04-03 03:12:06 +08:00
|
|
|
|
2017-11-09 09:52:44 +08:00
|
|
|
add_library (${HDF5_TEST_PLUGIN_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${plugin_name}.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(${HDF5_TEST_PLUGIN_TARGET} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_TARGET} SHARED)
|
2017-12-21 07:00:24 +08:00
|
|
|
target_link_libraries (${HDF5_TEST_PLUGIN_TARGET} PUBLIC ${HDF5_TEST_LIB_TARGET})
|
2018-04-10 21:55:17 +08:00
|
|
|
H5_SET_LIB_OPTIONS (${HDF5_TEST_PLUGIN_TARGET} ${HDF5_TEST_PLUGIN_NAME} SHARED "LIB")
|
2017-11-09 09:52:44 +08:00
|
|
|
set_target_properties (${HDF5_TEST_PLUGIN_TARGET} PROPERTIES FOLDER libraries/TEST_PLUGIN)
|
2013-04-03 03:12:06 +08:00
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
2017-11-09 09:52:44 +08:00
|
|
|
# Copy the filter plugin to a plugins folder
|
2013-04-03 03:12:06 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
2014-03-12 05:14:57 +08:00
|
|
|
add_custom_command (
|
2017-11-09 09:52:44 +08:00
|
|
|
TARGET ${HDF5_TEST_PLUGIN_TARGET}
|
2013-04-03 03:12:06 +08:00
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2015-06-10 02:48:03 +08:00
|
|
|
ARGS -E copy_if_different
|
2017-11-09 09:52:44 +08:00
|
|
|
"$<TARGET_FILE:${HDF5_TEST_PLUGIN_TARGET}>"
|
|
|
|
"${CMAKE_BINARY_DIR}/filter_plugin_dir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_TARGET}>"
|
2013-04-03 03:12:06 +08:00
|
|
|
)
|
2017-01-11 07:09:53 +08:00
|
|
|
endforeach ()
|
2013-03-28 00:11:21 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
#################################################################################
|
|
|
|
# Test program sources
|
|
|
|
#################################################################################
|
|
|
|
|
2016-05-05 00:29:52 +08:00
|
|
|
set (testhdf5_SOURCES
|
2013-08-23 02:16:27 +08:00
|
|
|
${HDF5_TEST_SOURCE_DIR}/testhdf5.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tarray.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tattr.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tchecksum.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tconfig.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tcoords.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tfile.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tgenprop.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/th5o.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/th5s.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/theap.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tid.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/titerate.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tmeta.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tmisc.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/trefer.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/trefstr.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tselect.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tskiplist.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tsohm.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttime.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttst.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tunicode.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tvltypes.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/tvlstr.c
|
|
|
|
)
|
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
set (cache_image_SOURCES
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/cache_image.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/genall5.c
|
|
|
|
)
|
2013-08-23 02:16:27 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
set (ttsafe_SOURCES
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttsafe.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttsafe_dcreate.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttsafe_error.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c
|
|
|
|
${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c
|
|
|
|
)
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
set (H5_TESTS
|
2018-02-28 02:57:07 +08:00
|
|
|
testhdf5 # multiple source
|
2016-05-05 00:29:52 +08:00
|
|
|
cache
|
|
|
|
cache_api
|
2018-02-28 02:57:07 +08:00
|
|
|
cache_image # multiple source
|
2016-05-05 00:29:52 +08:00
|
|
|
cache_tagging
|
2013-08-23 02:41:25 +08:00
|
|
|
lheap
|
|
|
|
ohdr
|
|
|
|
stab
|
|
|
|
gheap
|
2016-09-15 04:50:29 +08:00
|
|
|
evict_on_close
|
2016-05-05 00:29:52 +08:00
|
|
|
farray
|
|
|
|
earray
|
|
|
|
btree2
|
|
|
|
fheap
|
2013-08-23 02:41:25 +08:00
|
|
|
pool
|
2016-05-05 00:29:52 +08:00
|
|
|
accum
|
2018-02-28 02:57:07 +08:00
|
|
|
hyperslab
|
2013-08-23 02:41:25 +08:00
|
|
|
istore
|
|
|
|
bittests
|
|
|
|
dt_arith
|
2018-02-28 02:57:07 +08:00
|
|
|
page_buffer
|
2013-08-23 02:41:25 +08:00
|
|
|
dtypes
|
2014-01-29 06:20:41 +08:00
|
|
|
dsets
|
2013-08-23 02:41:25 +08:00
|
|
|
cmpd_dset
|
|
|
|
filter_fail
|
|
|
|
extend
|
2018-04-30 22:52:07 +08:00
|
|
|
direct_chunk
|
2013-08-23 02:41:25 +08:00
|
|
|
external
|
|
|
|
efc
|
|
|
|
objcopy
|
|
|
|
links
|
|
|
|
unlink
|
2017-01-27 03:34:12 +08:00
|
|
|
twriteorder
|
2013-08-23 02:41:25 +08:00
|
|
|
big
|
|
|
|
mtime
|
|
|
|
fillval
|
|
|
|
mount
|
|
|
|
flush1
|
|
|
|
flush2
|
|
|
|
app_ref
|
|
|
|
enum
|
|
|
|
set_extent
|
2018-02-28 02:57:07 +08:00
|
|
|
ttsafe # multiple source
|
2016-05-05 00:29:52 +08:00
|
|
|
enc_dec_plist
|
|
|
|
enc_dec_plist_cross_platform
|
2013-08-23 02:41:25 +08:00
|
|
|
getname
|
|
|
|
vfd
|
|
|
|
ntypes
|
|
|
|
dangle
|
|
|
|
dtransform
|
|
|
|
reserved
|
|
|
|
cross_read
|
|
|
|
freespace
|
|
|
|
mf
|
2015-02-24 00:20:53 +08:00
|
|
|
vds
|
2013-08-23 02:41:25 +08:00
|
|
|
file_image
|
|
|
|
unregister
|
2016-11-04 14:27:10 +08:00
|
|
|
cache_logging
|
2016-06-14 01:49:39 +08:00
|
|
|
cork
|
2016-12-03 00:07:04 +08:00
|
|
|
swmr
|
2013-08-23 02:41:25 +08:00
|
|
|
)
|
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
macro (ADD_H5_EXE file)
|
|
|
|
add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(${file} PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (${file} STATIC)
|
|
|
|
target_link_libraries (${file} PRIVATE ${HDF5_TEST_LIB_TARGET})
|
2018-02-28 02:57:07 +08:00
|
|
|
set_target_properties (${file} PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(${file}-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};${HDF5_TEST_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (${file}-shared SHARED)
|
|
|
|
target_link_libraries (${file}-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET})
|
2018-02-28 02:57:07 +08:00
|
|
|
set_target_properties (${file}-shared PROPERTIES FOLDER test)
|
|
|
|
endif ()
|
|
|
|
endmacro ()
|
2016-12-30 23:06:07 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
set (H5_TESTS_MULTIPLE
|
|
|
|
testhdf5
|
|
|
|
cache_image
|
|
|
|
ttsafe
|
2017-01-27 03:34:12 +08:00
|
|
|
)
|
2018-02-28 02:57:07 +08:00
|
|
|
# Only build single source tests here
|
|
|
|
foreach (test ${H5_TESTS})
|
2018-02-28 04:04:34 +08:00
|
|
|
if (NOT ${test} IN_LIST H5_TESTS_MULTIPLE)
|
2018-02-28 02:57:07 +08:00
|
|
|
ADD_H5_EXE(${test})
|
|
|
|
endif ()
|
2017-03-02 04:47:53 +08:00
|
|
|
endforeach ()
|
2017-01-27 03:34:12 +08:00
|
|
|
|
2013-08-23 02:41:25 +08:00
|
|
|
##############################################################################
|
2018-02-28 02:57:07 +08:00
|
|
|
### M U L T I P L E S O U R C E T E S T S ###
|
2013-08-23 02:41:25 +08:00
|
|
|
##############################################################################
|
2018-02-28 02:57:07 +08:00
|
|
|
|
|
|
|
#-- Adding test for testhdf5
|
|
|
|
add_executable (testhdf5 ${testhdf5_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(testhdf5 PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (testhdf5 STATIC)
|
|
|
|
target_link_libraries (testhdf5 PRIVATE ${HDF5_TEST_LIB_TARGET})
|
2018-02-28 02:57:07 +08:00
|
|
|
set_target_properties (testhdf5 PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_executable (testhdf5-shared ${testhdf5_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(testhdf5-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (testhdf5-shared SHARED)
|
|
|
|
target_link_libraries (testhdf5-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET})
|
2018-02-28 02:57:07 +08:00
|
|
|
set_target_properties (testhdf5-shared PROPERTIES FOLDER test)
|
|
|
|
endif ()
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2017-01-29 15:19:37 +08:00
|
|
|
#-- Adding test for cache_image
|
2018-02-28 02:57:07 +08:00
|
|
|
add_executable (cache_image ${cache_image_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(cache_image PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (cache_image STATIC)
|
|
|
|
target_link_libraries (cache_image PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2017-01-29 15:19:37 +08:00
|
|
|
set_target_properties (cache_image PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
2018-02-28 02:57:07 +08:00
|
|
|
add_executable (cache_image-shared ${cache_image_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(cache_image-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (cache_image-shared SHARED)
|
|
|
|
target_link_libraries (cache_image-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
2017-01-29 15:19:37 +08:00
|
|
|
set_target_properties (cache_image-shared PROPERTIES FOLDER test)
|
2017-03-01 23:58:59 +08:00
|
|
|
endif ()
|
2017-01-29 15:19:37 +08:00
|
|
|
|
2013-08-23 02:41:25 +08:00
|
|
|
#-- Adding test for ttsafe
|
2018-02-28 02:57:07 +08:00
|
|
|
add_executable (ttsafe ${ttsafe_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(ttsafe PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (ttsafe STATIC)
|
|
|
|
target_link_libraries (ttsafe PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2014-03-12 05:14:57 +08:00
|
|
|
set_target_properties (ttsafe PROPERTIES FOLDER test)
|
2015-08-05 23:56:58 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2018-02-28 02:57:07 +08:00
|
|
|
add_executable (ttsafe-shared ${ttsafe_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(ttsafe-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (ttsafe-shared SHARED)
|
|
|
|
target_link_libraries (ttsafe-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
2015-08-05 23:56:58 +08:00
|
|
|
set_target_properties (ttsafe-shared PROPERTIES FOLDER test)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
##############################################################################
|
|
|
|
### A D D I T I O N A L T E S T S ###
|
|
|
|
##############################################################################
|
|
|
|
|
2016-05-05 00:29:52 +08:00
|
|
|
set (H5_CHECK_TESTS
|
|
|
|
error_test
|
|
|
|
err_compat
|
|
|
|
tcheck_version
|
|
|
|
testmeta
|
2017-01-27 03:34:12 +08:00
|
|
|
atomic_writer
|
|
|
|
atomic_reader
|
2016-05-05 00:29:52 +08:00
|
|
|
links_env
|
2017-06-29 14:11:44 +08:00
|
|
|
filenotclosed
|
2018-02-28 02:57:07 +08:00
|
|
|
flushrefresh
|
2016-05-05 00:29:52 +08:00
|
|
|
)
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2016-05-05 00:29:52 +08:00
|
|
|
foreach (test ${H5_CHECK_TESTS})
|
|
|
|
ADD_H5_EXE(${test})
|
2017-01-11 07:09:53 +08:00
|
|
|
endforeach ()
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2018-02-28 02:57:07 +08:00
|
|
|
#-- Adding test for libinfo
|
|
|
|
set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake)
|
|
|
|
file (WRITE ${GREP_RUNNER}
|
|
|
|
"file (STRINGS \${TEST_PROGRAM} TEST_RESULT REGEX \"SUMMARY OF THE HDF5 CONFIGURATION\")
|
|
|
|
if (\${TEST_RESULT} STREQUAL \"0\")
|
|
|
|
message (FATAL_ERROR \"Failed: The output: \${TEST_RESULT} of \${TEST_PROGRAM} did not contain SUMMARY OF THE HDF5 CONFIGURATION\")
|
|
|
|
else ()
|
|
|
|
message (STATUS \"COMMAND Result: \${TEST_RESULT}\")
|
|
|
|
endif ()
|
|
|
|
"
|
|
|
|
)
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
### S W I M M E R T E S T S ###
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
set (H5_SWMR_TESTS
|
|
|
|
swmr_addrem_writer
|
|
|
|
swmr_check_compat_vfd
|
|
|
|
swmr_generator
|
|
|
|
swmr_reader
|
|
|
|
swmr_remove_reader
|
|
|
|
swmr_remove_writer
|
|
|
|
swmr_sparse_reader
|
|
|
|
swmr_sparse_writer
|
|
|
|
swmr_start_write
|
|
|
|
swmr_writer
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach (test ${H5_SWMR_TESTS})
|
|
|
|
ADD_H5_EXE(${test})
|
|
|
|
endforeach ()
|
|
|
|
|
|
|
|
set (H5_VDS_SWMR_TESTS
|
|
|
|
vds_swmr_gen
|
|
|
|
vds_swmr_reader
|
|
|
|
vds_swmr_writer
|
|
|
|
)
|
|
|
|
|
|
|
|
foreach (test ${H5_VDS_SWMR_TESTS})
|
|
|
|
ADD_H5_EXE(${test})
|
|
|
|
endforeach ()
|
|
|
|
|
2016-12-18 16:58:46 +08:00
|
|
|
#-- Adding test for accum_swmr_reader
|
|
|
|
# This has to be copied to the test directory for execve() to find it
|
|
|
|
# and it can't be renamed (i.e., no <foo>-shared).
|
|
|
|
add_executable (accum_swmr_reader ${HDF5_TEST_SOURCE_DIR}/accum_swmr_reader.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(accum_swmr_reader PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (accum_swmr_reader STATIC)
|
|
|
|
target_link_libraries (accum_swmr_reader PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2016-12-18 16:58:46 +08:00
|
|
|
set_target_properties (accum_swmr_reader PROPERTIES FOLDER test)
|
|
|
|
|
|
|
|
#-- Set accum dependencies
|
|
|
|
set_target_properties (accum PROPERTIES DEPENDS accum_swmr_reader)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
set_target_properties (accum-shared PROPERTIES DEPENDS accum_swmr_reader)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2016-12-18 16:58:46 +08:00
|
|
|
|
2013-08-23 02:41:25 +08:00
|
|
|
##############################################################################
|
|
|
|
### P L U G I N T E S T S
|
|
|
|
##############################################################################
|
2014-03-12 05:14:57 +08:00
|
|
|
if (BUILD_SHARED_LIBS)
|
2017-11-09 09:52:44 +08:00
|
|
|
add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (filter_plugin SHARED)
|
|
|
|
target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET})
|
2017-11-09 09:52:44 +08:00
|
|
|
set_target_properties (filter_plugin PROPERTIES FOLDER test)
|
2017-01-11 07:09:53 +08:00
|
|
|
else ()
|
2017-11-09 09:52:44 +08:00
|
|
|
add_executable (filter_plugin ${HDF5_TEST_SOURCE_DIR}/filter_plugin.c)
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(filter_plugin PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (filter_plugin STATIC)
|
|
|
|
target_link_libraries (filter_plugin PRIVATE ${HDF5_TEST_LIB_TARGET})
|
2017-11-09 09:52:44 +08:00
|
|
|
set_target_properties (filter_plugin PROPERTIES FOLDER test)
|
2017-01-11 07:09:53 +08:00
|
|
|
endif ()
|
2013-08-23 02:41:25 +08:00
|
|
|
|
2017-01-27 03:34:12 +08:00
|
|
|
##############################################################################
|
|
|
|
### U S E C A S E S T E S T S
|
|
|
|
##############################################################################
|
|
|
|
set (use_append_chunk_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_chunk.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
|
|
|
|
add_executable (use_append_chunk ${use_append_chunk_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_append_chunk PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_append_chunk STATIC)
|
|
|
|
target_link_libraries (use_append_chunk PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_append_chunk PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_executable (use_append_chunk-shared ${use_append_chunk_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_append_chunk-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_append_chunk-shared SHARED)
|
|
|
|
target_link_libraries (use_append_chunk-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_append_chunk-shared PROPERTIES FOLDER test)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set (use_append_mchunks_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_append_mchunks.c ${HDF5_TEST_SOURCE_DIR}/use_common.c)
|
|
|
|
add_executable (use_append_mchunks ${use_append_mchunks_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_append_mchunks PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_append_mchunks STATIC)
|
|
|
|
target_link_libraries (use_append_mchunks PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_append_mchunks PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_executable (use_append_mchunks-shared ${use_append_mchunks_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_append_mchunks-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_append_mchunks-shared SHARED)
|
|
|
|
target_link_libraries (use_append_mchunks-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_append_mchunks-shared PROPERTIES FOLDER test)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
set (use_disable_mdc_flushes_SOURCES ${HDF5_TEST_SOURCE_DIR}/use_disable_mdc_flushes.c)
|
|
|
|
add_executable (use_disable_mdc_flushes ${use_disable_mdc_flushes_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_disable_mdc_flushes PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_disable_mdc_flushes STATIC)
|
|
|
|
target_link_libraries (use_disable_mdc_flushes PRIVATE ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_disable_mdc_flushes PROPERTIES FOLDER test)
|
|
|
|
if (BUILD_SHARED_LIBS)
|
|
|
|
add_executable (use_disable_mdc_flushes-shared ${use_disable_mdc_flushes_SOURCES})
|
2018-05-10 03:29:44 +08:00
|
|
|
target_include_directories(use_disable_mdc_flushes-shared PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>")
|
2018-04-27 05:41:04 +08:00
|
|
|
TARGET_C_PROPERTIES (use_disable_mdc_flushes-shared SHARED)
|
|
|
|
target_link_libraries (use_disable_mdc_flushes-shared PRIVATE ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET})
|
2017-01-27 03:34:12 +08:00
|
|
|
set_target_properties (use_disable_mdc_flushes-shared PROPERTIES FOLDER test)
|
|
|
|
endif ()
|
|
|
|
|
2014-03-12 05:14:57 +08:00
|
|
|
include (CMakeTests.cmake)
|