From 0cfbd85e7b0d61affda6450b1cc081860b5543a6 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Sep 2019 13:07:14 -0400 Subject: Tests: Teach RunCMake to support a custom working directory --- Tests/RunCMake/RunCMake.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index ce71677..644da60 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -82,9 +82,12 @@ function(run_cmake test) 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_BINARY_DIR}" + WORKING_DIRECTORY "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}" OUTPUT_VARIABLE actual_stdout ERROR_VARIABLE ${actual_stderr_var} RESULT_VARIABLE actual_result -- cgit v0.12