diff options
author | Brad King <brad.king@kitware.com> | 2016-10-07 11:28:32 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-07 11:28:32 -0400 |
commit | 7f90d5e5ccfa862ebd99bd79632cc9351fe2ee19 (patch) | |
tree | d889592997405ccd904b58366cae86e53d75ade2 /Tests | |
parent | 7a1e542ed7065ab300af11f5cb4cfe465de2e5e6 (diff) | |
download | cmake-7f90d5e5ccfa862ebd99bd79632cc9351fe2ee19.tar.gz |
Tests: Improve RunCMake.CPack_* failure message formatting
Format a `message(FATAL_ERROR)` call with markup to make the generated
message more readable so that the difference between the actual and
expected results is easier to see.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CPack/VerifyResult.cmake | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Tests/RunCMake/CPack/VerifyResult.cmake b/Tests/RunCMake/CPack/VerifyResult.cmake index 8bc2a586fe..ad2a651dea 100644 --- a/Tests/RunCMake/CPack/VerifyResult.cmake +++ b/Tests/RunCMake/CPack/VerifyResult.cmake @@ -27,10 +27,12 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0) expected_content_list "${PACKAGE_CONTENT}") if(NOT expected_content_list) + string(REPLACE "\n" "\n actual> " msg_actual "\n${PACKAGE_CONTENT}") + string(REPLACE "\n" "\n expect> " msg_expected "\n${EXPECTED_FILE_CONTENT_${file_no_}}") message(FATAL_ERROR "Unexpected file content for file No. '${file_no_}'!\n" - " Content: '${PACKAGE_CONTENT}'\n\n" - " Expected: '${EXPECTED_FILE_CONTENT_${file_no_}}'" + "The content was:${msg_actual}\n" + "which does not match:${msg_expected}\n" "${output_error_message}") endif() else() |