diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-29 03:29:13 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2009-10-29 03:29:13 (GMT) |
commit | 32f156b218e9156a9414c90a1b036c865f94b6d9 (patch) | |
tree | e879ffdf6bb24add65bab74cf71b0297b348c119 /Tests/TryCompile/CMakeLists.txt | |
parent | 06b0f676ce0274a4211d56f008d032d6c70ad368 (diff) | |
download | CMake-32f156b218e9156a9414c90a1b036c865f94b6d9.zip CMake-32f156b218e9156a9414c90a1b036c865f94b6d9.tar.gz CMake-32f156b218e9156a9414c90a1b036c865f94b6d9.tar.bz2 |
Add more coverage and use the ARGS option of try_run
Diffstat (limited to 'Tests/TryCompile/CMakeLists.txt')
-rw-r--r-- | Tests/TryCompile/CMakeLists.txt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 75adb99..62bed87 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -142,6 +142,17 @@ IF(NOT "${TRY_OUT}" MATCHES "hello world") MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") ENDIF(NOT "${TRY_OUT}" MATCHES "hello world") +TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp + ${TryCompile_SOURCE_DIR}/expect_arg.c + OUTPUT_VARIABLE TRY_OUT + ARGS arg1 arg2) +IF(NOT ARG_TEST_COMPILE) + MESSAGE(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") +ENDIF(NOT ARG_TEST_COMPILE) +IF(NOT "${ARG_TEST_RUN}" STREQUAL "0") + MESSAGE(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") +ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0") # try to run a file that should compile and run, but return an error TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE |