Przeglądaj źródła

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.
Craig Scott 1 rok temu
rodzic
commit
f55f9fd5c1
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      Modules/GoogleTest.cmake

+ 7 - 1
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 ``<target>_TESTS`` variable.
+  script via the ``<target>_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