diff options
| author | Alex Merry <alex.merry@kde.org> | 2015-05-11 13:56:28 +0100 | 
|---|---|---|
| committer | Alex Merry <alex.merry@kde.org> | 2015-05-13 19:22:25 +0100 | 
| commit | 0c224194ea7f12eaed32af746fc9138537f1919c (patch) | |
| tree | acd667f840cc3db01152120505b351d84b496098 /modules | |
| parent | 1b636b43d2bf4dca0332a2e2b36affa67fbe1e0b (diff) | |
| download | extra-cmake-modules-0c224194ea7f12eaed32af746fc9138537f1919c.tar.gz extra-cmake-modules-0c224194ea7f12eaed32af746fc9138537f1919c.tar.bz2 | |
Add PROPERTIES argument to ecm_add_test and ecm_add_tests.
This is particularly useful with ecm_add_tests, where you may want to
force a suite of tests to run in serial, or alter the timeout for
multiple tests at once.
BUG: 345797
REVIEW: 123722
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/ECMAddTests.cmake | 16 | 
1 files changed, 12 insertions, 4 deletions
| diff --git a/modules/ECMAddTests.cmake b/modules/ECMAddTests.cmake index bdb60691..ee7e63e3 100644 --- a/modules/ECMAddTests.cmake +++ b/modules/ECMAddTests.cmake @@ -9,7 +9,8 @@  #   ecm_add_test(<sources> LINK_LIBRARIES <library> [<library> [...]]  #                          [TEST_NAME <name>]  #                          [NAME_PREFIX <prefix>] -#                          [GUI]) +#                          [GUI] +#                          [PROPERTIES <prop1> <value1> [<prop2> <value2> [...]]])  #  # Add a new unit test using the passed source files. The parameter TEST_NAME is  # used to set the name of the resulting test, and the target built for and run @@ -27,6 +28,8 @@  # of CMAKE_WIN32_EXECUTABLE or CMAKE_MACOSX_BUNDLE).  The test will be linked  # against the libraries and/or targets passed to LINK_LIBRARIES.  # +# The PROPERTIES argument sets the given properties on the test. +#  # The generated target executable will have the effects of ecm_mark_as_test()  # (from the :module:`ECMMarkAsTest` module) applied to it.  # @@ -35,7 +38,8 @@  #  #   ecm_add_tests(<sources> LINK_LIBRARIES <library> [<library> [...]]  #                           [NAME_PREFIX <prefix>] -#                           [GUI]) +#                           [GUI] +#                           [PROPERTIES <prop1> <value1> [<prop2> <value2> [...]]])  #  # This is a convenient version of ecm_add_test() for when you have many tests  # that consist of a single source file each.  It behaves like calling @@ -63,7 +67,7 @@ include(ECMMarkNonGuiExecutable)  function(ecm_add_test)    set(options GUI)    set(oneValueArgs TEST_NAME NAME_PREFIX) -  set(multiValueArgs LINK_LIBRARIES) +  set(multiValueArgs LINK_LIBRARIES PROPERTIES)    cmake_parse_arguments(ECM_ADD_TEST "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})    set(_sources ${ECM_ADD_TEST_UNPARSED_ARGUMENTS})    list(LENGTH _sources _sourceCount) @@ -89,12 +93,15 @@ function(ecm_add_test)    add_test(NAME ${_testname} COMMAND ${_targetname})    target_link_libraries(${_targetname} ${ECM_ADD_TEST_LINK_LIBRARIES})    ecm_mark_as_test(${_targetname}) +  if (ECM_ADD_TEST_PROPERTIES) +    set_tests_properties(${_testname} PROPERTIES ${ECM_ADD_TEST_PROPERTIES}) +  endif()  endfunction()  function(ecm_add_tests)    set(options GUI)    set(oneValueArgs NAME_PREFIX) -  set(multiValueArgs LINK_LIBRARIES) +  set(multiValueArgs LINK_LIBRARIES PROPERTIES)    cmake_parse_arguments(ECM_ADD_TESTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})    if(ECM_ADD_TESTS_GUI)      set(_exe_type GUI) @@ -106,6 +113,7 @@ function(ecm_add_tests)        NAME_PREFIX ${ECM_ADD_TESTS_NAME_PREFIX}        LINK_LIBRARIES ${ECM_ADD_TESTS_LINK_LIBRARIES}  	  ${_exe_type} +      PROPERTIES ${ECM_ADD_TESTS_PROPERTIES}      )    endforeach()  endfunction() | 
