[vtk-developers] vtk Testing/Cxx and vtk Examples

Marcus D. Hanwell marcus.hanwell at kitware.com
Mon Dec 28 10:00:36 EST 2009


On Monday 28 December 2009 00:35:39 Bill Lorensen wrote:
> Folks,
> 
> I have just checked in changes that simplify testing of vtk c++
> classes and vtk examples.
> 
> 1) Two new classes: Rendering/vtkTestingObjectFactory and
> Rendering/vtkTestingInteractor as well as cmake code
> vtkTestingObjectFactory.cmake.
> // .NAME vtkTestingObjectFactory - Object overrides used during testing
> // .SECTION Description
> // Some vtk examples and tests need to perform differently when they
> // are run as tests versus when they are run as individual
> // programs. Many tests/examples are interactive and eventually call
> // vtkRenderWindowInteration::Start() to initialise the
> // interaction. But, when run as tests, these programs should
> // exit. This factory overrides vtkRenderWindowInteractor so that the
> // Start() method just returns.
> // To use this factory:
> //   #include "vtkTestingObjectFactory.h"
> //   vtkTestingObjectFactory* factory = vtkTestingObjectFactory::New();
> //   vtkObjectFactory::RegisterFactory(factory);
> //
> and
> // .NAME vtkTestingInteractor - A RenderWindowInteractor for testing
> // .SECTION Description
> // Provides a Start() method that passes arguments to a test for
> // regression testing and returns. This permits programs that
> // run as tests to exit gracefully during the test run without needing
> // interaction.
> 
> The vtkTestingObjectFactory.cmake uses these classes and the existing
> CREATE_TEST_SOURCELIST
> to build a test driver for examples and/or tests.
> 
> They permit tests and examples to be run without having to modify the
> test or example. The tests and examples can be run interactively or as
> non-interactive tests. Automatic support for regression testing is
> supported.
> 
> I will be creating a wiki page to describe the new facility. These
> changes are backward compatible with the existing tests.
> 
> Examples are now built the same as tests. They can still be built
> within the vtk tree or externally.
> 
> Currently, only the examples have been changed to work with the new
> facility. I have tested the new approach on many exiting Testing/Cxx
> tests, but have not checked in the change to the tests.
> 
> I'll monitor the dashboard closely this week to fix any problem.
> 
Looks great, have you seen the few that are failing to configure? 

http://cdash.org/CDash/viewConfigure.php?buildid=502393
http://cdash.org/CDash/viewConfigure.php?buildid=502335
http://cdash.org/CDash/viewConfigure.php?buildid=502394

The message is,

-- VTK not found.  Set the VTK_DIR cmake cache entry to the directory 
containing VTKConfig.cmake.  This is either the root of the build tree, or 
PREFIX/lib/vtk for an installation.  For VTK 4.0, this is the location of 
UseVTK.cmake.  This is either the root of the build tree or PREFIX/include/vtk 
for an installation.
CMake Error at Examples/Infovis/Cxx/ChartView/CMakeLists.txt:5 (MESSAGE):
  Please set VTK_DIR.

I am guessing the CMakeLists files may have been missed, one of them is my 
system and I could look into it later if it is not clear why VTK_DIR is not 
set there.

Marcus
-- 
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937



More information about the vtk-developers mailing list