Closed prof7bit closed 2 years ago
No, you have to mock the functions you are calling..
The intention of this lib is to provide a way to mock the arduino and run tests outside of an arduino microcontroller..
maybe some work needs to be done on the docs to make that more clear.
but this is not a actual implementation, you wont be able o run the native program..
only via pio test
maybe some work needs to be done on the docs to make that more clear.
yea… so… how do I do it?
I want to test a function that uses Serial.print()
. I have #include <ArduinoFake.h>
at the beginning of the test file. What's next?
Mock the calls..
Will be something similar to this one.. but using Serial
I would have expected Serial.begin() to be a no-op, or maybe just set a flag that begin was called, and Serial.print() to simply write to stdout. Is this an unreasonable assumption?