logo

Unit Test frameworks for the C language

The vast majority of the 'literature' about Unit Tests is illustrated with Object Oriented languages. Does it mean that procedural languages in general, and more specifically the C language, are not suitable for Unit Testing ? The first thing to notice is that there are several frameworks available for the C language:

With a C++ compiler available, one can also choose to rely on one of thenumerous C++ framework (e.g. CppUnit, CxxTest, Boost::Test, NanoCppUnit, TUT, UnitTest++ and cutee) to take advantage on C++ stronger type checking.

I gave a look at check, but was concerned about execution speed: what is the cost of the fork() to run each testcase RUNNING in its own address space? And what is the point of isolating as much the testcases: when a test or the tested code cores, I fix it immediatly, recompile and run the tests again. I don't care to have all the other tests successful if one break so badly the code.

So, let's start with minunit cuz it's very easy to learn.


rf.eerf@sartnap:otliam
v2.01