-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
How to use EqualsProto to check protobuf? #1761
Comments
@yangminzhu Thank you for noticing. The docs are not completely synced / cleanup yet. It is possible that you are seeing reference to internal-only feature |
I don't know if this is supposed to be an internal-only feature, I found it from the public doc: https://github.com/google/googletest/blob/master/googletest/docs/advanced.md#asserting-using-gmock-matchers and the source code is uploaded to https://github.com/google/nucleus/blob/master/nucleus/testing/protocol-buffer-matchers.h. |
What's the status of this issue? The advanced.md file references using |
Hi, Do we have any plans to move and OSS protocol-buffer-matchers.h to googletest? |
Any updates on this? Not having this be open source complicates open sourcing google projects. |
Is there a timeline on this (Suppose it's still on the roadmap)? I suppose it might not be as simple as copying over the two files in the necleus repo as I'd imagine the export need to be (somewhat) consistency with the current internal version? |
I too am interested in this |
+1 this would be very useful to the Cloud C++ team. We have made do so far with our own hand-crafted matchers but having the full suite of proto-matchers would be nicer (and we can delete our own implementations). |
I could have used this too today. Please! |
protocol-buffer-matchers.h in Nucleus is heavily integrated with TensorFlow, it's not easy to include it without a rewrite. |
I forked them from Nucleus a while back and removed the unneeded dependencies: |
@inazarenko Are you planning to merge it into the googletest repo? I also have a use case for it. |
No, I don't plan to merge it with googletest, but you can just pull my repo and use it. Or clone it if you want to be isolated from any changes I might make (although I don't have any current plans to change anything, it works fine as is for our purposes). |
Internal feature request https://buganizer.corp.google.com/issues/229726259 (Googlers only) |
If this is open sourced (and I think it should be), it will be part of the protobuf library, not GoogleTest. There is a lot of cleanup required first though. |
At the least, remove this from the documentation to avoid confusing people |
…he internal versions from the protobuf library. For more context, see: google/googletest#1761 Most immediately, this enables polymorphic proto matching from strings. E.g., instead of saying MyProto expected; ASSERT_OK(ParseTextProto("[contents]", &expected); EXPECT_THAT(result, EqualsProto(expected)); We can now say EXPECT_THAT(result, EqualsProto("[contents]")); PiperOrigin-RevId: 521847154
…he internal versions from the protobuf library. For more context, see: google/googletest#1761 Most immediately, this enables polymorphic proto matching from strings. E.g., instead of saying MyProto expected; ASSERT_OK(ParseTextProto("[contents]", &expected); EXPECT_THAT(result, EqualsProto(expected)); We can now say EXPECT_THAT(result, EqualsProto("[contents]")); PiperOrigin-RevId: 521847154
…he internal versions from the protobuf library. For more context, see: google/googletest#1761 Most immediately, this enables polymorphic proto matching from strings. E.g., instead of saying MyProto expected; ASSERT_OK(ParseTextProto("[contents]", &expected); EXPECT_THAT(result, EqualsProto(expected)); We can now say EXPECT_THAT(result, EqualsProto("[contents]")); PiperOrigin-RevId: 521847154
…he internal versions from the protobuf library. For more context, see: google/googletest#1761 Most immediately, this enables polymorphic proto matching from strings. E.g., instead of saying MyProto expected; ASSERT_OK(ParseTextProto("[contents]", &expected); EXPECT_THAT(result, EqualsProto(expected)); We can now say EXPECT_THAT(result, EqualsProto("[contents]")); PiperOrigin-RevId: 522084017
Friendly ping. The docs should remove references to EqualsProto() and any other matches that don't exist externally. |
Rather than removing the references, can we have the proto matchers as open source? I would love to use those in my project instead of hacking something together over |
I'd also love for them to be a part of gTest/gMock. @wffurr for now perhaps take a look at the repository linked here: #1761 (comment) |
The advanced doc says
you can use gMock's EqualsProto to compare protos in your tests
, but I find theEqualsProto
is not defined inside gMock but in the nucleus repo that is used for parsing common genomics file.I don't want to depend on this nucleus repo, so how can I use the
EqualsProto
in my project?Thanks
The text was updated successfully, but these errors were encountered: