From f55f9fd5c1e6d9b20be890c54a666d36fd46d576 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Fri, 4 Oct 2024 18:01:28 +1000 Subject: Help: Mention TEST_LIST with gtest_discover_tests() can omit tests Test names with square brackets can't be safely parsed in the list returned through TEST_LIST, so they are omitted from the list. This was implemented in 8b85b10fb3 (GoogleTest: Add handling for square brackets in test names, 2022-01-05), but the documentation wasn't updated as part of that change. --- Modules/GoogleTest.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index 1c45161..dd8622a 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -186,7 +186,8 @@ same as the Google Test name (i.e. ``suite.testcase``); see also more fine-grained test control is needed, custom content may be provided through an external CTest script using the :prop_dir:`TEST_INCLUDE_FILES` directory property. The set of discovered tests is made accessible to such a - script via the ``_TESTS`` variable. + script via the ``_TESTS`` variable (see the ``TEST_LIST`` option + below for further discussion and limitations). The options are: @@ -247,6 +248,11 @@ same as the Google Test name (i.e. ``suite.testcase``); see also executable is being used in multiple calls to ``gtest_discover_tests()``. Note that this variable is only available in CTest. + Due to a limitation of CMake's parsing rules, any test with a square + bracket in its name will be omitted from the list of tests stored in + this variable. Such tests will still be defined and executed by + ``ctest`` as normal though. + ``DISCOVERY_TIMEOUT num`` .. versionadded:: 3.10.3 -- cgit v0.12