diff options
Diffstat (limited to 'config/cmake/jrunTest.cmake')
-rw-r--r-- | config/cmake/jrunTest.cmake | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 0315536..41570eb 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -75,7 +75,7 @@ message (STATUS "COMMAND Result: ${TEST_RESULT}") # if the .err file exists and ERRROR_APPEND is enabled if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM) - list(LENGTH TEST_STREAM test_len) + list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) if (TEST_MASK_FILE) STRING(REGEX REPLACE "CurrentDir is [^\n]+\n" "CurrentDir is (dir name)\n" TEST_STREAM "${TEST_STREAM}") @@ -129,7 +129,7 @@ set (TEST_COMPARE_RESULT 0) if (NOT TEST_SKIP_COMPARE) if (EXISTS "${TEST_FOLDER}/${TEST_REFERENCE}") file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM) - list(LENGTH TEST_STREAM test_len) + list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) if (WIN32 OR MINGW) configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF) @@ -143,7 +143,7 @@ if (NOT TEST_SKIP_COMPARE) if (NOT TEST_SORT_COMPARE) # now compare the output with the reference execute_process ( - COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} + COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE} RESULT_VARIABLE TEST_COMPARE_RESULT ) else () @@ -200,7 +200,7 @@ if (NOT TEST_SKIP_COMPARE) set (TEST_ERRREF_RESULT 0) if (TEST_ERRREF) file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM) - list(LENGTH TEST_STREAM test_len) + list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) if (WIN32 OR MINGW) configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF) @@ -213,7 +213,7 @@ if (NOT TEST_SKIP_COMPARE) # 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} + COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_IGNORE_EOL} ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF} RESULT_VARIABLE TEST_ERRREF_RESULT ) if (TEST_ERRREF_RESULT) @@ -262,7 +262,7 @@ set (TEST_GREP_RESULT 0) if (TEST_GREP_COMPARE) # now grep the output with the reference file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - list(LENGTH TEST_STREAM test_len) + list (LENGTH TEST_STREAM test_len) if (test_len GREATER 0) # TEST_REFERENCE should always be matched string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM}) @@ -284,11 +284,13 @@ endif () # dump the output unless nodisplay option is set if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY) - file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) - execute_process ( - COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM} - RESULT_VARIABLE TEST_RESULT - ) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM) + execute_process ( + COMMAND ${CMAKE_COMMAND} -E echo ${TEST_STREAM} + RESULT_VARIABLE TEST_RESULT + ) + endif () endif () # everything went fine... |