cpp: Allow finding GTest when not fetching deps - #483
Conversation
1888cd2 to
2161716
Compare
|
@mpkorstanje lgtm. Didn't expect tests needing to be build when not directly developing for this repo. But it doesn't break anything. So completely OK to add. |
Thanks for the review! For context, we run test suites whenever we can in Fedora’s packages. It adds confidence that we’ve built things correctly, it helps reveal bugs on less popular architectures (we have |
|
@musicinmybrain makes total sense. |
🤔 What's changed?
This is the same idea as #478, extended to find
GTesttargets needed for C++ tests since #462. (I’m happy to see an actual usable C++ test suite, by the way!)Syntax-wise, this should be compatible with the declared CMake minimum version
messages/cpp/CMakeLists.txt
Line 18 in d28e52c
but https://cmake.org/cmake/help/latest/module/FindGTest.html#imported-targets indicates that CMake 3.23 or later is necessary in order for the
GTest::gtest,GTest::gtest_main,GTest::gmock, andGTest::gmock_mainto actually be defined based on system packages.⚡️ What's your motivation?
Straightforwardly build and run the tests in fully-offline environments, particularly Linux distribution packaging.
🏷️ What kind of change is this?
♻️ Anything particular you want feedback on?
N/A
📋 Checklist:
This text was originally generated from a template, then edited by hand. You can modify the template here.