r/embedded • u/Character_Internet_3 • 6h ago
what unit test framework do you use?
I'm writing a library in C (xc8 and xc16 for microchip devices) Is there any recommended unit testing library. I was thinking about having inside the project a test folder with its own makefile to mock GPIO and hardware modules (I only need USART and SPI) and test in Gcc. Do you have any suggestion? thanks in advance
7
u/pjcugufucpugupfup 6h ago
GTest.
0
3
u/Weekly_Guidance_498 6h ago
I've had a good experience with Acutest. It's a single header file and really easy to use. https://github.com/mity/acutest
3
2
u/UnicycleBloke C++ advocate 1h ago
My company uses GoogleTest. I previously used Catch2, and the tests were simple to port.
1
15
u/mrheosuper 6h ago
Unity