diff options
Diffstat (limited to 'Tests/RunCMake/execute_process')
10 files changed, 32 insertions, 0 deletions
diff --git a/Tests/RunCMake/execute_process/AnyCommandError-result.txt b/Tests/RunCMake/execute_process/AnyCommandError-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/execute_process/AnyCommandError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/execute_process/AnyCommandError-stderr.txt b/Tests/RunCMake/execute_process/AnyCommandError-stderr.txt new file mode 100644 index 0000000..0380562 --- /dev/null +++ b/Tests/RunCMake/execute_process/AnyCommandError-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*AnyCommandError.cmake:1 \(execute_process\): + execute_process failed command indexes: 2, 3, 4 diff --git a/Tests/RunCMake/execute_process/AnyCommandError.cmake b/Tests/RunCMake/execute_process/AnyCommandError.cmake new file mode 100644 index 0000000..f8ec385 --- /dev/null +++ b/Tests/RunCMake/execute_process/AnyCommandError.cmake @@ -0,0 +1,8 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E true + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/Tests/RunCMake/execute_process/CommandError-result.txt b/Tests/RunCMake/execute_process/CommandError-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/execute_process/CommandError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/execute_process/CommandError-stderr.txt b/Tests/RunCMake/execute_process/CommandError-stderr.txt new file mode 100644 index 0000000..c28f3a3 --- /dev/null +++ b/Tests/RunCMake/execute_process/CommandError-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*CommandError.cmake:1 \(execute_process\): + execute_process COMMAND_ERROR_IS_FATAL option can be ANY or LAST diff --git a/Tests/RunCMake/execute_process/CommandError.cmake b/Tests/RunCMake/execute_process/CommandError.cmake new file mode 100644 index 0000000..da58928 --- /dev/null +++ b/Tests/RunCMake/execute_process/CommandError.cmake @@ -0,0 +1,3 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -E true + COMMAND_ERROR_IS_FATAL ALL +) diff --git a/Tests/RunCMake/execute_process/LastCommandError-result.txt b/Tests/RunCMake/execute_process/LastCommandError-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/execute_process/LastCommandError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/execute_process/LastCommandError-stderr.txt b/Tests/RunCMake/execute_process/LastCommandError-stderr.txt new file mode 100644 index 0000000..ff191b3 --- /dev/null +++ b/Tests/RunCMake/execute_process/LastCommandError-stderr.txt @@ -0,0 +1,2 @@ +CMake Error at .*LastCommandError.cmake:1 \(execute_process\): + execute_process last command failed diff --git a/Tests/RunCMake/execute_process/LastCommandError.cmake b/Tests/RunCMake/execute_process/LastCommandError.cmake new file mode 100644 index 0000000..6116a5c --- /dev/null +++ b/Tests/RunCMake/execute_process/LastCommandError.cmake @@ -0,0 +1,8 @@ +execute_process(COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E false + COMMAND ${CMAKE_COMMAND} -E true + COMMAND ${CMAKE_COMMAND} -E false + COMMAND_ERROR_IS_FATAL LAST +) diff --git a/Tests/RunCMake/execute_process/RunCMakeTest.cmake b/Tests/RunCMake/execute_process/RunCMakeTest.cmake index 89ad6b2..f4c3d19 100644 --- a/Tests/RunCMake/execute_process/RunCMakeTest.cmake +++ b/Tests/RunCMake/execute_process/RunCMakeTest.cmake @@ -26,3 +26,7 @@ run_cmake_command(EchoCommand3 ${CMAKE_COMMAND} ${RunCMake_SOURCE_DIR}/EchoCommand.cmake) run_cmake_command(EchoVariable ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/EchoVariable.cmake) + +run_cmake_command(AnyCommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/AnyCommandError.cmake) +run_cmake_command(LastCommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/LastCommandError.cmake) +run_cmake_command(CommandError ${CMAKE_COMMAND} -P ${RunCMake_SOURCE_DIR}/CommandError.cmake) |