From 6c121924ada1f26c485c628279d6501406d9e3ac Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 15 Jan 2015 14:36:10 -0500 Subject: [PATCH] Tests: Teach RunCMake to report command-line on failure When a test sets RunCMake_TEST_COMMAND, report the command line on failure to make it easier to run by hand for debugging. --- Tests/RunCMake/RunCMake.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 7b3eda77c..1625741fe 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -93,6 +93,10 @@ function(run_cmake test) if(RunCMake_TEST_FAILED) set(msg "${RunCMake_TEST_FAILED}\n${msg}") endif() + if(msg AND RunCMake_TEST_COMMAND) + string(REPLACE ";" "\" \"" command "\"${RunCMake_TEST_COMMAND}\"") + set(msg "${msg}Command was:\n command> ${command}\n") + endif() if(msg) string(REGEX REPLACE "\n" "\n actual-out> " actual_out " actual-out> ${actual_stdout}") string(REGEX REPLACE "\n" "\n actual-err> " actual_err " actual-err> ${actual_stderr}")