I am working with Mbed OS to develop high-level applications and high-level libraries. Some of my libraries depends on the Mbed OS Connectivity API. I wanted to implement Test in order to test this libraries easily.
As an example, you can imagine you want to test the AWS client without having an available AWS account and an available AWS cloud (See GitHub - ARMmbed/mbed-os-example-for-aws: Mbed OS example to connect to AWS IoT Core). Could anyone recommend a way?
I can imagine some ways of doing this:
- Using greentea testing: you can implement a server mock using host_tests and perform all the tests but this highly depends on the hardware you use and it also depends on your infrastructure (you cannot test a Cellular device in your LAN).
- Using Unit tests. For me, it seems to be the best way to test the software. But on the other hand, I really can’t imagine a good solution to mock the mbed OS APIs, for example: you have to mock NetworkInterface, TCPSocket, etc. and it can be a really hard work.
What’s your opinion about this?