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>
This commit is contained in:
parent
2fef4636aa
commit
340b2a1a47
@ -577,7 +577,7 @@ execute_process(COMMAND ${extra_runner} ${arg_COMMAND}
|
|||||||
${post_run}
|
${post_run}
|
||||||
if(NOT result EQUAL 0)
|
if(NOT result EQUAL 0)
|
||||||
string(JOIN \" \" full_command ${arg_COMMAND})
|
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()"
|
endif()"
|
||||||
)
|
)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user