diff options
author | Brad King <brad.king@kitware.com> | 2022-03-21 19:43:30 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-03-21 19:46:50 (GMT) |
commit | 78e0204e813029cbac127af419fc4c88f57f925d (patch) | |
tree | 2641cfc344c62bebe847bc8f941f9de9c41760ef /Help/command/add_test.rst | |
parent | 58f15afb8a1f6c7f047585d81a8f773fcf7952e8 (diff) | |
download | CMake-78e0204e813029cbac127af419fc4c88f57f925d.zip CMake-78e0204e813029cbac127af419fc4c88f57f925d.tar.gz CMake-78e0204e813029cbac127af419fc4c88f57f925d.tar.bz2 |
Help: Clarify when add_test and test properties support generator expressions
Issue: #23329
Diffstat (limited to 'Help/command/add_test.rst')
-rw-r--r-- | Help/command/add_test.rst | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst index 95cd037..53555a4 100644 --- a/Help/command/add_test.rst +++ b/Help/command/add_test.rst @@ -20,6 +20,9 @@ if necessary. See policy :policy:`CMP0110`. The options are: automatically be replaced by the location of the executable created at build time. + The command may be specified using + :manual:`generator expressions <cmake-generator-expressions(7)>`. + ``CONFIGURATIONS`` Restrict execution of the test only to the named configurations. @@ -30,6 +33,9 @@ if necessary. See policy :policy:`CMP0110`. The options are: directory set to the build directory corresponding to the current source directory. + The working directory may be specified using + :manual:`generator expressions <cmake-generator-expressions(7)>`. + ``COMMAND_EXPAND_LISTS`` .. versionadded:: 3.16 @@ -48,9 +54,10 @@ unless the :prop_test:`PASS_REGULAR_EXPRESSION`, .. versionadded:: 3.16 Added :prop_test:`SKIP_REGULAR_EXPRESSION` property. -The ``COMMAND`` and ``WORKING_DIRECTORY`` options may use "generator -expressions" with the syntax ``$<...>``. See the -:manual:`cmake-generator-expressions(7)` manual for available expressions. +Tests added with the ``add_test(NAME)`` signature support using +:manual:`generator expressions <cmake-generator-expressions(7)>` +in test properties set by :command:`set_property(TEST)` or +:command:`set_tests_properties`. Example usage: @@ -73,10 +80,15 @@ file produced by target ``myexe``. --------------------------------------------------------------------- +This command also supports a simpler, but less flexible, signature: + .. code-block:: cmake add_test(<name> <command> [<arg>...]) -Add a test called ``<name>`` with the given command-line. Unlike -the above ``NAME`` signature no transformation is performed on the -command-line to support target names or generator expressions. +Add a test called ``<name>`` with the given command-line. + +Unlike the above ``NAME`` signature, target names are not supported +in the command-line. Furthermore, tests added with this signature do not +support :manual:`generator expressions <cmake-generator-expressions(7)>` +in the command-line or test properties. |