TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

2 pointsby Warwoltover 1 year ago
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.<p>Therefore, I wrote a small unit test library closely mimicking Google Test. It consists of two source files, &quot;rktest.c&quot; and &quot;rktest.h&quot;, and is about 1k lines of code and written in C99.<p>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 <a href="https:&#x2F;&#x2F;github.com&#x2F;christophercrouzet&#x2F;rexo&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;christophercrouzet&#x2F;rexo&#x2F;</a> and <a href="https:&#x2F;&#x2F;github.com&#x2F;Snaipe&#x2F;Criterion&#x2F;">https:&#x2F;&#x2F;github.com&#x2F;Snaipe&#x2F;Criterion&#x2F;</a>.

no comments

no comments