diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-07-12 13:32:47 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-07-12 13:32:47 (GMT) |
commit | f1850c6156f8e12793d1f2f0fe1050a037aa2964 (patch) | |
tree | c234da777305d374a17fdd9376c2e579067f8815 /config/cmake | |
parent | 7bed6ec213a78e60ec9c98d71b10037199e19a45 (diff) | |
download | hdf5-f1850c6156f8e12793d1f2f0fe1050a037aa2964.zip hdf5-f1850c6156f8e12793d1f2f0fe1050a037aa2964.tar.gz hdf5-f1850c6156f8e12793d1f2f0fe1050a037aa2964.tar.bz2 |
[svn-r22560] Changes to allow tests to compare error files!
Diffstat (limited to 'config/cmake')
-rw-r--r-- | config/cmake/runTest.cmake | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 139819f..40a72f1 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,21 @@ 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) + # 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... |