[Python-Dev] Re: Unittest list

Skip Montanaro skip@pobox.com
Wed, 10 Apr 2002 12:00:56 -0500

To get test coverage with gcc and gcov all you need to do is

    mkdir build.gcov
    cd build.gcov
    OPT="-fprofile-arcs -ftest-coverage" ../configure
    make quicktest
    for f in ../{Objects,Python,Modules}/*.c ; do
        gcov -o . $f

I don't know if that's a script or not.  I guess maybe it is... :-)

    >> By the way, is there a simmilar package that do the same thing for
    >> pure python programs? 

    Neal> There's 2 modules I know of:

    Neal>       http://manatee.mojam.com/~skip/python/trace.py
    Neal>       http://www.garethrees.org/2001/12/04/python-coverage/coverage.py

My trace.py stuff is actually in the distribution these days at
Tools/scripts/trace.py.  It's languished since I first ripped off profile.py
to create it.