summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
-rw-r--r--c++/test/CMakeLists.txt36
-rw-r--r--config/cmake/vfdTest.cmake9
-rw-r--r--test/CMakeLists.txt71
-rw-r--r--testpar/CMakeLists.txt43
-rw-r--r--tools/h5repack/CMakeLists.txt36
6 files changed, 204 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e4ae935..14633ed 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -668,12 +668,12 @@ ENDIF (HDF5_USE_H5DUMP_PACKED_BITS)
ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/src ${PROJECT_BINARY_DIR}/src)
IF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
- IF (ZLIB_FOUND)
+ IF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
ADD_DEPENDENCIES (${HDF5_LIB_TARGET} ZLIB)
- ENDIF (ZLIB_FOUND)
- IF (SZIP_FOUND)
+ ENDIF (ZLIB_FOUND AND ZLIB_USE_EXTERNAL)
+ IF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
ADD_DEPENDENCIES (${HDF5_LIB_TARGET} SZIP)
- ENDIF (SZIP_FOUND)
+ ENDIF (SZIP_FOUND AND SZIP_USE_EXTERNAL)
ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN")
#-----------------------------------------------------------------------------
@@ -709,6 +709,14 @@ IF (BUILD_TESTING)
ENDIF (EXISTS "${HDF5_SOURCE_DIR}/testpar" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/testpar")
ENDIF (H5_HAVE_PARALLEL)
ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED)
+
+ OPTION (HDF5_TEST_VFD "Execute tests with different VFDs" OFF)
+ MARK_AS_ADVANCED (HDF5_TEST_VFD)
+ IF (HDF5_TEST_VFD)
+ OPTION (HDF5_TEST_FHEAP_VFD "Execute tests with different VFDs" ON)
+ MARK_AS_ADVANCED (HDF5_TEST_FHEAP_VFD)
+ ENDIF (HDF5_TEST_VFD)
+
INCLUDE (${HDF5_SOURCE_DIR}/CTestConfig.cmake)
CONFIGURE_FILE (${HDF5_RESOURCES_DIR}/CTestCustom.cmake ${HDF5_BINARY_DIR}/CTestCustom.ctest @ONLY)
ENDIF (BUILD_TESTING)
diff --git a/c++/test/CMakeLists.txt b/c++/test/CMakeLists.txt
index e29963e..569e609 100644
--- a/c++/test/CMakeLists.txt
+++ b/c++/test/CMakeLists.txt
@@ -45,3 +45,39 @@ TARGET_LINK_LIBRARIES (cpp_testhdf5
)
ADD_TEST (NAME cpp_testhdf5 COMMAND $<TARGET_FILE:cpp_testhdf5>)
+
+IF (HDF5_TEST_VFD)
+
+ SET (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+ )
+
+ IF (DIRECT_VFD)
+ SET (VFD_LIST ${VFD_LIST} direct)
+ ENDIF (DIRECT_VFD)
+
+ MACRO (ADD_VFD_TEST vfdname resultcode)
+ ADD_TEST (
+ NAME VFD-${vfdname}-cpp_testhdf5
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:cpp_testhdf5>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=cpp_testhdf5"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ ENDMACRO (ADD_VFD_TEST)
+
+ # Run test with different Virtual File Driver
+ FOREACH (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+ ENDFOREACH (vfd ${VFD_LIST})
+
+ENDIF (HDF5_TEST_VFD)
diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake
index c0b5fec..2e854fb 100644
--- a/config/cmake/vfdTest.cmake
+++ b/config/cmake/vfdTest.cmake
@@ -18,6 +18,8 @@ IF (NOT TEST_VFD)
MESSAGE (FATAL_ERROR "Require TEST_VFD to be defined")
ENDIF (NOT TEST_VFD)
+SET (ERROR_APPEND 1)
+
MESSAGE (STATUS "USING ${TEST_VFD} ON COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
SET (ENV{HDF5_DRIVER} "${TEST_VFD}")
@@ -25,12 +27,19 @@ SET (ENV{HDF5_DRIVER} "${TEST_VFD}")
EXECUTE_PROCESS (
COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
+ OUTPUT_FILE ${TEST_OUTPUT}_${TEST_VFD}.out
+ ERROR_FILE ${TEST_OUTPUT}_${TEST_VFD}.err
OUTPUT_VARIABLE TEST_ERROR
ERROR_VARIABLE TEST_ERROR
)
MESSAGE (STATUS "COMMAND Result: ${TEST_RESULT}")
+IF (ERROR_APPEND)
+ FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err TEST_STREAM)
+ FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out "${TEST_STREAM}")
+ENDIF (ERROR_APPEND)
+
# if the return value is !=${TEST_EXPECT} bail out
IF (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
MESSAGE ( FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0adc244..0d60993 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -294,7 +294,6 @@ FOREACH (test ${H5_TESTS})
ENDFOREACH (test ${H5_TESTS})
-
##############################################################################
##############################################################################
### A D D I T I O N A L T E S T S ###
@@ -348,13 +347,65 @@ IF (HDF5_TEST_VFD)
multi
family
)
+
+ SET (H5_VFD_TESTS
+ testhdf5
+ accum
+ lheap
+ ohdr
+ stab
+ gheap
+ cache
+ cache_api
+ cache_tagging
+ pool
+ hyperslab
+ istore
+ bittests
+ dt_arith
+ dtypes
+ cmpd_dset
+ filter_fail
+ extend
+ external
+ objcopy
+ links
+ unlink
+ big
+ mtime
+ fillval
+ mount
+ flush1
+ flush2
+ app_ref
+ enum
+ set_extent
+ ttsafe
+ getname
+ vfd
+ ntypes
+ dangle
+ dtransform
+ reserved
+ cross_read
+ freespace
+ mf
+ farray
+ earray
+ btree2
+ #fheap
+ error_test
+ err_compat
+ tcheck_version
+ testmeta
+)
IF (DIRECT_VFD)
SET (VFD_LIST ${VFD_LIST} direct)
ENDIF (DIRECT_VFD)
MACRO (ADD_VFD_TEST vfdname resultcode)
- FOREACH (test ${H5_TESTS})
+ FOREACH (test ${H5_VFD_TESTS})
ADD_TEST (
NAME VFD-${vfdname}-${test}
COMMAND "${CMAKE_COMMAND}"
@@ -362,10 +413,24 @@ IF (HDF5_TEST_VFD)
-D "TEST_ARGS:STRING="
-D "TEST_VFD:STRING=${vfdname}"
-D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${test}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ ENDFOREACH (test ${H5_VFD_TESTS})
+ IF (HDF5_TEST_FHEAP_VFD)
+ ADD_TEST (
+ NAME VFD-${vfdname}-fheap
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:fheap>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=fheap"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
)
- ENDFOREACH (test ${H5_TESTS})
+ ENDIF (HDF5_TEST_FHEAP_VFD)
ENDMACRO (ADD_VFD_TEST)
# Run test with different Virtual File Driver
diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt
index c378506..e019689 100644
--- a/testpar/CMakeLists.txt
+++ b/testpar/CMakeLists.txt
@@ -49,3 +49,46 @@ FOREACH (testp ${H5P_TESTS})
ADD_H5P_TEST(${testp})
ENDFOREACH (testp ${H5P_TESTS})
+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 (DIRECT_VFD)
+
+ MACRO (ADD_VFD_TEST vfdname resultcode)
+ FOREACH (test ${H5P_VFD_TESTS})
+ ADD_TEST (
+ NAME VFD-${vfdname}-${test}
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:${test}>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=${test}"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ ENDFOREACH (test ${H5P_VFD_TESTS})
+ ENDMACRO (ADD_VFD_TEST)
+
+ # Run test with different Virtual File Driver
+ FOREACH (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+ ENDFOREACH (vfd ${VFD_LIST})
+
+ENDIF (HDF5_TEST_VFD)
+
diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt
index 1fbc503..56029fd 100644
--- a/tools/h5repack/CMakeLists.txt
+++ b/tools/h5repack/CMakeLists.txt
@@ -62,6 +62,42 @@ IF (BUILD_TESTING)
TARGET_LINK_LIBRARIES (h5repacktest ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET})
ADD_TEST (NAME h5repacktest COMMAND $<TARGET_FILE:h5repacktest>)
+
+ IF (HDF5_TEST_VFD)
+
+ SET (VFD_LIST
+ sec2
+ stdio
+ core
+ split
+ multi
+ family
+ )
+
+ IF (DIRECT_VFD)
+ SET (VFD_LIST ${VFD_LIST} direct)
+ ENDIF (DIRECT_VFD)
+
+ MACRO (ADD_VFD_TEST vfdname resultcode)
+ ADD_TEST (
+ NAME VFD-${vfdname}-h5repacktest
+ COMMAND "${CMAKE_COMMAND}"
+ -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>"
+ -D "TEST_ARGS:STRING="
+ -D "TEST_VFD:STRING=${vfdname}"
+ -D "TEST_EXPECT=${resultcode}"
+ -D "TEST_OUTPUT=h5repacktest"
+ -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
+ -P "${HDF5_RESOURCES_DIR}/vfdTest.cmake"
+ )
+ ENDMACRO (ADD_VFD_TEST)
+
+ # Run test with different Virtual File Driver
+ FOREACH (vfd ${VFD_LIST})
+ ADD_VFD_TEST (${vfd} 0)
+ ENDFOREACH (vfd ${VFD_LIST})
+
+ ENDIF (HDF5_TEST_VFD)
# --------------------------------------------------------------------
# Copy all the HDF5 files from the test directory into the source directory