I have a custom esp32 board and it communicates with a daughterboard over serial.
- I'm looking to mock external serial input and feed that into various unit tests (Perhaps this could be done with some kind of system to load a fake stream and pass it into the methods that take a stream input?)
For example, I would have a bunch of fake input bytes that I've predefined, then I would somehow need the functions that read from Stream
objects to be able to access those predefined bytes without manually transmitting them over serial.
- Would be good if this could run native on the computer, on device is okay as well
What is the best way to unit test this project? Any libraries or approaches that you recommend?