In my module there are function like macros. This is no obstacle for a module test, but it is an obstacle for other modules which include this module.
My question: is there a way to make a part of the .h file visible for CMock only?
e.g.:
Module_1.h:
#ifdef MODULE_TEST_CMOCK
void FunctionLikeMacro_1(unsigned int x);
unsigned int FunctionLikeMacro_2(void);
#else
#define FunctionLikeMacro_1(x) (HWREGISTER_1 = (unsigned int)x)
#define FunctionLikeMacro_2 ((unsigned int)HWREGISTER_2)
#endif
This is the way I would prefer. But where should I define MODULE_TEST_CMOCK? I can't define it in the Project.yml because with this change, my module tests for Module_1 would fail. But on the other hand, in my module tests for Module_2, which needs a mocked version of Module_1.h, I can't expect calls of FunctionLikeMacro_1 and FunctionLikeMacro_2.
Thank you for your time. :)