I recently got into Unit-Testing embedded C Code. I'd like to test each module fully isolated from all the others. This approach requires me to simulate (or "fake") all the dependencies and external calls a module makes.
Doing just that, I would end up with multiple definitions for the same function -- all the fakes would have the same identifier.
I believe the most common approach to avoid having multiple definitions is to compile one binary for each test -- instead of one big program for all tests.
However this introduces new difficulties. I need a main()-Function for every Module under Test. Also each program now prints its own summary instead of one the total test summary. Oh and its quite tedious to set up the build environment to do this...
There is very likely a smart way to do this. How is it done correctly?