Repository navigation
fix(rules): provide coco/gmock_helpers.h with the C++ runtime - #266
Open
GPLeemrijse wants to merge 1 commit into
Open
GPLeemrijse wants to merge 1 commit into
GPLeemrijse wants to merge 1 commit into
Conversation
GPLeemrijse
force-pushed
the
feat/cc-testing-gmock
branch
from
November 6, 2026 17:07
4412b4f to
23bdd3c
Compare
GPLeemrijse
force-pushed
the
feat/cc-testing-gmock
branch
from
November 6, 2026 17:15
23bdd3c to
5b50892
Compare
GPLeemrijse
force-pushed
the
feat/cc-testing-gmock
branch
from
November 6, 2026 17:39
5b50892 to
6819a77
Compare
The runtime repo's :testing target held the header but was referenced nowhere, so no target provided it. It is now a textual header of :runtime: it includes gmock, which only coco_cc_test_library links, and as a textual header it is never compiled on its own. It comes from the library's popili version; gmock stays the library's own dep.
GPLeemrijse
force-pushed
the
feat/cc-testing-gmock
branch
from
November 6, 2026 18:23
6819a77 to
5b334fe
Compare
GPLeemrijse
marked this pull request as ready for review
November 6, 2026 18:28
tomgr
requested changes
Nov 6, 2026
tomgr
left a comment
Member
There was a problem hiding this comment.
we'll have to find a different approach to this. we should not have it as a textual header and it should have a proper dependency on gmock.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The C++ runtime's
coco/gmock_helpers.h(coco::SingleThreadedGMockHelper,coco::MultiThreadedGMockHelper) could not be included by any test: the runtime excluded it because it includes gmock, and the runtime repo's:testingtarget that held it was referenced nowhere. It is now a textual header of the runtime: never compiled on its own, so the runtime still builds without gmock, andcoco_cc_test_librarygets it from the library's popili version. GoogleMock stays the library's owngmockdep, as before.Note: I did go for the textual header in the end, it actually seemed the least bad option:
An earlier version of this PR sent gmock through the toolchain instead (a
coco.cc_test_runtime(gmock = ...)tag, per popili version, linked as the toolchain'scc_test_runtime). Review showed that was the wrong place for it:coco_cc_test_librarycould no longer be built without GoogleMock (gmock = None), atestonlygmock was rejected because a toolchain cannot be testonly, gmock lost its direct dep and so brokelayering_check, and a per-version gmock let a pinned test link two googletests. gmock does not depend on the popili version and was already built unpinned; only the header does, and the runtime already carries it per version. So the header goes with the runtime and gmock stays a plain dep, which avoids all four problems and about 400 lines of plumbing.Tested with the root suite and the
smoke(newGMockHelpertest) andmulti_version(runtimes without the header) e2e modules.