tags:

views:

125

answers:

2

I am a ruby programmer and I really like to do TDD. Right now, I am programming a little bit in C, but I like my tools and the way I program with ruby. So, I am searching for a framework to do unit tests in C. What do you can tell me about it?

I already found some options, like: cunit, cmockery, CuTest and others. The problem is, I don't know how to evaluate the best one. I am writing a simple compiler for my compilers college course.

Could you help me?

+1  A: 

You can use any C or C++ unit testing framework. Its easy enough to call C functions from C++.

My opinion is that you want to have as little output as possible from your tests. ie if everything is OK, it should print '100% passed'. Otherwise it should only print out details of test failures.

see xprogramming.com, scroll down to the Unit Testing table and look for the C Language or C++ frameworks. The most 'standard' it seems is cppUnit.

quamrana
+1  A: 

I've used gtest and found it to be pretty easy to use (It is C++ though). Really though, it doesn't matter too much which one you pick. Just pick one and learn it.

Paul Wicks