Skip to content

Make CppInterOp work with new gtest target names. #643

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

hageboeck
Copy link
Contributor

Starting from CMake v3.23, one can use GTest::gtest and similar in CMake. Since the root-project wants to move to these targets, it would be great if Interop works with either, to avoid it building its own gtest.

Note that in addition to adding the new target names, I removed the conditional inclusion of gmock, because it is needed to compile EXPECT_THAT and StartsWith in InterpreterTests.cpp. One could either rewrite the test without those (I found that too intrusive), or always link to gmock.
I tested if gmock_main is needed (it doesn't seem to be), so I removed the dependency.

Starting from CMake v3.23, one can use GTest::gtest and similar in CMake.
Since the root-project wants to move to these targets, Interop should
work with both the new or the old target names in order not to start
building its own gtest.
Copy link

codecov bot commented Jun 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.77%. Comparing base (3ead778) to head (aa0870b).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #643   +/-   ##
=======================================
  Coverage   78.77%   78.77%           
=======================================
  Files           9        9           
  Lines        3849     3849           
=======================================
  Hits         3032     3032           
  Misses        817      817           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Thank you, @hageboeck!

@vgvassilev vgvassilev merged commit f3ade2a into compiler-research:main Jun 24, 2025
48 checks passed
@hageboeck hageboeck deleted the cmake_gtest branch June 24, 2025 14:26
aaronj0 added a commit to aaronj0/root that referenced this pull request Jun 28, 2025
Adds various upstreamed developments:

compiler-research/CppInterOp#650 streamlines the logic in Cpp::Construct to be more generic.
compiler-research/CppInterOp#643 by @hageboeck making CppInterOp work with new gtest target names
Fixed wrapper name conflicts with ROOT that also uses `__cf`, allowing us to integrate JitCall incrementally and co-exist with CallFunc
Fixes related to the cppyy forks
Unrelated work on Emscripten and WebAssembly
aaronj0 added a commit to root-project/root that referenced this pull request Jun 28, 2025
Adds various upstreamed developments:

compiler-research/CppInterOp#650 streamlines the logic in Cpp::Construct to be more generic.
compiler-research/CppInterOp#643 by @hageboeck making CppInterOp work with new gtest target names
Fixed wrapper name conflicts with ROOT that also uses `__cf`, allowing us to integrate JitCall incrementally and co-exist with CallFunc
Fixes related to the cppyy forks
Unrelated work on Emscripten and WebAssembly
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.

2 participants