summaryrefslogtreecommitdiffstats
path: root/config/cmake_ext_mod/runTest.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake_ext_mod/runTest.cmake')
-rw-r--r--config/cmake_ext_mod/runTest.cmake24
1 files changed, 14 insertions, 10 deletions
diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake
index c9508f3..a904855 100644
--- a/config/cmake_ext_mod/runTest.cmake
+++ b/config/cmake_ext_mod/runTest.cmake
@@ -35,10 +35,10 @@ if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}.err)
file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err)
endif ()
-message (STATUS "COMMAND: ${TEST_PROGRAM} ${TEST_ARGS}")
+message (STATUS "COMMAND: ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}")
if (TEST_LIBRARY_DIRECTORY)
- if (WIN32 AND NOT MINGW)
+ if (WIN32 OR MINGW)
set (ENV{PATH} "$ENV{PATH};${TEST_LIBRARY_DIRECTORY}")
else ()
set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
@@ -53,7 +53,7 @@ endif ()
if (NOT TEST_INPUT)
# run the test program, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
OUTPUT_FILE ${TEST_OUTPUT}
@@ -64,7 +64,7 @@ if (NOT TEST_INPUT)
else ()
# run the test program with stdin, capture the stdout/stderr and the result var
execute_process (
- COMMAND ${TEST_PROGRAM} ${TEST_ARGS}
+ COMMAND ${TEST_EMULATOR} ${TEST_PROGRAM} ${TEST_ARGS}
WORKING_DIRECTORY ${TEST_FOLDER}
RESULT_VARIABLE TEST_RESULT
INPUT_FILE ${TEST_INPUT}
@@ -186,9 +186,11 @@ endif ()
# compare output files to references unless this must be skipped
if (NOT TEST_SKIP_COMPARE)
if (EXISTS ${TEST_FOLDER}/${TEST_REFERENCE})
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_REFERENCE} ${TEST_FOLDER}/${TEST_REFERENCE}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_REFERENCE}.tmp ${TEST_FOLDER}/${TEST_REFERENCE})
+ #file (READ ${TEST_FOLDER}/${TEST_REFERENCE} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_REFERENCE} "${TEST_STREAM}")
endif ()
if (NOT TEST_SORT_COMPARE)
@@ -248,9 +250,11 @@ if (NOT TEST_SKIP_COMPARE)
# now compare the .err file with the error reference, if supplied
if (TEST_ERRREF)
- if (WIN32 AND NOT MINGW)
- file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
- file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
+ if (WIN32 OR MINGW)
+ configure_file(${TEST_FOLDER}/${TEST_ERRREF} ${TEST_FOLDER}/${TEST_ERRREF}.tmp NEWLINE_STYLE CRLF)
+ file(RENAME ${TEST_FOLDER}/${TEST_ERRREF}.tmp ${TEST_FOLDER}/${TEST_ERRREF})
+ #file (READ ${TEST_FOLDER}/${TEST_ERRREF} TEST_STREAM)
+ #file (WRITE ${TEST_FOLDER}/${TEST_ERRREF} "${TEST_STREAM}")
endif ()
# now compare the error output with the error reference