diff options
Diffstat (limited to 'Help')
-rw-r--r-- | Help/command/add_test.rst | 5 | ||||
-rw-r--r-- | Help/manual/cmake-policies.7.rst | 3 | ||||
-rw-r--r-- | Help/policy/CMP0110.rst | 24 | ||||
-rw-r--r-- | Help/release/dev/add_test-special-chars-in-name.rst | 6 |
4 files changed, 35 insertions, 3 deletions
diff --git a/Help/command/add_test.rst b/Help/command/add_test.rst index a77ba37..2b4d082 100644 --- a/Help/command/add_test.rst +++ b/Help/command/add_test.rst @@ -10,8 +10,9 @@ Add a test to the project to be run by :manual:`ctest(1)`. [WORKING_DIRECTORY <dir>] [COMMAND_EXPAND_LISTS]) -Adds a test called ``<name>``. The test name may not contain spaces, -quotes, or other characters special in CMake syntax. The options are: +Adds a test called ``<name>``. The test name may contain arbitrary +characters, expressed as a :ref:`Quoted Argument` or :ref:`Bracket Argument` +if necessary. See policy :policy:`CMP0110`. The options are: ``COMMAND`` Specify the test command-line. If ``<command>`` specifies an diff --git a/Help/manual/cmake-policies.7.rst b/Help/manual/cmake-policies.7.rst index 3ceb1df..2627e0c 100644 --- a/Help/manual/cmake-policies.7.rst +++ b/Help/manual/cmake-policies.7.rst @@ -51,12 +51,13 @@ The :variable:`CMAKE_MINIMUM_REQUIRED_VERSION` variable may also be used to determine whether to report an error on use of deprecated macros or functions. -Policies Introduced by CMake 3.18 +Policies Introduced by CMake 3.19 ================================= .. toctree:: :maxdepth: 1 + CMP0110: add_test() supports arbitrary characters in test names. </policy/CMP0110> CMP0109: find_program() requires permission to execute but not to read. </policy/CMP0109> Policies Introduced by CMake 3.18 diff --git a/Help/policy/CMP0110.rst b/Help/policy/CMP0110.rst new file mode 100644 index 0000000..bc198aa --- /dev/null +++ b/Help/policy/CMP0110.rst @@ -0,0 +1,24 @@ +CMP0110 +------- + +:command:`add_test` supports arbitrary characters in test names. + +:command:`add_test` can now (officially) create tests with whitespace and +other special characters in its name. Before CMake version 3.19 that was not +allowed, however, it was possible to work around this limitation by explicitly +putting escaped quotes arount the test's name in the ``add_test`` command. + +Although never officially supported several projects in the wild found and +implemented this workaround. However, the new change which officially allows +the ``add_test`` command to support whitespace and other special characters in +test names now breaks that workaround. In order for these projects to work +smoothly with newer CMake versions, this policy was introduced. + +The ``OLD`` behavior of this policy is to still prevent ``add_test`` from +handling whitespace and special characters properly (if not using the +mentioned workaround). The ``NEW`` behavior on the other hand allows names +with whitespace and special characters for tests created by ``add_test``. + +This policy was introduced in CMake version 3.19. CMake version |release| +warns when the policy is not set and uses ``OLD`` behavior. Use the +:command:`cmake_policy` command to set it to ``OLD`` or ``NEW`` explicitly. diff --git a/Help/release/dev/add_test-special-chars-in-name.rst b/Help/release/dev/add_test-special-chars-in-name.rst new file mode 100644 index 0000000..5bb9a23 --- /dev/null +++ b/Help/release/dev/add_test-special-chars-in-name.rst @@ -0,0 +1,6 @@ +add_test-special-chars-in-name +------------------------------ + +* The :command:`add_test` command now (officially) supports whitespace and + other special characters in the name for the test it creates. + See policy :policy:`CMP0110`. |