What is the difference between gtest and gmock?

前端 未结 4 1272
孤城傲影
孤城傲影 2021-02-03 19:46

I\'m trying to understand the purpose of google-mock, Google\'s C++ mocking framework.

I have already worked with gtest earlier, but still I ca

4条回答
  •  借酒劲吻你
    2021-02-03 20:04

    Software units do not live in green meadows. They very often need some counterparts to do the work. In real system, these counterparts belong to the system itself. In the unit tests they are replaced with mocks.

    Gtest is a framework for unit testing. Gmock is a framework imitating the rest of your system during unit tests.

提交回复
热议问题