arduino icon indicating copy to clipboard operation
arduino copied to clipboard

unit tests for FirmataParser

Open soundanalogous opened this issue 9 years ago • 3 comments

Now that the parsing functionality has been extracted from the Arduino-specific Firmata.cpp implementation, it would be useful to add unit tests for FirmataParser. Existing tests use ArduinoUnit which runs on the board (which really puts them more in the functional test category), but tests for FirmataParser could simply run on the PC. I'm not familiar with general C++ unit testing libraries (or native c++ testing support for that matter). @zfields curious if you have any suggestions.

soundanalogous avatar Nov 12 '16 22:11 soundanalogous

I use GoogleTest and GoogleMock on my project. However, they do require you to have GoogleTest installed (easy on Linux via apt install) and a Makefile to run the test. Once they are setup and running, it's quite easy to work with.

Does that sound interesting or like too many dependencies?

zfields avatar Nov 13 '16 01:11 zfields

I've been looking into Catch. Are you familiar with this lib at all? It's just a single header file so super simple to include and runs cross platform.

soundanalogous avatar Nov 13 '16 02:11 soundanalogous

I just read the README and it sounds cool. I particularly like the fact that it doesn't need to be installed, and I want to give it a try. I'm in the middle of a prototype, but as soon as I have it complete, I'll throw down on some test and tell you if where if fell short.

zfields avatar Nov 14 '16 00:11 zfields