Files
CMake/Modules
Moritz Haase 0767016eab GoogleTest: Avoid silent failures of dynamic test discovery
The internal helper variable '_GOOGLETEST_DISCOVER_TESTS_SCRIPT' can have gone
out-of-scope when 'gtest_discover_tests()' is called, depending on where the
GoogleTest module is actually included. This leads to a silent failure of
dynamic test discovery, since the custom post-build commands actually does
nothing (it basically invokes 'cmake -P ""'). Ctest will then fail to run the
tests, considering them to be 'not built'.

Fix this by determining the path to the GoogleTest module based on
'${CMAKE_ROOT}' instead, which is always available.

A new test case was added to test suite 'RunCMake/GoogleTest' to ensure that
'gtest_discover_tests()' works correctly when invoked in a different variable
scope.

Fixes: #25477
2023-12-06 12:52:18 +01:00
..
2023-11-22 07:24:01 -05:00
2023-08-16 09:42:53 -04:00
2023-11-30 09:05:54 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-04-28 09:33:28 -04:00
2023-05-22 16:51:15 -04:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-10-10 09:25:05 -04:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00
2023-11-17 09:58:21 -05:00

See the "Find Modules" section of the cmake-developer(7) manual page.

For more information about how to contribute modules to CMake, see this page:
https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/dev/Module-Maintainers