mirror of https://github.com/google/googletest.git
Register googlemock Python tests with CTest
py_test() relies on Python3_Interpreter_FOUND and the imported Python3::Interpreter target, both of which are directory-scoped and set in googletest's scope. googlemock adds googletest as a subdirectory, so neither is visible where py_test() is called from, and gmock_leak_test and gmock_output_test were never registered. Repeat the interpreter search in googlemock's own scope. Fixes #5070
This commit is contained in:
parent
0daf775f8c
commit
dfcf2d4d57
|
|
@ -202,6 +202,11 @@ if (gmock_build_tests)
|
|||
############################################################
|
||||
# Python tests.
|
||||
|
||||
# Python is found in googletest's directory scope, which does not propagate
|
||||
# to this parent scope, and the imported Python3::Interpreter target used by
|
||||
# py_test() is directory-scoped as well, so the search is repeated here.
|
||||
find_package(Python3 COMPONENTS Interpreter QUIET)
|
||||
|
||||
cxx_executable(gmock_leak_test_ test gmock_main)
|
||||
py_test(gmock_leak_test)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue