mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-24 23:49:18 -06:00
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.
This commit is contained in:
@@ -27,10 +27,12 @@ if(NOT EXPECTED_FILES_COUNT EQUAL 0)
|
|||||||
expected_content_list "${PACKAGE_CONTENT}")
|
expected_content_list "${PACKAGE_CONTENT}")
|
||||||
|
|
||||||
if(NOT expected_content_list)
|
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
|
message(FATAL_ERROR
|
||||||
"Unexpected file content for file No. '${file_no_}'!\n"
|
"Unexpected file content for file No. '${file_no_}'!\n"
|
||||||
" Content: '${PACKAGE_CONTENT}'\n\n"
|
"The content was:${msg_actual}\n"
|
||||||
" Expected: '${EXPECTED_FILE_CONTENT_${file_no_}}'"
|
"which does not match:${msg_expected}\n"
|
||||||
"${output_error_message}")
|
"${output_error_message}")
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
|
|||||||
Reference in New Issue
Block a user