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

Add cc_library for ScopedMockLog #392

Closed
calder opened this issue Nov 18, 2018 · 5 comments
Closed

Add cc_library for ScopedMockLog #392

calder opened this issue Nov 18, 2018 · 5 comments
Assignees

Comments

@calder
Copy link

calder commented Nov 18, 2018

As far as I can tell there is currently no way of using ScopedMockLog from Bazel.

@drigz
Copy link
Member

drigz commented Nov 19, 2018

@calder It shouldn't be too hard to add this. It will add a dependency on googletest, but hopefully only when ScopedMockLog is actually used.

Can you point me to some code that uses ScopedMockLog so I can check it's being made available correctly?

@calder
Copy link
Author

calder commented Nov 25, 2018

@drigz: Building and running src/mock-log_test.cc under Bazel should be a pretty good test.

@drigz
Copy link
Member

drigz commented Nov 26, 2018

Would external users expect to include it with #include "mock-log.h" or with #include <glog/mock-log.h>? (or something else??)

@calder
Copy link
Author

calder commented Nov 28, 2018

Probably #include <glog/mock-log.h>.

@drigz
Copy link
Member

drigz commented Dec 17, 2018

On further investigation, this isn't easy to do, since mock-log.h is not written the way the public headers are. To make it work without breaking anything else I think we'd need to move mock-log.h to src/glog/mock-log.h.in and template the namespace into it.

An easier way to use ScopedMockLog with Bazel would be to vendor it into your own project and hardcode the namespace instead of including utilities.h.

@sergiud sergiud closed this as completed Mar 30, 2021
@sergiud sergiud mentioned this issue May 6, 2021
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

No branches or pull requests

3 participants