summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-03-09 11:52:53 (GMT)
committerBrad King <brad.king@kitware.com>2021-03-09 12:35:18 (GMT)
commitf4d154755ac751541a084415d669deb11e8da76c (patch)
tree2733ef478f607107f436c24afb60e0f22968a6e4
parent6fd7e8c53f83ed5b38dd7a5ca9383b22dc6739cf (diff)
downloadCMake-f4d154755ac751541a084415d669deb11e8da76c.zip
CMake-f4d154755ac751541a084415d669deb11e8da76c.tar.gz
CMake-f4d154755ac751541a084415d669deb11e8da76c.tar.bz2
Tests: Reverse RunCMake code path order
-rw-r--r--Tests/RunCMake/RunCMake.cmake30
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}")