[vtk-developers] Python testing: issues/questions.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Mon Sep 9 14:19:16 EDT 2002


hi,

I've started work on simplyfying (I hope) and standardizing the Python
testing interface for VTK.  I'm using Python's unittest module.  The
reasons I choose unittest are:

   (*) Familiarity:  Most Python folks who do testing know of unittest
   and many use it.

   (*) Standard: unittest ships on all recent Python versions(>=2.1).

   (*) Produces nice reports.

   (*) Convenient.  It provides a lot of convenient functionality.

In the (ideal) Python world each class is tested comprehensively.
Each method of the class is tested to see if it behaves correctly.  A
nice and very well documented example of this is available here:

     http://www.diveintopython.org/roman_divein.html

Given that this (IMHO) is the nicest way to test comprehensively it is
likely that a test for a single class will generate many images.  The
current Tcl scripts seem to support a command line argument -V
relative/path/to/image.  I have the following doubts/questions:

  1. Why cannot the test script know what the name of the image it is
  supposed to generate?  Is this because of the way Dart works?

  2. For the Python test code alone can I make the -V command line
  argument point to a directory where the script must stick its images
  in?  Are there any issues with this?

  3. Are there issues with a test generating/using more than one
  image?  If there are why?
 
Additionally, I'm a little confused on how the actual test interface
works.  Lets say I have a test script called TestvtkClass.py that
generates/compares with 3 separate images (if that is allowed) and
does many other things to test the class vtkClass.  Is it sufficient
if I simply check if any tests failed and then print the error message
followed by an exit status of 1?  What about the image differences?
Do I have to generate them or is it automatic?  If automatic how is it
automated?

Basically, I'd like to know what exactly is required of a test script
and what assumptions are made.


thanks,
prabhu



More information about the vtk-developers mailing list