[PATCH] D28156: Add the 'googlemock' component of Google Test to LLVM's unittest libraries.
Chandler Carruth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 29 13:56:10 PST 2016
chandlerc added a comment.
In https://reviews.llvm.org/D28156#632376, @silvas wrote:
> > I think that #2 is relatively rarely useful, but there *are* cases where
> > it is useful. Historically, I think misuse of actual mocking as
> > described in #2 has led to resistance towards this framework. I am
> > actually sympathetic to this -- mocking can easily be overused. However
> > I think this is not a significant concern in LLVM. First and foremost,
> > LLVM has very careful and rare exposure of abstract interfaces or
> > dependency injection, which are the most prone to abuse with mocks. So
> > there are few opportunities to abuse them. Second, a large fraction of
> > LLVM's unittests are testing *generic code* where mocks actually make
> > tremendous sense. And gmock is well suited to building interfaces that
> > exercise generic libraries. Finally, I still think we should be willing
> > to have testing utilities in tree even if they should be used rarely. We
> > can use code review to help guide the usage here.
> >
> > Thoughts?
>
> You brought this up a couple years ago in the llvmdev thread "[LLVMdev] Any objections to my importing GoogleMock to go with GoogleTest in LLVM?" and was rejected (or at least stalled out) at the time. The context was also the same (wanting to unittest the new PM).
Wow, I had completely forgotten about this. I think that makes this the third time I've tried...
> I think that if the discussion of whether integrate gmock was important enough at the time to bring to llvmdev, that discussion probably still needs to be done on llvmdev.
Sure, makes total sense. I'll keep the patches CC-ed to llvm-commits but once I have some examples to point to I'll rejuvenate the discussion on llvm-dev.
> One thing that was missing last time was a compelling patch showing how gmock can really simplify one of the tests. If you come into a fresh discussion with such an example, I think it is going to be a much clearer decision this time.
Yep. Especially as now the tests are of a complexity to really show things.
https://reviews.llvm.org/D28156
More information about the llvm-commits
mailing list