CMock mock some functions but not others from same module

1k Views Asked by At
//myfuncs.h
void func1(void);

void func2(void;

I'm doing unit testing. Using CMock with ceedling, is there any way to mock func1(), but run func2() as it was originally written?

1

There are 1 best solutions below

0
On BEST ANSWER

To my knowledge, you can't. You must split the header file into two and generate mocks for one of them.

There are unit test frameworks that can mock one or more functions in a header file, Nala (which I'm maintaining) for example. But I guess you want to use CMock with Ceedling, so it's not really an option.