diff --git a/scripts/cmake/test/AddTest.cmake b/scripts/cmake/test/AddTest.cmake index 9282ff8f2e447ca3ca8576ed2cd81ad3ffb1c177..c9791b1ec793a1174d682014f9fc281220ae0ec3 100644 --- a/scripts/cmake/test/AddTest.cmake +++ b/scripts/cmake/test/AddTest.cmake @@ -189,9 +189,6 @@ Use six arguments version of AddTest with absolute and relative tolerances") else () message(FATAL_ERROR "For vtkdiff tester the number of diff data arguments must be a multiple of six.") endif() - - - string(REPLACE ";" " && " TESTER_COMMAND "${TESTER_COMMAND}") elseif(tester STREQUAL "memcheck") set(TESTER_COMMAND "! ${GREP_TOOL_PATH} definitely ${AddTest_SOURCE_PATH}/${AddTest_NAME}_memcheck.log") endif() diff --git a/scripts/cmake/test/AddTestTester.cmake b/scripts/cmake/test/AddTestTester.cmake index 534d298c0403635856bbdb047b59cd704c62b8f3..900c302dfc504b2259b09ea1ea05f1f1159fc171 100644 --- a/scripts/cmake/test/AddTestTester.cmake +++ b/scripts/cmake/test/AddTestTester.cmake @@ -11,20 +11,20 @@ endif() message(STATUS "running command checking test results: cd ${case_path} && ${TESTER_COMMAND}") if(WIN32) - execute_process( - COMMAND cmd /C ${TESTER_COMMAND} - WORKING_DIRECTORY ${case_path} - RESULT_VARIABLE EXIT_CODE - OUTPUT_VARIABLE OUTPUT - ) + set(TERMINAL_CMD cmd /C) else() - execute_process( - COMMAND bash -c ${TESTER_COMMAND} - WORKING_DIRECTORY ${case_path} - RESULT_VARIABLE EXIT_CODE - OUTPUT_VARIABLE OUTPUT - ) + set(TERMINAL_CMD bash -c) endif() +foreach(CMD ${TESTER_COMMAND}) + set(COMBINED_COMMAND ${COMBINED_COMMAND} COMMAND ${TERMINAL_CMD} ${CMD}) +endforeach() + +execute_process( + ${COMBINED_COMMAND} + WORKING_DIRECTORY ${case_path} + RESULT_VARIABLE EXIT_CODE + OUTPUT_VARIABLE OUTPUT +) if(NOT EXIT_CODE STREQUAL "0") message(FATAL_ERROR "Error exit code: ${EXIT_CODE}")