Cellular Interface - Unit Tests for Modem Implementations

Hello all,

While going through the source files I saw that there are unit tests for common library files.
I haven’t seen the mention of the module implementations on the CMake files.
Are the example implementation unit tested?
What would be a good way to also unit test custom implementations.
Would I need to mock everything related to comm if to be able to properly build and test?


By definition, a unit test only tests a unit and mocks everything else the unit under test uses. In your case, the unit is Modem specific implementation. So you should mock any other component it uses (which includes comm).

Thanks for the answer.

Yes that is fair. I’ll probably use the provided mocks and add anything I need like comm_if like you mentioned.
Am I right in the assumption that modem implementations don’t have unit tests or am I missing something?


You are right that the reference implementations of cellular interface do not have tests. In general, we write tests for our libraries and not for demos or reference implementations.