From 2c15a7701912e07ccf1766db85fe6b4ee4f44432 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 1 Nov 2010 17:00:03 -0500 Subject: [svn-r19705] Added VFD test options. Tested: local linux --- CMakeLists.txt | 8 +++++ c++/test/CMakeLists.txt | 36 +++++++++++++++++++++++ config/cmake/vfdTest.cmake | 9 ++++++ test/CMakeLists.txt | 68 +++++++++++++++++++++++++++++++++++++++++-- testpar/CMakeLists.txt | 43 +++++++++++++++++++++++++++ tools/h5repack/CMakeLists.txt | 36 +++++++++++++++++++++++ 6 files changed, 198 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e86307..30ffccf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -711,6 +711,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 $) + +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=$" + -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 ab8ebd0..59f81e1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -336,13 +336,63 @@ IF (HDF5_TEST_VFD) multi family ) + + SET (H5_VFD_TESTS + testhdf5 + accum + lheap + ohdr + stab + gheap + cache + cache_api + pool + hyperslab + istore + bittests + dt_arith + dtypes + dsets + 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 + 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}" @@ -350,10 +400,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=$" + -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=$" + -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 67afff0..1e2d991 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 $) + + 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=$" + -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 -- cgit v0.12