On Mon, Dec 28, 2009 at 12:35 AM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">Folks,<br>
<br>
I have just checked in changes that simplify testing of vtk c++<br>
classes and vtk examples.<br>
<br>
1) Two new classes: Rendering/vtkTestingObjectFactory and<br>
Rendering/vtkTestingInteractor as well as cmake code<br>
vtkTestingObjectFactory.cmake.<br>
// .NAME vtkTestingObjectFactory - Object overrides used during testing<br>
// .SECTION Description<br>
// Some vtk examples and tests need to perform differently when they<br>
// are run as tests versus when they are run as individual<br>
// programs. Many tests/examples are interactive and eventually call<br>
// vtkRenderWindowInteration::Start() to initialise the<br>
// interaction. But, when run as tests, these programs should<br>
// exit. This factory overrides vtkRenderWindowInteractor so that the<br>
// Start() method just returns.<br>
// To use this factory:<br>
//   #include "vtkTestingObjectFactory.h"<br>
//   vtkTestingObjectFactory* factory = vtkTestingObjectFactory::New();<br>
//   vtkObjectFactory::RegisterFactory(factory);<br>
//<br>
and<br>
// .NAME vtkTestingInteractor - A RenderWindowInteractor for testing<br>
// .SECTION Description<br>
// Provides a Start() method that passes arguments to a test for<br>
// regression testing and returns. This permits programs that<br>
// run as tests to exit gracefully during the test run without needing<br>
// interaction.<br>
<br>
The vtkTestingObjectFactory.cmake uses these classes and the existing<br>
CREATE_TEST_SOURCELIST<br>
to build a test driver for examples and/or tests.<br>
<br>
They permit tests and examples to be run without having to modify the<br>
test or example. The tests and examples can be run interactively or as<br>
non-interactive tests. Automatic support for regression testing is<br>
supported.<br>
<br>
I will be creating a wiki page to describe the new facility. These<br>
changes are backward compatible with the existing tests.<br>
<br>
Examples are now built the same as tests. They can still be built<br>
within the vtk tree or externally.<br>
<br>
Currently, only the examples have been changed to work with the new<br>
facility. I have tested the new approach on many exiting Testing/Cxx<br>
tests, but have not checked in the change to the tests.<br>
<br>
I'll monitor the dashboard closely this week to fix any problem.<br>
<br></div></div></blockquote><div><br></div><div>Nice.</div><div><br></div><div>Just one comment for you: the "-I" command line option is used with many of the existing VTK tests so that the Start method does *not* immediately return and actually does start an event/message loop so that the test can be run interactively for debugging purposes. Hopefully your new interactor can be rigged to pay attention to that option so that tests/examples may both be run with or without "-I" to enable interaction and automation.</div>
<div><br></div><div><br></div></div>