summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-22 12:52:05 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-03-22 12:52:11 (GMT)
commitc216a5a716be782f81b5fa136cbc3293a0bf4f06 (patch)
tree107c2929bda317c9e66e86e6d2478a5d697844ef
parent73939fb3cb5c3134a5dec48e5928a8334f9f42ef (diff)
parent78e0204e813029cbac127af419fc4c88f57f925d (diff)
downloadCMake-c216a5a716be782f81b5fa136cbc3293a0bf4f06.zip
CMake-c216a5a716be782f81b5fa136cbc3293a0bf4f06.tar.gz
CMake-c216a5a716be782f81b5fa136cbc3293a0bf4f06.tar.bz2
Merge topic 'doc-test-property-genex' into release-3.23
78e0204e81 Help: Clarify when add_test and test properties support generator expressions Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !7101
-rw-r--r--Help/command/add_test.rst24
-rw-r--r--Help/command/set_property.rst4
-rw-r--r--Help/command/set_tests_properties.rst6
3 files changed, 26 insertions, 8 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.
diff --git a/Help/command/set_property.rst b/Help/command/set_property.rst
index 555520d..b9b12c4 100644
--- a/Help/command/set_property.rst
+++ b/Help/command/set_property.rst
@@ -85,6 +85,10 @@ It must be one of the following:
Scope may name zero or more existing tests.
See also the :command:`set_tests_properties` command.
+ Test property values may be specified using
+ :manual:`generator expressions <cmake-generator-expressions(7)>`
+ for tests created by the :command:`add_test(NAME)` signature.
+
``CACHE``
Scope must name zero or more cache existing entries.
diff --git a/Help/command/set_tests_properties.rst b/Help/command/set_tests_properties.rst
index 9bc94ae..eadde33 100644
--- a/Help/command/set_tests_properties.rst
+++ b/Help/command/set_tests_properties.rst
@@ -9,8 +9,10 @@ Set a property of the tests.
Sets a property for the tests. If the test is not found, CMake
will report an error.
-:manual:`Generator expressions <cmake-generator-expressions(7)>` will be
-expanded the same as supported by the test's :command:`add_test` call.
+
+Test property values may be specified using
+:manual:`generator expressions <cmake-generator-expressions(7)>`
+for tests created by the :command:`add_test(NAME)` signature.
See also the :command:`set_property(TEST)` command.