diff options
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 1a69059..c1023f0 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -91,21 +91,7 @@ function(run_cmake test) else() set(maybe_input_file "") endif() - if(RunCMake_TEST_COMMAND) - if(NOT RunCMake_TEST_COMMAND_WORKING_DIRECTORY) - set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") - endif() - execute_process( - COMMAND ${RunCMake_TEST_COMMAND} - WORKING_DIRECTORY "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}" - OUTPUT_VARIABLE actual_stdout - ERROR_VARIABLE ${actual_stderr_var} - RESULT_VARIABLE actual_result - ENCODING UTF8 - ${maybe_timeout} - ${maybe_input_file} - ) - else() + if(NOT RunCMake_TEST_COMMAND) if(RunCMake_GENERATOR_INSTANCE) set(_D_CMAKE_GENERATOR_INSTANCE "-DCMAKE_GENERATOR_INSTANCE=${RunCMake_GENERATOR_INSTANCE}") else() @@ -134,6 +120,20 @@ function(run_cmake test) ${maybe_timeout} ${maybe_input_file} ) + else() + if(NOT RunCMake_TEST_COMMAND_WORKING_DIRECTORY) + set(RunCMake_TEST_COMMAND_WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}") + endif() + execute_process( + COMMAND ${RunCMake_TEST_COMMAND} + WORKING_DIRECTORY "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}" + OUTPUT_VARIABLE actual_stdout + ERROR_VARIABLE ${actual_stderr_var} + RESULT_VARIABLE actual_result + ENCODING UTF8 + ${maybe_timeout} + ${maybe_input_file} + ) endif() set(msg "") if(NOT "${actual_result}" MATCHES "${expect_result}") |