ENH: Added test for new EXECUTE_PROCESS command.

This commit is contained in:
Brad King 2006-02-03 17:09:35 -05:00
parent 44f96ff101
commit 9787e55ee8
3 changed files with 69 additions and 0 deletions

View File

@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(NO_EXEC_PROGRAM) MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(CLEAR 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. # Create directory.
# The 'complex' executable will then test if this dir exists, # The 'complex' executable will then test if this dir exists,

View File

@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(NO_EXEC_PROGRAM) MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(CLEAR 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. # Create directory.
# The 'complex' executable will then test if this dir exists, # The 'complex' executable will then test if this dir exists,

View File

@ -140,6 +140,29 @@ ENDIF (NOT NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(NO_EXEC_PROGRAM) MARK_AS_ADVANCED(NO_EXEC_PROGRAM)
MARK_AS_ADVANCED(CLEAR 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. # Create directory.
# The 'complex' executable will then test if this dir exists, # The 'complex' executable will then test if this dir exists,