Unit testing

Tim Potter tpot at samba.org
Tue Nov 19 09:12:09 EST 2002


On Mon, Nov 18, 2002 at 09:36:15PM +1100, Brad Hards wrote:

> PyUnit looks to be the sort of thing I'm after. I'd just rather not have to 
> write Python wrappers around all my code, just to test it.

A nice pattern is to write a separate C function with a main() that just
calls your program's internals.  The python (or perl or tcl or whatever)
based unit test framework can then run this program and pass or fail
based on the exit code.

Martin Pool has written what I think is a nicer python based unit test
wrapper called comfychair.  It's not quite 100% yet but it avoids some
of the sillier java and junit idioms that pyunit has.  Currently it's 
part of the distcc source.


Tim.



More information about the linux mailing list