diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-07-13 15:18:27 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-07-13 15:18:27 (GMT) |
commit | d9ba5c234c9971b67f6922ee85cabb638fc0e186 (patch) | |
tree | 17b1b5e613731058809663ee0fd00d0a0771106d /config | |
parent | 5096b7d3ec1047e234049f351b111ef62deb6030 (diff) | |
download | hdf5-d9ba5c234c9971b67f6922ee85cabb638fc0e186.zip hdf5-d9ba5c234c9971b67f6922ee85cabb638fc0e186.tar.gz hdf5-d9ba5c234c9971b67f6922ee85cabb638fc0e186.tar.bz2 |
[svn-r22571] HDFFV-7784,-8095,7936 merge from trunk
Tested: local linux with cmake
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/runTest.cmake | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 139819f..4738523 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -24,7 +24,9 @@ IF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) MESSAGE (FATAL_ERROR "Require TEST_REFERENCE to be defined") ENDIF (NOT TEST_SKIP_COMPARE AND NOT TEST_REFERENCE) -SET (ERROR_APPEND 1) +IF (NOT TEST_ERRREF) + SET (ERROR_APPEND 1) +ENDIF (NOT TEST_ERRREF) MESSAGE (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}") @@ -74,7 +76,11 @@ IF (TEST_MASK_MOD) ENDIF (TEST_MASK_MOD) IF (TEST_MASK_ERROR) - FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + IF (NOT TEST_ERRREF) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + ELSE (NOT TEST_ERRREF) + FILE (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) + ENDIF (NOT TEST_ERRREF) STRING(REGEX REPLACE "thread [0-9]*:" "thread (IDs):" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE ": ([^\n]*)[.]c " ": (file name) " TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE " line [0-9]*" " line (number)" TEST_STREAM "${TEST_STREAM}") @@ -82,7 +88,11 @@ IF (TEST_MASK_ERROR) STRING(REGEX REPLACE "[1-9]*[.][0-9]*[.][0-9]*[^)]*" "version (number)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eget_auto[1-2]*" "H5Eget_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") STRING(REGEX REPLACE "H5Eset_auto[1-2]*" "H5Eset_auto(1 or 2)" TEST_STREAM "${TEST_STREAM}") - FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + IF (NOT TEST_ERRREF) + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_STREAM}") + ELSE (NOT TEST_ERRREF) + FILE (WRITE ${TEST_FOLDER}/${TEST_OUTPUT}.err "${TEST_STREAM}") + ENDIF (NOT TEST_ERRREF) ENDIF (TEST_MASK_ERROR) IF (TEST_FILTER) @@ -109,6 +119,26 @@ IF (NOT TEST_SKIP_COMPARE) IF (NOT ${TEST_RESULT} STREQUAL 0) MESSAGE (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not match ${TEST_REFERENCE}") ENDIF (NOT ${TEST_RESULT} STREQUAL 0) + + IF (TEST_ERRREF) + IF (WIN32 AND NOT MINGW) + FILE (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) + FILE (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}") + ENDIF (WIN32 AND NOT MINGW) + + # now compare the error output with the error reference + EXECUTE_PROCESS ( + COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} + RESULT_VARIABLE TEST_RESULT + ) + + MESSAGE (STATUS "COMPARE Result: ${TEST_RESULT}") + + # again, if return value is !=0 scream and shout + IF (NOT ${TEST_RESULT} STREQUAL 0) + MESSAGE (FATAL_ERROR "Failed: The error output of ${TEST_PROGRAM} did not match ${TEST_ERRREF}") + ENDIF (NOT ${TEST_RESULT} STREQUAL 0) + ENDIF (TEST_ERRREF) ENDIF (NOT TEST_SKIP_COMPARE) # everything went fine... |