Unit Test Frameworks for “C”

A recent project had me looking into useable Unit Test Frameworks for the “C” programming language. After doing some initial research, wikipedia ended up showing me a large list of frameworks, of which the majority appear to be dead or not used anymore. After doing some initial scanning, I decided to look into a handful:

  • I initially looked into check. This one is mostly current, still appears to be maintained, and looks like a large list of open source projects use this for their own unit test needs.
  • I also look at cmockery. This is a Google project to provide a fast, easy unit test framework for “C”. However, this one looks older than check, and doesn’t appear to be actively maintained.
  • The last one I looked at was FCTX. Ultimately, this is the one I chose.
FCTX has the following advantages:
  • It provides a robust unit test framework, all while being written and existing in a single header file.
  • It is licensed under the BSD license, which makes it friendly for commercial projects.
  • It is actively maintained, with the latest release coming out in April, 2011.
I’m in the process of trying to write unit tests with this now. Once I’ve played with it a bit, I’ll either update this post or write a new one detailing the actual experience of using FCTX for unit test creation.