diff options
author | Brad King <brad.king@kitware.com> | 2021-07-13 12:24:28 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-07-13 12:24:36 (GMT) |
commit | 3265fa51cd4feec492a157506fff505dbd4c7d37 (patch) | |
tree | 1a734924e446176ca42aaa69e6000c3c584af5c0 /Help | |
parent | 95c97a12e8c8498f3ed7142e3644a8b6a7eeb9e1 (diff) | |
parent | de4f1f26b0a3217f7caf842c50857b1ac90d9b7d (diff) | |
download | CMake-3265fa51cd4feec492a157506fff505dbd4c7d37.zip CMake-3265fa51cd4feec492a157506fff505dbd4c7d37.tar.gz CMake-3265fa51cd4feec492a157506fff505dbd4c7d37.tar.bz2 |
Merge topic 'ctest-environment-modifications'
de4f1f26b0 CTest: add an ENVIRONMENT_MODIFICATION property
4c757fa3c8 Help/prop_test/ENVIRONMENT: clarify the scope of the changes
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6299
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_test/ENVIRONMENT.rst | 4 | ||||
-rw-r--r-- | Help/prop_test/ENVIRONMENT_MODIFICATION.rst | 33 | ||||
-rw-r--r-- | Help/release/dev/ctest-environment-modifications.rst | 7 |
4 files changed, 43 insertions, 2 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index 4212913..c71e8ff 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -451,6 +451,7 @@ Properties on Tests /prop_test/DEPENDS /prop_test/DISABLED /prop_test/ENVIRONMENT + /prop_test/ENVIRONMENT_MODIFICATION /prop_test/FAIL_REGULAR_EXPRESSION /prop_test/FIXTURES_CLEANUP /prop_test/FIXTURES_REQUIRED diff --git a/Help/prop_test/ENVIRONMENT.rst b/Help/prop_test/ENVIRONMENT.rst index 102c792..43bcdbe 100644 --- a/Help/prop_test/ENVIRONMENT.rst +++ b/Help/prop_test/ENVIRONMENT.rst @@ -5,5 +5,5 @@ Specify environment variables that should be defined for running a test. If set to a list of environment variables and values of the form ``MYVAR=value`` those environment variables will be defined while running -the test. The environment is restored to its previous state after the -test is done. +the test. The environment changes from this property do not affect other +tests. diff --git a/Help/prop_test/ENVIRONMENT_MODIFICATION.rst b/Help/prop_test/ENVIRONMENT_MODIFICATION.rst new file mode 100644 index 0000000..ffd5de4 --- /dev/null +++ b/Help/prop_test/ENVIRONMENT_MODIFICATION.rst @@ -0,0 +1,33 @@ +ENVIRONMENT_MODIFICATION +------------------------ + +Specify environment variables that should be modified for running a test. Note +that the operations performed by this property are performed after the +:prop_test:`ENVIRONMENT` property is already applied. + +If set to a list of environment variables and values of the form +``MYVAR=OP:VALUE``. Entries are considered in the order specified in the +property's value. The ``OP`` may be one of: + + - ``reset``: Reset to the unmodified value, ignoring all modifications to + ``MYVAR`` prior to this entry. Note that this will reset the variable to + the value set by :prop_test:`ENVIRONMENT`, if it was set, and otherwise + to its state from the rest of the CTest execution. + - ``set``: Replaces the current value of ``MYVAR`` with ``VALUE``. + - ``unset``: Unsets the current value of ``MYVAR``. + - ``string_append``: Appends ``VALUE`` to the current value of ``MYVAR``. + - ``string_prepend``: Prepends ``VALUE`` to the current value of ``MYVAR``. + - ``path_list_append``: Appends ``VALUE`` to the current value of ``MYVAR`` + using the platform-specific list separator. + - ``path_list_prepend``: Prepends ``VALUE`` to the current value of + ``MYVAR`` using the platform-specific list separator. + - ``cmake_list_append``: Appends ``VALUE`` to the current value of ``MYVAR`` + using ``;`` as the separator. + - ``cmake_list_prepend``: Prepends ``VALUE`` to the current value of + ``MYVAR`` using ``;`` as the separator. + +Unrecognized ``OP`` values will result in the test failing before it is +executed. This is so that future operations may be added without changing +valid behavior of existing tests. + +The environment changes from this property do not affect other tests. diff --git a/Help/release/dev/ctest-environment-modifications.rst b/Help/release/dev/ctest-environment-modifications.rst new file mode 100644 index 0000000..64265f0 --- /dev/null +++ b/Help/release/dev/ctest-environment-modifications.rst @@ -0,0 +1,7 @@ +ctest-environment-modifications +------------------------------- + +* :manual:`ctest(1)` learned to be able to modify the environment for a test + through the :prop_test:`ENVIRONMENT_MODIFICATION` property. This is allows + for updates to environment variables based on the environment present at + test time. |