Cee Unit

(CeeUnit is actually cUnit, but that's a WikiUnFriendlyName)


CategoryTesting: cUnit is a TestingFramework for RegressionTesting of C programs.

Features:

cUnit is in (very) early development so things are subject to change.

Any comments are greatly appreciated.

http://www.codefactory.se/~spotty/cUnit (BrokenLink 10dec04 - http://swt.cs.tu-berlin.de/~icke/cUnit/ instead (but that too is now broken as of 1sep05))

-- ChristianHolmboe


Note, this is not the same thing as CUnit (CuNit -- http://cunit.sourceforge.net/).


I was recently introduced to the concept of formalized unit testing (via Python's 'unittest.py' module, and then this site), and already have had its worth proven to me in the Python code I maintain/extend. I'm trying to introduce it more widely into my company (starting with 'What do you know about unit testing?' to my lunch partners). As we program mainly in C, I'm looking for a good unit testing framework for it. Any pointers? Of the two at the xprogramming.com site, one is too simplistic, and the other uses glib, which I can't use. -- MikeKent

Take a look at CuTest. It has no dependency on glib and works fine with MSVC (Microsoft) and BCC32 (Borland) on Windows. -- AsimJalis

At one point I was going to port the glib version to not rely on glib but that's still on the back burner. From what I can tell though, it should not be that difficult...

Can I assume the writer of the above is the author of cUnit? If so, I must give you guidance. I put a fair amount of work into stripping glib calls out of cUnit, and ended up abandoning my efforts. It's just not worth the substantial effort. I would have had to re-create glib's list data type, forex. I ended up deciding that, since I would only need to link glib with my test framework, and not my product, that I could justify using glib to my manager. Now, if I could just figure out why glib is being stubborn about installing under AIX 4.3... -- MikeKent

Can I assume the writer of the above is the author of cUnit?

Heck no, that was me. And I have just recently decided to abandon this effort as well. I was nostalgic for C but I've gotten over it. -- JasonYip

Late-breaking news: I'm happy to report that I have succeeded in using cUnit with our product code, even with glib. It turned out not to be the problem I had thought. My verdict: definitely worth the effort, very valuable. -- MikeKent

Glad to hear that you got it on the road Mike, and thanks for the verdict.. :) -- ChristianHolmboe


glib stalling you from using cUnit on Win32? To use cUnit on a win32 platform (in my case Microsoft Visual C++ 6.0), download glib-dev & libiconv-dev from http://www.gimp.org/~tml/gimp/win32/downloads.html (you need some of the header files & DLL's for glib), find the source code for getopt.c & getopt.h somewhere/anywhere or you could write your own (I used the apache implementation), remove reference to __PRETTY_FUNCTION__ in the macro cUnit_assert(expr) in the cUnit.c file include cUnit.c, cUnit.h, example.c, getopt.c, getopt.h in a project -> build, place glib.dll & iconv.dll in the same folder as built executable; now you are ready to change/enhance etc. to suit your particular needs on win32. -- LukeDuguid


See also, or perhaps instead, http://www.xpsd.com/CUT BrokenLink 1sep05

The .com is a trap site retail aggregator or some such. http://www.xpsd.org is XP-San Diego's home site, but there is no page by the name of CUT and a whole-site search of the site only hits "cut 'n' paste" and the like.


EditText of this page (last edited November 2, 2005) or FindPage with title or text search