Show HN: RK Test, a Google Test style library written in C99

by Warwolton 12/11/2023, 10:40 PMwith 0 comments

I really like Google Test, but am planning on doing some embedded development in C, where I sometimes find it awkward to test C code using a C++ library.

Therefore, I wrote a small unit test library closely mimicking Google Test. It consists of two source files, "rktest.c" and "rktest.h", and is about 1k lines of code and written in C99.

It uses a trick for self registering tests by placing pointers to the unit test functions into a known place in program memory, that I first learned about from https://github.com/christophercrouzet/rexo/ and https://github.com/Snaipe/Criterion/.

0