diff options
author | Brad King <brad.king@kitware.com> | 2021-06-11 10:08:04 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-11 10:08:09 (GMT) |
commit | 557e47f1544796332bf27a73669a429725adac29 (patch) | |
tree | b09a8751ffae6447299b4ce7ae86c6133e833a9f /Tests | |
parent | 4217e1cf3a47a2702e07dbf38cce43d6650e497b (diff) | |
parent | 45935ac973a280ea9602ba17aa448d94a66a056d (diff) | |
download | CMake-557e47f1544796332bf27a73669a429725adac29.zip CMake-557e47f1544796332bf27a73669a429725adac29.tar.gz CMake-557e47f1544796332bf27a73669a429725adac29.tar.bz2 |
Merge topic 'test-CPackComponentsForAll-errors'
45935ac973 Tests: Improve CPackComponentsForAll test error formatting
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6212
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 31e843a..3e1c13d 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -115,8 +115,17 @@ execute_process(COMMAND ${CMAKE_CPACK_COMMAND} ${config_verbose} -G ${CPackGen} ERROR_VARIABLE CPack_error WORKING_DIRECTORY ${CPackComponentsForAll_BINARY_DIR}) +string(REPLACE "\n" "\n cpack-out> " cpack_out "\n${CPack_output}") +string(REPLACE "\n" "\n cpack-err> " cpack_err "\n${CPack_error}") +string(REPLACE "\n" "\n cpack-res> " cpack_res "\n${CPack_result}") +string(CONCAT output_error_message + "CPack output:${cpack_out}\n" + "CPack error:${cpack_err}\n" + "CPack result:${cpack_res}\n" + ) + if(CPack_result) - message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") + message(FATAL_ERROR "error: CPack execution went wrong!,\n${output_error_message}") else () message(STATUS "CPack_output=${CPack_output}") endif() @@ -132,13 +141,13 @@ if(expected_file_mask) message(STATUS "expected_file_mask='${expected_file_mask}'") if(NOT expected_file) - message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}") + message(FATAL_ERROR "error: expected_file does not exist: CPackComponentsForAll test fails.\n${output_error_message}") endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) - message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") + message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails.\n${output_error_message}") endif() if(expect_dmg_sla) |