Commit ecbfce92 authored by Bill Lorensen's avatar Bill Lorensen
Browse files

ENH: Added a -E error-thresold flag to testing interactor.

The vtkTestingInteractor now has an ErrorThreshold static
variable. vtkTestObjectFactory.cmake now parses the command line of a
test for -E error-threshold. This new flag can be placed on ADD_TEST
commands for tests that may have image error variation on different
platforms.
parent 616ad59d
...@@ -89,8 +89,7 @@ int TestBarGraph( int argc, char * argv [] ) ...@@ -89,8 +89,7 @@ int TestBarGraph( int argc, char * argv [] )
//Finally render the scene and compare the image to a reference image //Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0); view->GetRenderWindow()->SetMultiSamples(0);
int retVal = vtkRegressionTestImageThreshold(view->GetRenderWindow(), 25);
view->GetInteractor()->Start(); view->GetInteractor()->Start();
return !retVal; return EXIT_SUCCESS;
} }
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
vtkStandardNewMacro(vtkTestingInteractor); vtkStandardNewMacro(vtkTestingInteractor);
int vtkTestingInteractor::TestReturnStatus = -1; int vtkTestingInteractor::TestReturnStatus = -1;
std::string vtkTestingInteractor::ValidBaseline; double vtkTestingInteractor::ErrorThreshold = 40.0;
std::string vtkTestingInteractor::TempDirectory; std::string vtkTestingInteractor::ValidBaseline;
std::string vtkTestingInteractor::DataDirectory; std::string vtkTestingInteractor::TempDirectory;
std::string vtkTestingInteractor::DataDirectory;
// Start normally starts an event loop. This interator uses vtkTesting // Start normally starts an event loop. This interator uses vtkTesting
// to grab the render window and compare the results to a baseline image // to grab the render window and compare the results to a baseline image
...@@ -47,5 +48,5 @@ void vtkTestingInteractor::Start() ...@@ -47,5 +48,5 @@ void vtkTestingInteractor::Start()
testing->AddArgument(valid.c_str()); testing->AddArgument(valid.c_str());
// Regression test the image // Regression test the image
vtkTestingInteractor::TestReturnStatus = testing->RegressionTest(40); vtkTestingInteractor::TestReturnStatus = testing->RegressionTest(vtkTestingInteractor::ErrorThreshold);
} }
...@@ -37,7 +37,8 @@ public: ...@@ -37,7 +37,8 @@ public:
vtkTypeMacro(vtkTestingInteractor,vtkRenderWindowInteractor); vtkTypeMacro(vtkTestingInteractor,vtkRenderWindowInteractor);
virtual void Start(); virtual void Start();
static int TestReturnStatus; // Return status of the test static int TestReturnStatus; // Return status of the test
static double ErrorThreshold; // Error Threshold
static std::string ValidBaseline; // Name of the Baseline image static std::string ValidBaseline; // Name of the Baseline image
static std::string TempDirectory; // Location of Testing/Temporary static std::string TempDirectory; // Location of Testing/Temporary
static std::string DataDirectory; // Location of VTKData static std::string DataDirectory; // Location of VTKData
......
...@@ -38,6 +38,13 @@ SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN ...@@ -38,6 +38,13 @@ SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN
++ii; ++ii;
continue; continue;
} }
if ( strcmp(av[ii],\"-E\") == 0)
{
vtkTestingInteractor::ErrorThreshold =
static_cast<double>(atof(av[ii+1]));
++ii;
continue;
}
} }
vtkSmartPointer<vtkTestingObjectFactory> factory = vtkSmartPointer<vtkTestingObjectFactory>::New(); vtkSmartPointer<vtkTestingObjectFactory> factory = vtkSmartPointer<vtkTestingObjectFactory>::New();
if (!interactive) if (!interactive)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment