meekrosoft / fff

A testing micro framework for creating function test doubles
Other
746 stars 162 forks source link

Selective Mocking #44

Open jaydanraul opened 6 years ago

jaydanraul commented 6 years ago

In c++ project is it possible to used mocked and non-mocked headers?

I have two test suites which overlap.

Test Suite 1
Mock: drivers.h
pump_calc.h Test: pump_move.h/c

Test Suite 2: Mock: pump_math.h Test: pump_calc.c/h

The issue is that in suite 2 calling functions from pump_calc is calling the mocked ones. Is it possible to call the real functions in test suite 2 but the fake ones in test suite 1? This happenes whether I use DECLARE_FAKE_VALUE_FUNC and DEFINE_FAKE_VALUE_FUNC. Also happens with FAKE_VALUE_FUNC. It doesn't seem to matter which is used.

NINI1988 commented 4 years ago

See https://github.com/meekrosoft/fff/issues/74#issuecomment-534265551. Maybe that helps?