You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.6 KiB

  1. # Googletest Mocking (gMock) Framework
  2. ### Overview
  3. Google's framework for writing and using C++ mock classes. It can help you
  4. derive better designs of your system and write better tests.
  5. It is inspired by:
  6. * [jMock](http://www.jmock.org/),
  7. * [EasyMock](http://www.easymock.org/), and
  8. * [Hamcrest](http://code.google.com/p/hamcrest/),
  9. and designed with C++'s specifics in mind.
  10. gMock:
  11. - provides a declarative syntax for defining mocks,
  12. - can define partial (hybrid) mocks, which are a cross of real and mock
  13. objects,
  14. - handles functions of arbitrary types and overloaded functions,
  15. - comes with a rich set of matchers for validating function arguments,
  16. - uses an intuitive syntax for controlling the behavior of a mock,
  17. - does automatic verification of expectations (no record-and-replay needed),
  18. - allows arbitrary (partial) ordering constraints on function calls to be
  19. expressed,
  20. - lets a user extend it by defining new matchers and actions.
  21. - does not use exceptions, and
  22. - is easy to learn and use.
  23. Details and examples can be found here:
  24. * [gMock for Dummies](docs/for_dummies.md)
  25. * [Legacy gMock FAQ](docs/gmock_faq.md)
  26. * [gMock Cookbook](docs/cook_book.md)
  27. * [gMock Cheat Sheet](docs/cheat_sheet.md)
  28. Please note that code under scripts/generator/ is from the [cppclean
  29. project](http://code.google.com/p/cppclean/) and under the Apache
  30. License, which is different from Google Mock's license.
  31. Google Mock is a part of
  32. [Google Test C++ testing framework](http://github.com/google/googletest/) and a
  33. subject to the same requirements.