ENH: Added test for new EXECUTE_PROCESS command.
This commit is contained in:
parent
44f96ff101
commit
9787e55ee8
|
@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
|
|||
MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
|
||||
MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
|
||||
|
||||
# Execute a process. Add coverage for this command.
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
OUTPUT_VARIABLE TEST_OUT
|
||||
)
|
||||
IF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
ELSE("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed")
|
||||
ENDIF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
COMMAND /process/does/not/exist
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE RESULT
|
||||
)
|
||||
IF("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(SEND_ERROR
|
||||
"EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
|
||||
ELSE("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
|
||||
ENDIF("${RESULT}" MATCHES "^0$")
|
||||
|
||||
#
|
||||
# Create directory.
|
||||
# The 'complex' executable will then test if this dir exists,
|
||||
|
|
|
@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
|
|||
MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
|
||||
MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
|
||||
|
||||
# Execute a process. Add coverage for this command.
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
OUTPUT_VARIABLE TEST_OUT
|
||||
)
|
||||
IF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
ELSE("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed")
|
||||
ENDIF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
COMMAND /process/does/not/exist
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE RESULT
|
||||
)
|
||||
IF("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(SEND_ERROR
|
||||
"EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
|
||||
ELSE("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
|
||||
ENDIF("${RESULT}" MATCHES "^0$")
|
||||
|
||||
#
|
||||
# Create directory.
|
||||
# The 'complex' executable will then test if this dir exists,
|
||||
|
|
|
@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
|
|||
MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
|
||||
MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM)
|
||||
|
||||
# Execute a process. Add coverage for this command.
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
OUTPUT_VARIABLE TEST_OUT
|
||||
)
|
||||
IF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
ELSE("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed")
|
||||
ENDIF("${TEST_OUT}" MATCHES "ABCDEFG")
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG"
|
||||
COMMAND /process/does/not/exist
|
||||
OUTPUT_QUIET
|
||||
ERROR_QUIET
|
||||
RESULT_VARIABLE RESULT
|
||||
)
|
||||
IF("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(SEND_ERROR
|
||||
"EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]")
|
||||
ELSE("${RESULT}" MATCHES "^0$")
|
||||
MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]")
|
||||
ENDIF("${RESULT}" MATCHES "^0$")
|
||||
|
||||
#
|
||||
# Create directory.
|
||||
# The 'complex' executable will then test if this dir exists,
|
||||
|
|
Loading…
Reference in New Issue