diff options
Diffstat (limited to 'scripts/cmake/exec_test.cmake')
-rw-r--r-- | scripts/cmake/exec_test.cmake | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/cmake/exec_test.cmake b/scripts/cmake/exec_test.cmake index 5dce94b..3ea352f 100644 --- a/scripts/cmake/exec_test.cmake +++ b/scripts/cmake/exec_test.cmake @@ -2,7 +2,7 @@ # - COMMAND: the command to run with all it's arguments # - TEST_MODE: NORMAL/VALGRIND/COLLECT/COMPARE # - TEST_OUTPUT_FILE: the file to/from which to write/read the output of the test -# - TEST_TEMP_FILE: the temp file for the current test output used in COMPARE mode +# - TEST_TEMP_FILE: the temp file for the current test output used in COMPARE mode # To run something through this script use cmake like this: # cmake -DCOMMAND=path/to/my.exe -arg1 -arg2 -DTEST_MODE=VALGRIND -P path/to/exec_test.cmake @@ -31,20 +31,20 @@ if("${TEST_MODE}" STREQUAL "COMPARE") if(NOT CMAKE_HOST_UNIX) execute_process(COMMAND dos2unix ${TEST_TEMP_FILE}) endif() - + execute_process(COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_OUTPUT_FILE} ${TEST_TEMP_FILE} RESULT_VARIABLE cmp_result) - + if(cmp_result) find_package(Git) if(GIT_FOUND) set(cmd ${GIT_EXECUTABLE} diff --no-index ${TEST_OUTPUT_FILE} ${TEST_TEMP_FILE}) execute_process(COMMAND ${GIT_EXECUTABLE} diff --no-index ${TEST_OUTPUT_FILE} ${TEST_TEMP_FILE} OUTPUT_VARIABLE DIFF) - MESSAGE("${DIFF}") + message("${DIFF}") endif() - + # file(READ ${TEST_OUTPUT_FILE} orig) # file(READ ${TEST_TEMP_FILE} temp) - + # message("==========================================================================") # message("== CONTENTS OF ${TEST_OUTPUT_FILE}") # message("==========================================================================") @@ -56,7 +56,7 @@ if("${TEST_MODE}" STREQUAL "COMPARE") # message("==========================================================================") # message("== CONTENTS END") # message("==========================================================================") - + set(CMD_RESULT "Output is different from reference file!") endif() endif() |