diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-11-01 22:10:50 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-11-01 22:10:50 (GMT) |
commit | 2b0d8d59ae24d870f21726912c43aeac64425fde (patch) | |
tree | 7b50941acb0b3e75f225b1b674033399d4d8f73a | |
parent | a960b232c176132ca027e64e1803076b39fc4d3d (diff) | |
download | hdf5-2b0d8d59ae24d870f21726912c43aeac64425fde.zip hdf5-2b0d8d59ae24d870f21726912c43aeac64425fde.tar.gz hdf5-2b0d8d59ae24d870f21726912c43aeac64425fde.tar.bz2 |
[svn-r19706] Added VFD test options.
Bring r19705 from branch
-rw-r--r-- | CMakeLists.txt | 16 | ||||
-rw-r--r-- | c++/test/CMakeLists.txt | 36 | ||||
-rw-r--r-- | config/cmake/vfdTest.cmake | 9 | ||||
-rw-r--r-- | test/CMakeLists.txt | 71 | ||||
-rw-r--r-- | testpar/CMakeLists.txt | 43 | ||||
-rw-r--r-- | tools/h5repack/CMakeLists.txt | 36 |
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 |