mirror of
git://code.qt.io/qt/qt5.git
synced 2026-04-21 04:16:39 +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:
@@ -12,7 +12,19 @@ include(RunCMake)
|
||||
|
||||
# Uses prefix set from outside scope.
|
||||
function(run_suite_command name)
|
||||
run_cmake_command(${prefix}_${name} ${ARGN})
|
||||
set(RunCMake_TEST_COMMAND "${ARGN}")
|
||||
set(RunCMake-check-file "check.cmake")
|
||||
|
||||
set(args ${ARGN})
|
||||
list(JOIN args " " args_str)
|
||||
set(working_dir "${RunCMake_TEST_COMMAND_WORKING_DIRECTORY}")
|
||||
message(STATUS "Running command: '${args_str}' in dir: '${working_dir}'")
|
||||
|
||||
run_cmake("${prefix}${name}")
|
||||
# set by the check file above.
|
||||
if(should_error_out)
|
||||
message(FATAL_ERROR "Command ${prefix}${name} failed. Exiting early.")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
macro(read_expected_output test file_name)
|
||||
|
||||
Reference in New Issue
Block a user