TestDriver: Add '-N' option to print all tests

This commit is contained in:
Daniel Pfeifer
2026-02-24 18:31:24 +01:00
committed by Brad King
parent b7f83c37a4
commit 4e34426fb3
11 changed files with 102 additions and 0 deletions

View File

@@ -77,3 +77,27 @@ The generated test driver supports the following command-line arguments:
Any additional arguments after ``-A`` are interpreted as exact test names
to skip.
``-N``
.. versionadded:: 4.4
List all available test names (one per line) and exit.
Example
^^^^^^^
.. code-block:: cmake
create_test_sourcelist(SRCS main.c test1.c test2.c)
add_executable(MyTests ${SRCS})
discover_tests(COMMAND MyTests
DISCOVERY_ARGS -N
DISCOVERY_MATCH "^(.+)$"
TEST_NAME "${PROJECT_NAME}.\\1"
TEST_ARGS "\\1"
)
See Also
^^^^^^^^
* :command:`discover_tests`