ctest: add PRESET option for ctest_test() and ctest_memcheck()

Allow users to specify a test preset when using CTest dashboard scripts.

Fixes #27630
This commit is contained in:
Zack Galbreath
2026-05-07 20:09:10 -04:00
parent f9c831dad9
commit ef0d2ca6bb
15 changed files with 233 additions and 5 deletions

View File

@@ -26,6 +26,7 @@ Perform the :ref:`CTest MemCheck Step` as a :ref:`Dashboard Client`.
[CAPTURE_CMAKE_ERROR <result-var>]
[REPEAT <mode>:<n>]
[OUTPUT_JUNIT <file>]
[PRESET <preset>]
[DEFECT_COUNT <defect-count-var>]
[QUIET]
)

View File

@@ -28,6 +28,7 @@ Perform the :ref:`CTest Test Step` as a :ref:`Dashboard Client`.
[CAPTURE_CMAKE_ERROR <result-var>]
[REPEAT <mode>:<n>]
[OUTPUT_JUNIT <file>]
[PRESET <preset>]
[QUIET]
)
@@ -190,6 +191,15 @@ The options are:
of the tests. See the CTest :ref:`CoverageTool <ctest-CoverageTool>`
setting for details.
``PRESET <preset>``
.. versionadded:: 4.4
Specify a :manual:`preset <cmake-presets(7)>` to use when running tests.
Any value set in the CTest script will take priority over a corresponding
setting from the preset. For example, the ``INCLUDE`` argument will override
the :preset:`filter.include.name <testPresets.filter.include.name>` setting
from the chosen preset.
``QUIET``
.. versionadded:: 3.3