testing C code with python

Peter Hansen peter at engcorp.com
Thu Nov 10 21:59:12 EST 2005


Bilgehan.Balban at gmail.com wrote:
> A simple question - Is it common/good practice to test C code using
> Python? For example one could wrap individual C functions, and test
> each of them using python, maybe not for low-level things but at least
> for algorithmic correctness. Anyone effectively doing this as common
> practice?

I doubt this is common practice (in general), but at a previous company 
we developed a tool that let us write tests in Python, which would then 
call into C code which was executing in the form of object code (in an 
S19 file) running inside a simulated microcontroller CPU (68HC12) which 
was itself implemented in Python.

I realize that doesn't help you, but I just thought I'd mention it, 
because it was a heck of a lot of fun writing it. :-)

-Peter



More information about the Python-list mailing list