Commit 9787e55e authored by Brad King's avatar Brad King

ENH: Added test for new EXECUTE_PROCESS command.

parent 44f96ff1
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment