diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2010-10-27 18:27:05 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2010-10-27 18:27:05 (GMT) |
commit | b6bb53801af97fc7c26491ac6ab44f1837973396 (patch) | |
tree | 82f37c970872f1e709c027125eb1f870dc289699 | |
parent | 68690772e089db36b5ab85fd6e3b090c7c51f07d (diff) | |
download | hdf5-b6bb53801af97fc7c26491ac6ab44f1837973396.zip hdf5-b6bb53801af97fc7c26491ac6ab44f1837973396.tar.gz hdf5-b6bb53801af97fc7c26491ac6ab44f1837973396.tar.bz2 |
[svn-r19677] Added h5mkgrp tests
Added valgrind test variables and increased
Tested: Local linux
-rw-r--r-- | CTestConfig.cmake | 6 | ||||
-rw-r--r-- | config/cmake/runTest.cmake | 7 | ||||
-rw-r--r-- | tools/misc/CMakeLists.txt | 91 |
3 files changed, 103 insertions, 1 deletions
diff --git a/CTestConfig.cmake b/CTestConfig.cmake index c90f9ce..af46c15 100644 --- a/CTestConfig.cmake +++ b/CTestConfig.cmake @@ -13,3 +13,9 @@ set(CTEST_DROP_LOCATION "/cdash/submit.php?project=HDF5.1.8") set(CTEST_DROP_SITE_CDASH TRUE) set(UPDATE_TYPE svn) + +set(VALGRIND_COMMAND "/usr/bin/valgrind") +set(VALGRIND_COMMAND_OPTIONS "--tool=memcheck") +set(CTEST_MEMORYCHECK_COMMAND "/usr/bin/valgrind") +set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "--tool=memcheck") +set(CTEST_TESTING_TIMEOUT 3600) diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index de69217..c9334c1 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -59,11 +59,16 @@ MESSAGE (STATUS "COMMAND Error: ${TEST_ERROR}") IF (TEST_MASK) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - #STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "Storage:[^\n]+\n" "Storage: <details removed for portability>\n" TEST_STREAM "${TEST_STREAM}") FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") ENDIF (TEST_MASK) +IF (TEST_MASK_MOD) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + STRING(REGEX REPLACE "Modified:[^\n]+\n" "Modified: XXXX-XX-XX XX:XX:XX XXX\n" TEST_STREAM "${TEST_STREAM}") + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") +ENDIF (TEST_MASK_MOD) + IF (TEST_FILTER) FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) STRING(REGEX REPLACE "${TEST_FILTER}" "" TEST_STREAM "${TEST_STREAM}") diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index a1e2e49..dd7ed00 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -77,6 +77,16 @@ IF (BUILD_TESTING) family_file00015.h5 family_file00016.h5 family_file00017.h5 + h5mkgrp_help.ls + h5mkgrp_version.ls + h5mkgrp_single.ls + h5mkgrp_single_latest.ls + h5mkgrp_several.ls + h5mkgrp_several_latest.ls + h5mkgrp_nested.ls + h5mkgrp_nested_latest.ls + h5mkgrp_nested_mult.ls + h5mkgrp_nested_mult_latest.ls ) FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) @@ -89,6 +99,31 @@ IF (BUILD_TESTING) ARGS -E copy_if_different ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_file} ${dest} ) ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + + SET (HDF5_MKGRP_TEST_FILES + h5mkgrp_help + h5mkgrp_version + h5mkgrp_single + h5mkgrp_single_latest + h5mkgrp_several + h5mkgrp_several_latest + h5mkgrp_nested + h5mkgrp_nested_latest + h5mkgrp_nested_mult + h5mkgrp_nested_mult_latest + ) + + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/../testfiles") + FOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) + SET (dest "${PROJECT_BINARY_DIR}/${h5_mkgrp_file}") + #MESSAGE (STATUS " Copying ${h5_mkgrp_file}") + ADD_CUSTOM_COMMAND ( + TARGET h5mkgrp + POST_BUILD + COMMAND ${XLATE_UTILITY} + ARGS ${HDF5_TOOLS_SRC_DIR}/testfiles/${h5_mkgrp_file}.ls ${dest}.ls -l3 + ) + ENDFOREACH (h5_mkgrp_file ${HDF5_MKGRP_TEST_FILES}) ############################################################################## ############################################################################## @@ -96,6 +131,40 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + MACRO (ADD_H5_TEST resultfile resultcode resultoption) + ADD_TEST ( + NAME H5MKGRP-clear-${resultfile}${resultoption} + COMMAND ${CMAKE_COMMAND} + -E remove + ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 + ${PROJECT_BINARY_DIR}/${resultfile}.out + ${PROJECT_BINARY_DIR}/${resultfile}.out.err + ) + IF (NOT ${resultoption} STREQUAL " ") + ADD_TEST ( + NAME H5MKGRP-${resultfile}${resultoption} + COMMAND $<TARGET_FILE:h5mkgrp> ${resultoption} ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} + ) + ELSE (NOT ${resultoption} STREQUAL " ") + ADD_TEST ( + NAME H5MKGRP-${resultfile}${resultoption} + COMMAND $<TARGET_FILE:h5mkgrp> ${PROJECT_BINARY_DIR}/../testfiles/${resultfile}.h5 ${ARGN} + ) + ENDIF (NOT ${resultoption} STREQUAL " ") + ADD_TEST ( + NAME H5MKGRP-H5LS-${resultfile}${resultoption} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5ls>" + -D "TEST_ARGS:STRING=-v;-r;../testfiles/${resultfile}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_MASK_MOD=true" + -D "TEST_REFERENCE=${resultfile}.ls" + -P "${HDF5_RESOURCES_DIR}/runTest.cmake" + ) + ENDMACRO (ADD_H5_TEST resultfile resultcode resultoption) + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -141,6 +210,28 @@ IF (BUILD_TESTING) SET (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} h5repart_test ) + + # Check that help & version is displayed properly + ADD_H5_TEST (h5mkgrp_help 1 "-h") + ADD_H5_TEST (h5mkgrp_version 1 "-V") + + # Create single group at root level + ADD_H5_TEST (h5mkgrp_single 0 " " single) + ADD_H5_TEST (h5mkgrp_single 0 "-v" single) + ADD_H5_TEST (h5mkgrp_single 0 "-p" single) + ADD_H5_TEST (h5mkgrp_single_latest 0 "-l" latest) + + # Create several groups at root level + ADD_H5_TEST (h5mkgrp_several 0 " " one two) + ADD_H5_TEST (h5mkgrp_several 0 "-v" one two) + ADD_H5_TEST (h5mkgrp_several 0 "-p" one two) + ADD_H5_TEST (h5mkgrp_several_latest 0 "-l" one two) + + # Create various nested groups + ADD_H5_TEST (h5mkgrp_nested 0 "-p" /one/two) + ADD_H5_TEST (h5mkgrp_nested_latest 0 "-lp" /one/two) + ADD_H5_TEST (h5mkgrp_nested_mult 0 "-p" /one/two /three/four) + ADD_H5_TEST (h5mkgrp_nested_mult_latest 0 "-lp" /one/two /three/four) ENDIF (BUILD_TESTING) ############################################################################## |