diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-12-17 13:30:39 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-12-17 17:24:36 +0100 |
commit | 340b2a1a47244cba064c17b69782236c0d7e16e5 (patch) | |
tree | d6b692ec740ed77dee19166f13ee69b0174eee49 /cmake/QtTestHelpers.cmake | |
parent | 2fef4636aaf00832effdff6045005df0cfb71937 (diff) |
CMake: Fix exit code to be shown properly on test failure
The result variable was expanded at configure time rather than at
script execution time due to missing escaping.
A tidbit of information, the result variable can contain not only an
exit code, but a string as well.
For example on arm macOS with a crashed test it contains
'SIGTRAP'.
Curiously if the crashing executable is executed directly without
CMake, 'Trace/BPT trap: 5' is shown instead, perhaps because of
the shell.
Amends 3ef6af024be43bc18352796df61542a241192583
Pick-to: 6.2 6.3
Change-Id: I50e57922abfc6eccde205c6252eebfda510bad41
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'cmake/QtTestHelpers.cmake')
-rw-r--r-- | cmake/QtTestHelpers.cmake | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtTestHelpers.cmake b/cmake/QtTestHelpers.cmake index 5b73efdfeb..58742537aa 100644 --- a/cmake/QtTestHelpers.cmake +++ b/cmake/QtTestHelpers.cmake @@ -577,7 +577,7 @@ execute_process(COMMAND ${extra_runner} ${arg_COMMAND} ${post_run} if(NOT result EQUAL 0) string(JOIN \" \" full_command ${arg_COMMAND}) - message(FATAL_ERROR \"\${full_command} execution failed with exit code ${result}.\") + message(FATAL_ERROR \"\${full_command} execution failed with exit code \${result}.\") endif()" ) endfunction() |