diff options
author | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-15 18:05:17 (GMT) |
---|---|---|
committer | Chuck Atkins <chuck.atkins@kitware.com> | 2017-05-29 16:34:28 (GMT) |
commit | 20ffa14708e5e1b324ac954fd06a1415b9398b7c (patch) | |
tree | dc755ac0cf421560ed7da453e0433c4ebe988a17 /Tests | |
parent | 5bb7429166240ffaf6f53f834bbb1a4973df8e1d (diff) | |
download | CMake-20ffa14708e5e1b324ac954fd06a1415b9398b7c.zip CMake-20ffa14708e5e1b324ac954fd06a1415b9398b7c.tar.gz CMake-20ffa14708e5e1b324ac954fd06a1415b9398b7c.tar.bz2 |
Tests: Allow test macro to take no executable arguments
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 335267a..cbd7906 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,6 +1,9 @@ # a macro for tests that have a simple format where the name matches the # directory and project -macro(ADD_TEST_MACRO NAME COMMAND) +macro(ADD_TEST_MACRO NAME) + if(${ARGC} GREATER 1) + set(_test_command --test-command ${ARGN}) + endif() string(REPLACE "." "/" dir "${NAME}") string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") add_test(NAME "${NAME}" COMMAND "${CMAKE_CTEST_COMMAND}" @@ -13,7 +16,8 @@ macro(ADD_TEST_MACRO NAME COMMAND) ${${NAME}_CTEST_OPTIONS} --build-options ${build_options} ${${NAME}_BUILD_OPTIONS} - --test-command ${COMMAND} ${ARGN}) + ${_test_command}) + unset(_test_command) list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") endmacro() |