diff options
author | Craig Scott <craig.scott@crascit.com> | 2024-09-27 07:43:56 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2024-09-30 11:11:10 (GMT) |
commit | 9f1703530bae90704cd4a096c14cfec4ab1e7cec (patch) | |
tree | 4a00e44f7bb85c57d64404ae9c6f28708a64dcea | |
parent | b5403cdc5d555b9263196e817809c25a49f62526 (diff) | |
download | CMake-9f1703530bae90704cd4a096c14cfec4ab1e7cec.zip CMake-9f1703530bae90704cd4a096c14cfec4ab1e7cec.tar.gz CMake-9f1703530bae90704cd4a096c14cfec4ab1e7cec.tar.bz2 |
Help: Add pre-test to prose for gtest_discover_tests()
The prose previously gave the impression that discovery was always done
as a post-build operation, but later in the documentation the
DISCOVERY_MODE option is explained where pre-test can also be specified.
Update the earlier prose to mention both methods equally.
-rw-r--r-- | Modules/GoogleTest.cmake | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Modules/GoogleTest.cmake b/Modules/GoogleTest.cmake index b959c53..8023e50 100644 --- a/Modules/GoogleTest.cmake +++ b/Modules/GoogleTest.cmake @@ -162,15 +162,15 @@ same as the Google Test name (i.e. ``suite.testcase``); see also .. versionadded:: 3.10 - ``gtest_discover_tests()`` sets up a post-build command on the test executable - that generates the list of tests by parsing the output from running the test - with the ``--gtest_list_tests`` argument. Compared to the source parsing - approach of :command:`gtest_add_tests`, this ensures that the full list of - tests, including instantiations of parameterized tests, is obtained. Since - test discovery occurs at build time, it is not necessary to re-run CMake when - the list of tests changes. - However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` is properly set - in order to function in a cross-compiling environment. + ``gtest_discover_tests()`` sets up a post-build or pre-test command on the + test executable that generates the list of tests by parsing the output from + running the test executable with the ``--gtest_list_tests`` argument. + Compared to the source parsing approach of :command:`gtest_add_tests`, + this ensures that the full list of tests, including instantiations of + parameterized tests, is obtained. Since test discovery occurs at build + or test time, it is not necessary to re-run CMake when the list of tests + changes. However, it requires that :prop_tgt:`CROSSCOMPILING_EMULATOR` + is properly set in order to function in a cross-compiling environment. Additionally, setting properties on tests is somewhat less convenient, since the tests are not available at CMake time. Additional test properties may be |