Post topics, source code that relate to the Arduino Platform
User avatar
By Zak Zag
#72950 Hi Guys,

is there any way to unit test my classes written in c++ for ESP8266 Arduino platform? I really cannot find anything related material on the internet. I thought a widely used c++ unit testing library will work, but arduino is different as it has no try-catch blocks (thus exceptions) and other disadvantages compared to standard c++ etc etc.

What i need is simple: some assertion library, structuring capabilities (suites,test cases,...) and some kind of mocking and checking whether a method was called or not.
Can anybody help?
User avatar
By destroyedlolo
#73005 The old good way ; Serial.print() will be your friend.

Alternatively, for remote ESP without serial connectivity, I'm publishing debug message on MQTT.
Bye
User avatar
By Darren Humphrey
#77929
Zak Zag wrote:Hi Guys,

is there any way to unit test my classes written in c++ for ESP8266 Arduino platform? I really cannot find anything related material on the internet. I thought a widely used c++ unit testing library will work, but arduino is different as it has no try-catch blocks (thus exceptions) and other disadvantages compared to standard c++ etc etc.

What i need is simple: some assertion library, structuring capabilities (suites,test cases,...) and some kind of mocking and checking whether a method was called or not.
Can anybody help?


Did you ever find an answer to this question? My project is reaching the stage where I want to start generating some testing metrics, ideally with some coverage analysis.