How to Unit-Test?

Just came by this via google, and wanted to add that there’s a unit-test library to run unit test code on the core. Just updated the library to use the LED to display test health - so now you get the green bar on the spark core!

Although the original question was for how to unit test before flashing, it’s a good deal easier to write tests on the core, unless you are able to define abstractions to isolate your code from the firmware. For an example of this, please see my flashee library, which has both on-device tests, and a gcc compiled test suite (run before code is flashed to the device).

2 Likes