diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2015-08-19 20:35:08 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2015-08-19 20:35:08 (GMT) |
commit | 7470e8114d2fa875e84dba619b4c79c093c6f707 (patch) | |
tree | 3e6307091559520cc03a02781df53c24ca252ae0 /test | |
parent | 884dcbc7aa0005dc411bccada2339d38363cb8a6 (diff) | |
download | hdf5-7470e8114d2fa875e84dba619b4c79c093c6f707.zip hdf5-7470e8114d2fa875e84dba619b4c79c093c6f707.tar.gz hdf5-7470e8114d2fa875e84dba619b4c79c093c6f707.tar.bz2 |
[svn-r27532] Merge of CMake dual-binary changes from CMake branch to 1.8
Tested: local linux (CMake branch has been tested on Windows)
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 145 | ||||
-rw-r--r-- | test/CMakeTests.cmake | 476 |
2 files changed, 563 insertions, 58 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c25e9cc..631a7ed 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -26,8 +26,8 @@ set (TEST_LIB_HEADERS ${HDF5_TEST_SOURCE_DIR}/h5test.h ) -add_library (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) -TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} ${LIB_TYPE} " " " ") +add_library (${HDF5_TEST_LIB_TARGET} STATIC ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) +TARGET_C_PROPERTIES (${HDF5_TEST_LIB_TARGET} STATIC " " " ") if (MSVC) target_link_libraries (${HDF5_TEST_LIB_TARGET} "ws2_32.lib") endif (MSVC) @@ -35,16 +35,34 @@ if (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} "wsock32.lib") endif (MINGW) target_link_libraries (${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) -H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} ${LIB_TYPE}) +H5_SET_LIB_OPTIONS (${HDF5_TEST_LIB_TARGET} ${HDF5_TEST_LIB_NAME} STATIC) set_target_properties (${HDF5_TEST_LIB_TARGET} PROPERTIES FOLDER libraries/test INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" ) +if (BUILD_SHARED_LIBS) + add_library (${HDF5_TEST_LIBSH_TARGET} SHARED ${TEST_LIB_SRCS} ${TEST_LIB_HEADERS}) + TARGET_C_PROPERTIES (${HDF5_TEST_LIBSH_TARGET} SHARED " " " ") + if (MSVC) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "ws2_32.lib") + endif (MSVC) + if (MINGW) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} "wsock32.lib") + endif (MINGW) + target_link_libraries (${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + H5_SET_LIB_OPTIONS (${HDF5_TEST_LIBSH_TARGET} ${HDF5_TEST_LIB_NAME} SHARED) + set_target_properties (${HDF5_TEST_LIBSH_TARGET} PROPERTIES + FOLDER libraries/test + COMPILE_DEFINITIONS "H5_BUILT_AS_DYNAMIC_LIB" + INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>" + INTERFACE_COMPILE_DEFINITIONS H5_BUILT_AS_DYNAMIC_LIB=1 + ) +endif (BUILD_SHARED_LIBS) + #----------------------------------------------------------------------------- # If plugin library tests can be tested #----------------------------------------------------------------------------- -if (BUILD_SHARED_LIBS) # make plugins dir file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir1") file (MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/testdir2") @@ -67,12 +85,12 @@ if (BUILD_SHARED_LIBS) add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} " " " ") + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - ${LIB_TYPE} + SHARED HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) @@ -85,7 +103,7 @@ if (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir1/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) @@ -98,12 +116,12 @@ if (BUILD_SHARED_LIBS) add_definitions (${HDF_EXTRA_C_FLAGS}) INCLUDE_DIRECTORIES (${HDF5_SRC_DIR}) - add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) - TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} ${LIB_TYPE} " " " ") + add_library (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED ${HDF5_TEST_SOURCE_DIR}/${test_lib}.c) + TARGET_C_PROPERTIES (${HDF5_TEST_PLUGIN_LIB_TARGET} SHARED " " " ") target_link_libraries (${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) H5_SET_LIB_OPTIONS ( ${HDF5_TEST_PLUGIN_LIB_TARGET} ${HDF5_TEST_PLUGIN_LIB_NAME} - ${LIB_TYPE} + SHARED HDF5_TEST_PLUGIN_LIB_NAME_RELEASE HDF5_TEST_PLUGIN_LIB_NAME_DEBUG ) @@ -116,12 +134,11 @@ if (BUILD_SHARED_LIBS) TARGET ${HDF5_TEST_PLUGIN_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different + ARGS -E copy_if_different "$<TARGET_FILE:${HDF5_TEST_PLUGIN_LIB_TARGET}>" "${CMAKE_BINARY_DIR}/testdir2/$<TARGET_FILE_NAME:${HDF5_TEST_PLUGIN_LIB_TARGET}>" ) endforeach (test_lib ${TEST2_PLUGIN_LIBS}) -endif (BUILD_SHARED_LIBS) set (testhdf5_SRCS ${HDF5_TEST_SOURCE_DIR}/testhdf5.c @@ -153,17 +170,31 @@ set (testhdf5_SRCS #-- Adding test for testhdf5 add_executable (testhdf5 ${testhdf5_SRCS}) -TARGET_NAMING (testhdf5 ${LIB_TYPE}) -TARGET_C_PROPERTIES (testhdf5 ${LIB_TYPE} " " " ") +TARGET_NAMING (testhdf5 STATIC) +TARGET_C_PROPERTIES (testhdf5 STATIC " " " ") target_link_libraries (testhdf5 ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (testhdf5 PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (testhdf5-shared ${testhdf5_SRCS}) + TARGET_NAMING (testhdf5-shared SHARED) + TARGET_C_PROPERTIES (testhdf5-shared SHARED " " " ") + target_link_libraries (testhdf5-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (testhdf5-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) MACRO (ADD_H5_EXE file) add_executable (${file} ${HDF5_TEST_SOURCE_DIR}/${file}.c) - TARGET_NAMING (${file} ${LIB_TYPE}) - TARGET_C_PROPERTIES (${file} ${LIB_TYPE} " " " ") + TARGET_NAMING (${file} STATIC) + TARGET_C_PROPERTIES (${file} STATIC " " " ") target_link_libraries (${file} ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (${file} PROPERTIES FOLDER test) + if (BUILD_SHARED_LIBS) + add_executable (${file}-shared ${HDF5_TEST_SOURCE_DIR}/${file}.c) + TARGET_NAMING (${file}-shared SHARED) + TARGET_C_PROPERTIES (${file}-shared SHARED " " " ") + target_link_libraries (${file}-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (${file}-shared PROPERTIES FOLDER test) + endif (BUILD_SHARED_LIBS) ENDMACRO (ADD_H5_EXE file) set (H5_TESTS @@ -231,17 +262,31 @@ endforeach (test ${H5_TESTS}) #-- Adding test for cache add_executable (cache ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -TARGET_NAMING (cache ${LIB_TYPE}) -TARGET_C_PROPERTIES (cache ${LIB_TYPE} " " " ") +TARGET_NAMING (cache STATIC) +TARGET_C_PROPERTIES (cache STATIC " " " ") target_link_libraries (cache ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (cache-shared ${HDF5_TEST_SOURCE_DIR}/cache.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) + TARGET_NAMING (cache-shared SHARED) + TARGET_C_PROPERTIES (cache-shared SHARED " " " ") + target_link_libraries (cache-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (cache-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) #-- Adding test for cache_api add_executable (cache_api ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) -TARGET_NAMING (cache_api ${LIB_TYPE}) -TARGET_C_PROPERTIES (cache_api ${LIB_TYPE} " " " ") +TARGET_NAMING (cache_api STATIC) +TARGET_C_PROPERTIES (cache_api STATIC " " " ") target_link_libraries (cache_api ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (cache_api PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (cache_api-shared ${HDF5_TEST_SOURCE_DIR}/cache_api.c ${HDF5_TEST_SOURCE_DIR}/cache_common.c) + TARGET_NAMING (cache_api-shared SHARED) + TARGET_C_PROPERTIES (cache_api-shared SHARED " " " ") + target_link_libraries (cache_api-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (cache_api-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) #-- Adding test for ttsafe add_executable (ttsafe @@ -251,37 +296,71 @@ add_executable (ttsafe ${HDF5_TEST_SOURCE_DIR}/ttsafe_cancel.c ${HDF5_TEST_SOURCE_DIR}/ttsafe_acreate.c ) -TARGET_NAMING (ttsafe ${LIB_TYPE}) -TARGET_C_PROPERTIES (ttsafe ${LIB_TYPE} " " " ") +TARGET_NAMING (ttsafe STATIC) +TARGET_C_PROPERTIES (ttsafe STATIC " " " ") target_link_libraries (ttsafe ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (ttsafe PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (ttsafe-shared + ${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 + ) + TARGET_NAMING (ttsafe-shared SHARED) + TARGET_C_PROPERTIES (ttsafe-shared SHARED " " " ") + target_link_libraries (ttsafe-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (ttsafe-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) #-- Adding test for err_compat if (HDF5_ENABLE_DEPRECATED_SYMBOLS) add_executable (err_compat ${HDF5_TEST_SOURCE_DIR}/err_compat.c) - TARGET_NAMING (err_compat ${LIB_TYPE}) - TARGET_C_PROPERTIES (err_compat ${LIB_TYPE} " " " ") + TARGET_NAMING (err_compat STATIC) + TARGET_C_PROPERTIES (err_compat STATIC " " " ") target_link_libraries (err_compat ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (err_compat PROPERTIES FOLDER test) + if (BUILD_SHARED_LIBS) + add_executable (err_compat-shared ${HDF5_TEST_SOURCE_DIR}/err_compat.c) + TARGET_NAMING (err_compat-shared SHARED) + TARGET_C_PROPERTIES (err_compat-shared SHARED " " " ") + target_link_libraries (err_compat-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (err_compat-shared PROPERTIES FOLDER test) + endif (BUILD_SHARED_LIBS) endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) #-- Adding test for error_test add_executable (error_test ${HDF5_TEST_SOURCE_DIR}/error_test.c) -TARGET_NAMING (error_test ${LIB_TYPE}) -TARGET_C_PROPERTIES (error_test ${LIB_TYPE} " " " ") +TARGET_NAMING (error_test STATIC) +TARGET_C_PROPERTIES (error_test STATIC " " " ") target_link_libraries (error_test ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (error_test PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (error_test-shared ${HDF5_TEST_SOURCE_DIR}/error_test.c) + TARGET_NAMING (error_test-shared SHARED) + TARGET_C_PROPERTIES (error_test-shared SHARED " " " ") + target_link_libraries (error_test-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (error_test-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) #-- Adding test for links_env add_executable (links_env ${HDF5_TEST_SOURCE_DIR}/links_env.c) -TARGET_NAMING (links_env ${LIB_TYPE}) -TARGET_C_PROPERTIES (links_env ${LIB_TYPE} " " " ") +TARGET_NAMING (links_env STATIC) +TARGET_C_PROPERTIES (links_env STATIC " " " ") target_link_libraries (links_env ${HDF5_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) set_target_properties (links_env PROPERTIES FOLDER test) +if (BUILD_SHARED_LIBS) + add_executable (links_env-shared ${HDF5_TEST_SOURCE_DIR}/links_env.c) + TARGET_NAMING (links_env-shared SHARED) + TARGET_C_PROPERTIES (links_env-shared SHARED " " " ") + target_link_libraries (links_env-shared ${HDF5_TEST_LIBSH_TARGET} ${HDF5_LIBSH_TARGET}) + set_target_properties (links_env-shared PROPERTIES FOLDER test) +endif (BUILD_SHARED_LIBS) #-- Adding test for libinfo set (GREP_RUNNER ${PROJECT_BINARY_DIR}/GrepRunner.cmake) -file (WRITE ${GREP_RUNNER} +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\") @@ -300,6 +379,12 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (plugin SHARED " " " ") target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) set_target_properties (plugin PROPERTIES FOLDER test) +else (BUILD_SHARED_LIBS) + add_executable (plugin ${HDF5_TEST_SOURCE_DIR}/plugin.c) + TARGET_NAMING (plugin STATIC) + TARGET_C_PROPERTIES (plugin STATIC " " " ") + target_link_libraries (plugin ${HDF5_TEST_PLUGIN_LIB_TARGET}) + set_target_properties (plugin PROPERTIES FOLDER test) endif (BUILD_SHARED_LIBS) include (CMakeTests.cmake) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index c1f6f37..0cd5203 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -9,6 +9,12 @@ file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles") file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST/testfiles/plist_files") +if (BUILD_SHARED_LIBS) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles") + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5TEST-shared/testfiles/plist_files") +endif (BUILD_SHARED_LIBS) + if (HDF5_TEST_VFD) set (VFD_LIST sec2 @@ -23,6 +29,9 @@ if (HDF5_TEST_VFD) endif (DIRECT_VFD) foreach (vfdtest ${VFD_LIST}) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}") + #if (BUILD_SHARED_LIBS) + # file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdtest}-shared") + #endif (BUILD_SHARED_LIBS) endforeach (vfdtest ${VFD_LIST}) endif (HDF5_TEST_VFD) @@ -35,25 +44,41 @@ set (HDF5_TEST_FILES foreach (h5_tfile ${HDF5_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/H5TEST/${h5_tfile}") - #message (STATUS " Copying ${h5_tfile}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${PROJECT_BINARY_DIR}/H5TEST-shared/${h5_tfile}") + add_custom_command ( + TARGET ${HDF5_TEST_LIBSH_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (h5_tfile ${HDF5_TEST_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_tfile ${HDF5_TEST_FILES}) set (dest "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}") - #message (STATUS " Copying ${h5_tfile}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${h5_tfile}") + add_custom_command ( + TARGET ${HDF5_TEST_LIBSH_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_tfile} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (h5_tfile ${HDF5_TEST_FILES}) endforeach (vfdtest ${VFD_LIST}) endif (HDF5_TEST_VFD) @@ -71,25 +96,41 @@ set (HDF5_REFERENCE_FILES foreach (ref_file ${HDF5_REFERENCE_FILES}) set (dest "${PROJECT_BINARY_DIR}/H5TEST/${ref_file}") - #message (STATUS " Copying ${h5_file}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${PROJECT_BINARY_DIR}/H5TEST-shared/${ref_file}") + add_custom_command ( + TARGET ${HDF5_TEST_LIBSH_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (ref_file ${HDF5_REFERENCE_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (ref_file ${HDF5_REFERENCE_FILES}) set (dest "${PROJECT_BINARY_DIR}/${vfdtest}/${ref_file}") - #message (STATUS " Copying ${h5_file}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${PROJECT_BINARY_DIR}/${vfdtest}-shared/${ref_file}") + add_custom_command ( + TARGET ${HDF5_TEST_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/testfiles/${ref_file} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (ref_file ${HDF5_REFERENCE_FILES}) endforeach (vfdtest ${VFD_LIST}) endif (HDF5_TEST_VFD) @@ -135,25 +176,41 @@ set (HDF5_REFERENCE_TEST_FILES foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) set (dest "${HDF5_TEST_BINARY_DIR}/H5TEST/${h5_file}") - #message (STATUS " Copying ${h5_file} to ${dest}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${HDF5_TEST_BINARY_DIR}/H5TEST-shared/${h5_file}") + add_custom_command ( + TARGET ${HDF5_TEST_LIBSH_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) if (HDF5_TEST_VFD) foreach (vfdtest ${VFD_LIST}) foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) set (dest "${HDF5_TEST_BINARY_DIR}/${vfdtest}/${h5_file}") - #message (STATUS " Copying ${h5_file} to ${dest}") add_custom_command ( TARGET ${HDF5_TEST_LIB_TARGET} POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} ) + if (BUILD_SHARED_LIBS) + set (dest "${HDF5_TEST_BINARY_DIR}/${vfdtest}-shared/${h5_file}") + add_custom_command ( + TARGET ${HDF5_TEST_LIB_TARGET} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + ARGS -E copy_if_different ${HDF5_TEST_SOURCE_DIR}/${h5_file} ${dest} + ) + endif (BUILD_SHARED_LIBS) endforeach (h5_file ${HDF5_REFERENCE_TEST_FILES}) endforeach (vfdtest ${VFD_LIST}) endif (HDF5_TEST_VFD) @@ -162,7 +219,7 @@ endif (HDF5_TEST_VFD) add_test ( NAME H5TEST-clear-testhdf5-objects COMMAND ${CMAKE_COMMAND} - -E remove + -E remove coord.h5 dtypes10.h5 sys_file1 @@ -216,6 +273,38 @@ else (HDF5_ENABLE_USING_MEMCHECKER) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME H5TEST-shared-clear-testhdf5-objects + COMMAND ${CMAKE_COMMAND} + -E remove + coord.h5 + dtypes10.h5 + sys_file1 + tattr.h5 + tfile1.h5 + tfile2.h5 + tfile3.h5 + tfile4.h5 + tfile5.h5 + tfile6.h5 + tfile7.h5 + th5o_file + th5s1.h5 + tselect.h5 + tsohm.h5 + tsohm_dst.h5 + tsohm_src.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-testhdf5 COMMAND $<TARGET_FILE:testhdf5-shared>) + set_tests_properties (H5TEST-shared-testhdf5 PROPERTIES + DEPENDS H5TEST-shared-clear-testhdf5-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif (BUILD_SHARED_LIBS) endif (HDF5_ENABLE_USING_MEMCHECKER) ############################################################################## @@ -313,6 +402,97 @@ set_tests_properties (H5TEST-fheap PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-testmeta PROPERTIES TIMEOUT 1800) set_tests_properties (H5TEST-big PROPERTIES TIMEOUT 1800) +if (BUILD_SHARED_LIBS) + # Remove any output file left over from previous test run + add_test ( + NAME H5TEST-shared-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + dt_arith1.h5 + dt_arith2.h5 + dtransform.h5 + dtypes3.h5 + dtypes4.h5 + dtypes5.h5 + efc0.h5 + efc1.h5 + efc2.h5 + efc3.h5 + efc4.h5 + efc5.h5 + extlinks16A00000.h5 + extlinks16A00001.h5 + extlinks16A00002.h5 + extlinks16B-b.h5 + extlinks16B-g.h5 + extlinks16B-l.h5 + extlinks16B-r.h5 + extlinks16B-s.h5 + extlinks19B00000.h5 + extlinks19B00001.h5 + extlinks19B00002.h5 + extlinks19B00003.h5 + extlinks19B00004.h5 + extlinks19B00005.h5 + extlinks19B00006.h5 + extlinks19B00007.h5 + extlinks19B00008.h5 + extlinks19B00009.h5 + extlinks19B00010.h5 + extlinks19B00011.h5 + extlinks19B00012.h5 + extlinks19B00013.h5 + extlinks19B00014.h5 + extlinks19B00015.h5 + extlinks19B00016.h5 + extlinks19B00017.h5 + extlinks19B00018.h5 + extlinks19B00019.h5 + extlinks19B00020.h5 + extlinks19B00021.h5 + extlinks19B00022.h5 + extlinks19B00023.h5 + extlinks19B00024.h5 + extlinks19B00025.h5 + extlinks19B00026.h5 + extlinks19B00027.h5 + extlinks19B00028.h5 + fheap.h5 + log_vfd_out.log + new_multi_file_v16-r.h5 + new_multi_file_v16-s.h5 + objcopy_ext.dat + testmeta.h5 + tstint1.h5 + tstint2.h5 + unregister_filter_1.h5 + unregister_filter_2.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + + foreach (test ${H5_TESTS}) + if (${test} STREQUAL "big" AND CYGWIN) + add_test ( + NAME H5TEST-shared-${test} + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared" + ) + else (${test} STREQUAL "big" AND CYGWIN) + add_test (NAME H5TEST-shared-${test} COMMAND $<TARGET_FILE:${test}-shared>) + endif (${test} STREQUAL "big" AND CYGWIN) + set_tests_properties (H5TEST-shared-${test} PROPERTIES + DEPENDS H5TEST-shared-clear-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endforeach (test ${H5_TESTS}) + + set_tests_properties (H5TEST-shared-flush2 PROPERTIES DEPENDS H5TEST-shared-flush1) + set_tests_properties (H5TEST-shared-fheap PROPERTIES TIMEOUT 1800) + set_tests_properties (H5TEST-shared-testmeta PROPERTIES TIMEOUT 1800) + set_tests_properties (H5TEST-shared-big PROPERTIES TIMEOUT 1800) +endif (BUILD_SHARED_LIBS) + ############################################################################## ############################################################################## ### A D D I T I O N A L T E S T S ### @@ -462,31 +642,169 @@ add_test ( ${HDF5_TEST_BINARY_DIR}/H5TEST ) -############################################################################## -### P L U G I N T E S T S -############################################################################## if (BUILD_SHARED_LIBS) + #-- Adding test for cache + if (NOT CYGWIN) + add_test ( + NAME H5TEST-shared-clear-cache-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_test.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-cache COMMAND $<TARGET_FILE:cache-shared>) + set_tests_properties (H5TEST-shared-cache PROPERTIES + DEPENDS H5TEST-shared-clear-cache-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif (NOT CYGWIN) + + #-- Adding test for cache_api + add_test ( + NAME H5TEST-shared-clear-cache_api-objects + COMMAND ${CMAKE_COMMAND} + -E remove + cache_api_test.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-cache_api COMMAND $<TARGET_FILE:cache_api-shared>) + set_tests_properties (H5TEST-shared-cache_api PROPERTIES + DEPENDS H5TEST-shared-clear-cache_api-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) - if (WIN32) - set (CMAKE_SEP "\;") - else (WIN32) - set (CMAKE_SEP ":") - endif (WIN32) + #-- Adding test for ttsafe + add_test ( + NAME H5TEST-shared-clear-ttsafe-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ttsafe_error.h5 + ttsafe_dcreate.h5 + ttsafe_cancel.h5 + ttsafe_acreate.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-ttsafe COMMAND $<TARGET_FILE:ttsafe-shared>) + set_tests_properties (H5TEST-shared-ttsafe PROPERTIES + DEPENDS H5TEST-shared-clear-ttsafe-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + + #-- Adding test for err_compat + if (HDF5_ENABLE_DEPRECATED_SYMBOLS) + add_test ( + NAME H5TEST-shared-clear-err_compat-objects + COMMAND ${CMAKE_COMMAND} + -E remove + err_compat.txt + err_compat.txt.err + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-err_compat COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:err_compat-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=err_compat.txt" + -D "TEST_REFERENCE=err_compat_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-err_compat PROPERTIES + DEPENDS H5TEST-shared-clear-err_compat-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + endif (HDF5_ENABLE_DEPRECATED_SYMBOLS) + + #-- Adding test for error_test + add_test ( + NAME H5TEST-shared-clear-error_test-objects + COMMAND ${CMAKE_COMMAND} + -E remove + error_test.txt + error_test.txt.err + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-error_test COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:error_test-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_EXPECT=0" + -D "TEST_MASK_ERROR=true" + -D "TEST_OUTPUT=error_test.txt" + -D "TEST_REFERENCE=error_test_1" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-error_test PROPERTIES + DEPENDS H5TEST-shared-clear-error_test-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared;HDF5_PLUGIN_PRELOAD=::" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) - add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) - set_tests_properties (H5PLUGIN-plugin PROPERTIES - ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" - WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} + #-- Adding test for links_env + add_test ( + NAME H5TEST-shared-clear-links_env-objects + COMMAND ${CMAKE_COMMAND} + -E remove + links_env.txt + links_env.txt.err + extlinks_env0.h5 + extlinks_env1.h5 + tmp/extlinks_env1.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared + ) + add_test (NAME H5TEST-shared-links_env COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:links_env-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_ENV_VAR:STRING=HDF5_EXT_PREFIX" + -D "TEST_ENV_VALUE:STRING=.:tmp" + -D "TEST_EXPECT=0" + -D "TEST_OUTPUT=links_env.txt" + -D "TEST_REFERENCE=links_env.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5TEST-shared" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5TEST-shared-links_env PROPERTIES + DEPENDS H5TEST-shared-clear-links_env-objects + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) -else (BUILD_SHARED_LIBS) - message (STATUS " **** Plugins libraries must be built as shared libraries **** ") + + #-- Adding test for libinfo add_test ( - NAME H5PLUGIN-SKIPPED - COMMAND ${CMAKE_COMMAND} -E echo "SKIP H5PLUGIN TESTING" + NAME H5TEST-shared-testlibinfo + COMMAND ${CMAKE_COMMAND} -D "TEST_PROGRAM=$<TARGET_FILE:${HDF5_LIBSH_TARGET}>" -P "${GREP_RUNNER}" + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST-shared ) endif (BUILD_SHARED_LIBS) ############################################################################## +### P L U G I N T E S T S +############################################################################## +if (WIN32) + set (CMAKE_SEP "\;") +else (WIN32) + set (CMAKE_SEP ":") +endif (WIN32) + +add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>) +set_tests_properties (H5PLUGIN-plugin PROPERTIES + ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir1${CMAKE_SEP}${CMAKE_BINARY_DIR}/testdir2;srcdir=${HDF5_TEST_BINARY_DIR}" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR} +) + +############################################################################## ############################################################################## ### V F D T E S T S ### ############################################################################## @@ -561,7 +879,7 @@ if (HDF5_TEST_VFD) -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdtest}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) @@ -569,11 +887,34 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif (BUILD_SHARED_LIBS) else (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) add_test ( NAME VFD-${vfdname}-${vfdtest} COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}" ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-${test}-shared + COMMAND ${CMAKE_COMMAND} -E echo "SKIP VFD-${vfdname}-${vfdtest}-shared" + ) + endif (BUILD_SHARED_LIBS) endif(NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug) else (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") add_test ( @@ -583,7 +924,7 @@ if (HDF5_TEST_VFD) -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdtest}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) @@ -591,6 +932,23 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif (BUILD_SHARED_LIBS) endif (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split") else (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") add_test ( @@ -600,7 +958,7 @@ if (HDF5_TEST_VFD) -D "TEST_ARGS:STRING=" -D "TEST_VFD:STRING=${vfdname}" -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=${vfdtest}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) @@ -608,6 +966,23 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-${vfdtest}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${vfdtest}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${vfdtest}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif (BUILD_SHARED_LIBS) endif (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2") ENDMACRO (CHECK_VFD_TEST vfdtest vfdname resultcode) @@ -631,14 +1006,41 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-${test}-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:${test}-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-${test}-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-${test}-shared PROPERTIES + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif (BUILD_SHARED_LIBS) endif (WIN32) endforeach (test ${H5_VFD_TESTS}) set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES DEPENDS VFD-${vfdname}-flush1) set_tests_properties (VFD-${vfdname}-flush1 PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2 PROPERTIES TIMEOUT 10) set_tests_properties (VFD-${vfdname}-objcopy PROPERTIES TIMEOUT 1000) set_tests_properties (VFD-${vfdname}-testhdf5 PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-gheap PROPERTIES TIMEOUT 1200) set_tests_properties (VFD-${vfdname}-istore PROPERTIES TIMEOUT 1200) + if (BUILD_SHARED_LIBS) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES DEPENDS VFD-${vfdname}-flush1-shared) + set_tests_properties (VFD-${vfdname}-flush1-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-flush2-shared PROPERTIES TIMEOUT 10) + set_tests_properties (VFD-${vfdname}-objcopy-shared PROPERTIES TIMEOUT 1000) + set_tests_properties (VFD-${vfdname}-testhdf5-shared PROPERTIES TIMEOUT 1200) + set_tests_properties (VFD-${vfdname}-gheap-shared PROPERTIES TIMEOUT 1200) + set_tests_properties (VFD-${vfdname}-istore-shared PROPERTIES TIMEOUT 1200) + endif (BUILD_SHARED_LIBS) if (HDF5_TEST_FHEAP_VFD) add_test ( NAME VFD-${vfdname}-fheap @@ -656,6 +1058,24 @@ if (HDF5_TEST_VFD) ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname} ) + if (BUILD_SHARED_LIBS) + add_test ( + NAME VFD-${vfdname}-fheap-shared + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:fheap-shared>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-fheap-shared" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}-shared" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (VFD-${vfdname}-fheap-shared PROPERTIES + TIMEOUT 1800 + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname}-shared" + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}-shared + ) + endif (BUILD_SHARED_LIBS) endif (HDF5_TEST_FHEAP_VFD) ENDMACRO (ADD_VFD_TEST) @@ -672,7 +1092,7 @@ endif (HDF5_TEST_VFD) ############################################################################## ############################################################################## -if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +if (HDF5_BUILD_GENERATORS) MACRO (ADD_H5_GENERATOR genfile) add_executable (${genfile} ${HDF5_TEST_SOURCE_DIR}/${genfile}.c) TARGET_NAMING (${genfile} STATIC) @@ -708,4 +1128,4 @@ if (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) ADD_H5_GENERATOR (${gen}) endforeach (gen ${H5_GENERATORS}) -endif (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) +endif (HDF5_BUILD_GENERATORS) |