Skip to content

cpp: Allow finding GTest when not fetching deps - #483

Merged
mpkorstanje merged 2 commits into
cucumber:mainfrom
musicinmybrain:gmock-system
Jul 14, 2026
Merged

cpp: Allow finding GTest when not fetching deps#483
mpkorstanje merged 2 commits into
cucumber:mainfrom
musicinmybrain:gmock-system

Conversation

@musicinmybrain

@musicinmybrain musicinmybrain commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

🤔 What's changed?

This is the same idea as #478, extended to find GTest targets 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

cmake_minimum_required(VERSION 3.12 FATAL_ERROR)

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, and GTest::gmock_main to 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?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

♻️ Anything particular you want feedback on?

N/A

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@daantimmer

Copy link
Copy Markdown
Contributor

@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.

@mpkorstanje
mpkorstanje merged commit f167bd2 into cucumber:main Jul 14, 2026
@musicinmybrain

Copy link
Copy Markdown
Contributor Author

@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 x86_64, aarch64, ppc64le, and s390x as primary architectures), it helps us catch unexpected behavior changes from dependency updates, and it even occasionally helps reveal things like compiler bugs in new versions of GCC.

@mpkorstanje

Copy link
Copy Markdown
Member

@musicinmybrain makes total sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants