Use system GTest if available#405
Conversation
📝 WalkthroughWalkthroughThis change adds a single ChangesCMake test dependency configuration
Estimated code review effort: 1 (Trivial) | ~2 minutes Estimated code review effort1 (Trivial) | ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/CMakeLists.txt (1)
7-7: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winNo version constraint on the found system GTest.
FIND_PACKAGE_ARGS NAMES GTestaccepts any installed GTest version, while the fetch fallback pinsv1.15.2. This can let CI/dev machines silently use an older/newer system GTest than the tested baseline, causing hard-to-reproduce differences between environments. Consider pinning a minimum version, e.g.FIND_PACKAGE_ARGS 1.15 NAMES GTest.♻️ Proposed fix
- FIND_PACKAGE_ARGS NAMES GTest + FIND_PACKAGE_ARGS 1.15 NAMES GTest🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/CMakeLists.txt` at line 7, The system GTest lookup in the test dependency setup is unpinned, so it can resolve to any installed version instead of matching the fetched baseline. Update the test CMake package discovery around the `FIND_PACKAGE_ARGS` / `GTest` configuration to require a minimum version consistent with the fallback fetch (for example, a 1.15.x floor), so `find_package` and the fallback path stay aligned across environments.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/CMakeLists.txt`:
- Line 7: The system GTest lookup in the test dependency setup is unpinned, so
it can resolve to any installed version instead of matching the fetched
baseline. Update the test CMake package discovery around the `FIND_PACKAGE_ARGS`
/ `GTest` configuration to require a minimum version consistent with the
fallback fetch (for example, a 1.15.x floor), so `find_package` and the fallback
path stay aligned across environments.
Unless the minimum version has actually been determined, I don't think this is a good change. |
For build environments without internet access (common for Linux distributions).
Summary by CodeRabbit