1f92157deSopenharmony_ci# Googletest Mocking (gMock) Framework 2f92157deSopenharmony_ci 3f92157deSopenharmony_ci### Overview 4f92157deSopenharmony_ci 5f92157deSopenharmony_ciGoogle's framework for writing and using C++ mock classes. It can help you 6f92157deSopenharmony_ciderive better designs of your system and write better tests. 7f92157deSopenharmony_ci 8f92157deSopenharmony_ciIt is inspired by: 9f92157deSopenharmony_ci 10f92157deSopenharmony_ci* [jMock](http://www.jmock.org/) 11f92157deSopenharmony_ci* [EasyMock](http://www.easymock.org/) 12f92157deSopenharmony_ci* [Hamcrest](http://code.google.com/p/hamcrest/) 13f92157deSopenharmony_ci 14f92157deSopenharmony_ciIt is designed with C++'s specifics in mind. 15f92157deSopenharmony_ci 16f92157deSopenharmony_cigMock: 17f92157deSopenharmony_ci 18f92157deSopenharmony_ci- Provides a declarative syntax for defining mocks. 19f92157deSopenharmony_ci- Can define partial (hybrid) mocks, which are a cross of real and mock 20f92157deSopenharmony_ci objects. 21f92157deSopenharmony_ci- Handles functions of arbitrary types and overloaded functions. 22f92157deSopenharmony_ci- Comes with a rich set of matchers for validating function arguments. 23f92157deSopenharmony_ci- Uses an intuitive syntax for controlling the behavior of a mock. 24f92157deSopenharmony_ci- Does automatic verification of expectations (no record-and-replay needed). 25f92157deSopenharmony_ci- Allows arbitrary (partial) ordering constraints on function calls to be 26f92157deSopenharmony_ci expressed. 27f92157deSopenharmony_ci- Lets a user extend it by defining new matchers and actions. 28f92157deSopenharmony_ci- Does not use exceptions. 29f92157deSopenharmony_ci- Is easy to learn and use. 30f92157deSopenharmony_ci 31f92157deSopenharmony_ciDetails and examples can be found here: 32f92157deSopenharmony_ci 33f92157deSopenharmony_ci* [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html) 34f92157deSopenharmony_ci* [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html) 35f92157deSopenharmony_ci* [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html) 36f92157deSopenharmony_ci* [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html) 37f92157deSopenharmony_ci 38f92157deSopenharmony_ciGoogleMock is a part of 39f92157deSopenharmony_ci[GoogleTest C++ testing framework](http://github.com/google/googletest/) and a 40f92157deSopenharmony_cisubject to the same requirements. 41