3 ms·
If you're looking for something a little more featureful, there are a couple other options out there: Check[0] and Cunit[1]. I've used both, although I wouldn'
by mauvehaus 9y ago
If you're looking for something a little more featureful, there are a couple other options out there: Check[0] and Cunit[1].
I've used both, although I wouldn't say I've used any of the advanced features of Check. Check seems to be a bit more maintained and documented, but I don't remember having any particular problems with Cunit the last time I used it.
Check's documentation also includes a list of the other C unit testing frameworks its developers know about[2]. I'm curious to check out AceUnit, which is said to be usable in an embedded context.
My approach for testing embedded functionality has been to shim any hardware-specific stuff in the code I want to test and run the tests using Check on the machine hosting the build. This "works", but it misses errors that occur because of differences in e.g. the size of size_t. Mind you, I've only been doing embedded for fun recently.
[0] https://libcheck.github.io/check/ https://libcheck.github.io/check/
[1] http://cunit.sourceforge.net/ http://cunit.sourceforge.net/
[2] https://libcheck.github.io/check/doc/check_html/check_2.html#Unit-Testing-in-C https://libcheck.github.io/check/doc/check_html/check_2.html...
ETA: Disappearing from the internet. Won't be around for discussion. Apologies for the post-and-run.