[vtk-developers] Checkins to vtkTesting and related files to simplify the regression testing and playback recording code bloat.

Karthik Krishnan karthik.krishnan at kitware.com
Wed Jan 6 12:44:51 EST 2010


Hello:

I've checked in changes to vtkTesting and also to a few tests (to
start with) with the aim of simplifying the API/code bloat associated
with regression testing and interaction playback in VTK. This takes
Bill's work a step further.

- One no longer needs to include/expose the vtkInteractorEventRecorder.

- The command line can optionally take in a "--DisableReplay" flag. In
conjunction with the "-I" flag, this puts the test into interactive
mode, but without the playback. This allows the user to interactively
define the widget. The "-I" flag was woefully inadequate, the test
defines the widget already for you, thereby the user never gets to
play with the behaviour used when defining.

- The command line can optionally take in a "--Record" flag. In this
case, interactions are recorded into a log file. This may be used to
create the playback stream for the tests.

- There is no need to invoke the include/instantiate the Regression
test call, or invoke the interactor event loop or the event recorder.


Usage in a test for a VTK widget that needs playback testing / recording is :


     const char TestFooWidgetTestLog[] = {
      ....
      };

     int TestFooWidget( int argc, char *argv[] )
       {
       ...
       return vtkTesting::InteractorEventLoop( argc, argv, iren,
TestFooWidgetTestLog );
       }


In tests where no playback is exercised, the API is :

     int TestFoo( int argc, char *argv[] )
       {
       ...
       return vtkTesting::InteractorEventLoop( argc, argv, iren );
       }


Please see TestTensorProbeWidget.cxx or
TestDijkstraImageGeodesicPath.cxx for use cases. This reduces code
bloat by at least 20 lines in each of the tests.

I'd like to get feedback about this API, and suggest that the sweeping
change be made across all VTK tests that instantiate a render window.


Thanks
_________________________________
karthik



More information about the vtk-developers mailing list