[vtkusers] regression testing

Bill Lorensen bill.lorensen at gmail.com
Fri Jan 16 20:29:51 EST 2015


The reported image error is zero. The test passed.
On Jan 16, 2015 7:51 PM, "Miroslav Drahos" <mdrahos at thinksurgical.com>
wrote:

> Hi vtk folk,
> I have set up ctest/cdash testing framework (using vtk 5.10 as model), but
> one piece of puzzle I cannot figure out -- regression testing. If anyone
> could point me what I am missing, I would greatly appreciate it!
>
> I write the test, e.g. testMyWidget.cpp, containing the "main" function
> just as vtk tests do:
>
> int testMyWidget (int argc, char ** argv)
> {
>    int retval = 0;
>    // do stuff here, create rendering pipeline and draw into
> vtkRenderWindow
>
>   retval = vtkRegressionTestImage(rw);
>   if (retval == vtkRegressionTester::DO_INTERACTOR)
>     iren->Start();
>
>   return retval;
> }
>
> I have a baseline image saved as ../../data/Baseline/testMyWidget.png.
> To run the test manually, I invoke:
> make && ./myCppTests testMyWidget -V Baseline/testMyWidget.png  -T
> Temporary -D ../../data/
>
> And always keep getting ImageError, although I just took a screenshot of
> the renderwindow (.png format -- see below) so it is current. Error is set
> to default 10.
> <DartMeasurement name="ImageError"
> type="numeric/double">0</DartMeasurement><DartMeasurement
> name="BaselineImage"
> type="text/string">Standard</DartMeasurement><DartMeasurement
> name="WallTime" type="numeric/double">0.0631258</DartMeasurement>
>
> My baseline screenshot was created like this:
>
> void ODVtkIO::screenshot(vtkRenderWindow * rw, const std::string& fname)
> {
>    if (rw == NULL)
>      return;
>
>    VTK_CREATE(vtkWindowToImageFilter, w2i);
>    w2i->SetInput(rw);
>    w2i->ReadFrontBufferOff();   // added to match
> vtkTesting::RegressionTest(double thresh, ostream &os)
>    rw->Render();
>    w2i->Modified();  // See doc
> http://www.vtk.org/doc/nightly/html/classvtkWindowToImageFilter.html#details
>
>    VTK_CREATE(vtkPNGWriter, writer);
>    writer->SetFileName(fname.c_str());
>    writer->SetInputConnection(w2i->GetOutputPort());
>    writer->Write();
> }
>
> vtkTesting::RegressionTest(double, ostream&) takes screenshots same way.
> Yet, I am getting ImageError. Why?
>
> Cheers,
> Miro
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150116/57da8f61/attachment.html>


More information about the vtkusers mailing list