Catch2: Add mocking support

Created on 17 Jun 2019  路  3Comments  路  Source: catchorg/Catch2

Description
If you want to mock an interface in C++, there are two well known frameworks, which are:

  • GMock feature-rich but with an old school API and no seamless integration with Catch (GMock throws exceptions on mocking failure)
  • FakeIt with a nice API, but sadly, by using some compiler internal vtable modification. It does not support all kinds of mocking (no virtual inheritance, no multiple inheritance, optimization limitation).

I have the strong opinion, that we can create a better API than GMock (by supporting only newer CPP standards) but overcome the limitation of FakeIt.

Additional context
I would love to support this feature with planning and PRs.

Guys, should we give it a try?

Most helpful comment

So no further development in this?

All 3 comments

There is https://github.com/rollbear/trompeloeil.

I think it is a good alternative to all.

So no further development in this?

This is might interesting for someone: https://github.com/matepek/catch2-with-gmock

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RT222 picture RT222  路  4Comments

eloff picture eloff  路  7Comments

hassanfarid picture hassanfarid  路  6Comments

emil-e picture emil-e  路  8Comments

pwinston picture pwinston  路  5Comments