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

Bill Lorensen bill.lorensen at gmail.com
Wed Jan 6 12:57:59 EST 2010


Karthik,

Looks nice. I'll look over it further when I get back from SLC. It
would be nice to get rid of the in-lined event log. I'm not sure how
yet.

Bill

On Wed, Jan 6, 2010 at 12:44 PM, Karthik Krishnan
<karthik.krishnan at kitware.com> wrote:
> 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