Remove the use of CMake's GoogleTest module
Using recent versions of CMake causes `gtest_discover_tests` to fail when parsing `jwt/tink_test_jwt_jwk_set_converter_test`, likely because of the issue in [1].
Using `add_test` avoids the issue at the price of losing some granularity (from per test case to per test binary).
[1] https://gitlab.kitware.com/cmake/cmake/-/issues/23039
PiperOrigin-RevId: 424321280
diff --git a/cmake/TinkBuildRules.cmake b/cmake/TinkBuildRules.cmake
index d71abc4..f2cdef1 100644
--- a/cmake/TinkBuildRules.cmake
+++ b/cmake/TinkBuildRules.cmake
@@ -34,11 +34,6 @@
include(CMakeParseArguments)
-if (NOT ${CMAKE_VERSION} VERSION_LESS 3.9)
- include(GoogleTest)
-endif()
-
-
if (TINK_BUILD_TESTS)
enable_testing()
endif()
@@ -210,11 +205,9 @@
set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD ${TINK_CXX_STANDARD})
set_property(TARGET ${_target_name} PROPERTY CXX_STANDARD_REQUIRED true)
- if (${CMAKE_VERSION} VERSION_LESS 3.9)
- add_test(NAME ${_target_name} COMMAND ${_target_name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
- else()
- gtest_discover_tests(${_target_name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
- endif()
+ # Note: This was preferred over using gtest_discover_tests because of [1].
+ # [1] https://gitlab.kitware.com/cmake/cmake/-/issues/23039
+ add_test(NAME ${_target_name} COMMAND ${_target_name} WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endfunction(tink_cc_test)
# Declare a C++ Proto library.