[vtk-developers] Patch to modernize Widgets/Testing/Cxx

Karthik Krishnan karthik.krishnan at kitware.com
Tue Aug 31 06:01:51 EDT 2010


Pushed to origin/master

----
commit 89834b422050c4912fb64e1b22de8d4a8ec3da41
Author: Bill Lorensen <bill.lorensen at gmail.com>
Date:   Tue Aug 31 15:21:11 2010 +0530

    Patch from Bill Lorensen on modernizing the widget test framework

    1) Use SmartPointers where possible. This removes most ->Delete()'s at
       end of tests.
    2) Use std::cout, std::cerr and std::endl
    3) Use vtkTestingObjectFactory and vtkTestingInteractor. Remove
       explicit regression testing code. The TestingInteractor handles all
test
       command line options. No longer need to have separate logic if
running
       interactively.
    4) Use proper vtk indentation.
----


There are 4 (new) failing tests on my machine after the commit. I'll look at
them in a bit.

  http://www.cdash.org/CDash/viewTest.php?onlyfailed&buildid=708801

----


Thanks
--
karthik

On Tue, Aug 31, 2010 at 11:39 AM, Karthik Krishnan <
karthik.krishnan at kitware.com> wrote:

> On Tue, Aug 24, 2010 at 2:24 AM, Bill Lorensen <bill.lorensen at gmail.com>wrote:
>
>> Karthik,
>>
>> I'm trying to complete a project I started last year to modernize the
>> vtk cxx tests. I have gone through all of the Widgets cxx tests and
>> changed them to use smart pointers and the vtkTestingInteractor.  This
>> reduces the number of lines in each test and makes them more readable.
>>
>> Can you apply the attached patch and give me some feedback? Marcus is
>> also working to modernize the Charts testing.
>>
>>
> Thanks Bill.
>
> I'll submit this after my experimental build ends  up nice and green.
>
> In addition to your attached patch, I'll also try and trim it a bit more
> but I was hoping to get some feedback.
>
> (a) I'd also like to replace lines of the form
>
>   vtkSmartPointer<vtkInteractorEventRecorder> recorder =
>     vtkSmartPointer<vtkInteractorEventRecorder>::New();
>   recorder->SetInteractor(iren);
>   recorder->ReadFromInputStringOn();
>   recorder->SetInputString(BoxWidgetEventLog2);
>   recorder->Play();
>   recorder->Off();
>   iren->Start();
>   return EXIT_SUCCESS;
>
> with just
>
>   return vtkTesting::InteractorEventLoop( argc, argv, iren,
> BoxWidgetEventLog2 );
>
> Perhaps we should move that recorder stuff into vtkTestingInteractor
> instead; something like
>   iren->Start(BoxWidgetEventLog2)
>
> It would also be great to pass the event log as a command line; I'll try
> and submit a patch ?
>
> Thanks
> --
> karthik
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20100831/3bf18dd5/attachment.html>


More information about the vtk-developers mailing list