mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-20 03:46:44 +08:00
CMake: Add check.cmake to check for errors in commands
RunCMake uses SEND_ERROR instead of FATAL_ERROR in run_cmake(), which means that the script will continue to run even if a command fails. This change adds a check.cmake file and modifies run_suite_command to ensure that we exit early if a command fails. Change-Id: I8175ddc91144e3d0dea131857138af7940626208 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
This commit is contained in:
9
tests/manual/RunCMake/InitRepository/check.cmake
Normal file
9
tests/manual/RunCMake/InitRepository/check.cmake
Normal file
@@ -0,0 +1,9 @@
|
||||
# This file is include()d by run_cmake right after it calls execute_process.
|
||||
# The msg var is set to a non-empty value when the was an error of
|
||||
# some kind. Record failure with a separate variable in the parent scope,
|
||||
# so we can FATAL_ERROR at the end.
|
||||
if(NOT "${msg}" STREQUAL "")
|
||||
set(should_error_out TRUE PARENT_SCOPE)
|
||||
else()
|
||||
set(should_error_out FALSE PARENT_SCOPE)
|
||||
endif()
|
||||
Reference in New Issue
Block a user