As of r17066, GoogleMock (also known as gmock) is available for use in unit tests! Yaay!
*What is it?* Gmock it is a is a C++ mock-object framework, similar to EasyMock for java, built on top of Google Test for use in C++. There's lots of documentation on the Google Mock project page<http://code.google.com/p/googlemock/>. Start with the ForDummies<http://code.google.com/p/googlemock/wiki/ForDummies>guide, or this TotT episode<http://googletesting.blogspot.com/2008/12/mockers-of-c-world-delight.html> . *Who should use it?* Most anyone writing mock objects. *Who wants to write mock objects anyways?* Probably anyone that writes unittests. *Why should I use it?* Cause it makes writing unittests easier, which means it makes it makes your life easier. :) *How to use it?* Add a dependency on "testing/gmock.gyp:gmock" #include "testing/gmock/include/gmock/gmock.h" *Got an Example?* There's a example of the syntax in src/base/gmock_unittest.cc that shows off some of the features of Google Mock. Note that this is just an example of how to use the syntax for Google Mock. It is *not *meant to be an example/guide for how to use mock objects in testing. If you want to learn about how to use mock objects for better unittests, here are a few TotT episodes that are good starting points: http://googletesting.blogspot.com/2008/06/tott-friends-you-can-depend-on.html http://googletesting.blogspot.com/2009/02/tott-partial-mocks-using-forwarding_19.html They assume Java/EasyMock, but the concepts still apply with C++/Gmock. Enjoy! -Albert --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---