diff options
author | Brad King <brad.king@kitware.com> | 2015-01-15 19:36:10 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-01-15 19:46:58 (GMT) |
commit | 6c121924ada1f26c485c628279d6501406d9e3ac (patch) | |
tree | 9f44f9ac224491a56f7d64182bdace1101b37d12 /Tests/RunCMake/RunCMake.cmake | |
parent | 3dec4a2bfbad7b519cb1e7c9aa72dd2ee3c4e669 (diff) | |
download | CMake-6c121924ada1f26c485c628279d6501406d9e3ac.zip CMake-6c121924ada1f26c485c628279d6501406d9e3ac.tar.gz CMake-6c121924ada1f26c485c628279d6501406d9e3ac.tar.bz2 |
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.
Diffstat (limited to 'Tests/RunCMake/RunCMake.cmake')
-rw-r--r-- | Tests/RunCMake/RunCMake.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index 7b3eda7..1625741 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}") |