Skip to content
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

Find GTest via CONFIG mode to reference gmock #640

Merged
merged 2 commits into from
Mar 30, 2021

Conversation

ThomsonTan
Copy link
Contributor

The default module mode for find_package(GTest CONFIG) doesn't include gmock, so switch to CONFIG mode and append imported target GTest::gmock to GTEST_BOTH_LIBRARIES for linking.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@ThomsonTan ThomsonTan requested a review from a team March 30, 2021 02:34
@codecov
Copy link

codecov bot commented Mar 30, 2021

Codecov Report

Merging #640 (bcb0db9) into main (a947a6e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #640   +/-   ##
=======================================
  Coverage   94.49%   94.49%           
=======================================
  Files         197      197           
  Lines        9130     9130           
=======================================
  Hits         8627     8627           
  Misses        503      503           

@maxgolov
Copy link
Contributor

Approved. I trust you on this. But if you can also open this in Windows - Visual Studio 2019 (with vcpkg build), that'd be awesome!

Just to confirm it also works well on Windows:

  1. tools/setup-buildtools.cmd (preferably in Elevated shell).
  2. Then open the main repo dir as "Open -> Directory.." in Visual Studio 2019 with CMake installed.
  3. Right-click on CMakeLists.txt to Generate Cache...
  4. Then click Build -> Build All... to build all.

We'd probably need to add the vcpkg builds with OTLP enabled to the CI loop, to add automated validation of these changes.

@lalitb lalitb merged commit 3ddda3c into open-telemetry:main Mar 30, 2021
@ThomsonTan
Copy link
Contributor Author

Approved. I trust you on this. But if you can also open this in Windows - Visual Studio 2019 (with vcpkg build), that'd be awesome!

Just to confirm it also works well on Windows:

  1. tools/setup-buildtools.cmd (preferably in Elevated shell).
  2. Then open the main repo dir as "Open -> Directory.." in Visual Studio 2019 with CMake installed.
  3. Right-click on CMakeLists.txt to Generate Cache...
  4. Then click Build -> Build All... to build all.

We'd probably need to add the vcpkg builds with OTLP enabled to the CI loop, to add automated validation of these changes.

Thanks @maxgolov. I validated the VS 2019 build as well which works.

@maxgolov
Copy link
Contributor

maxgolov commented Apr 1, 2021

@ThomsonTan - I'm still checking, for some reason I get the build building successfully with this change.... but no tests run, at least not in Visual Studio 2019 , all tests show 0 tests run 🤷 I reverted just your change by:

git revert 3ddda

And I got the tests building and running again. Maybe we should add an extra check for if(MSVC) . Let's discuss tomorrow.

maxgolov added a commit that referenced this pull request Apr 1, 2021
@ThomsonTan ThomsonTan deleted the FixGMock branch November 9, 2022 22:55
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