• Running P4A Tests

  last modified July 20, 2007 by rocky

A howto on running tests for the p4a suite.

Running Tests

At the moment the standard way to run the tests are to go into the root of you p4a buildout directory and run something like this:

./bin/instance1 test -s p4a.audio

Replace the p4a.audio package name in this example with a particular package you want to test (there's currently no predefined package that will run all package tests).


Using coverage tools

./bin/instance1 test -s p4a.audio --coverage=$HOME/coverage

This will cause a large number of text files to be generated inside your $HOME/coverage directory.  They are plain text and can be viewed.  It will show lines of source code prepended with >>>> which means they were not covered by tests (and thus new tests should be created).

There is also a separate application that can take the output files and create nicer looking HTML output with summaries and such.  It's called z3c.coverage and you can find by svn checking out:

svn co  svn://svn.zope.org/repos/main/z3c.coverage/trunk z3c.coverage

And then to run the program you need to issue:

mkdir $HOME/coverage/reports
python z3c.coverage/src/z3c/coverage/coveragereport.py $HOME/coverage $HOME/coverage/reports

You should now point your browser to $HOME/coverage/reports/all.html to see the report status.