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 [] )
//Finally render the scene and compare the image to a reference image
view->GetRenderWindow()->SetMultiSamples(0);
int retVal = vtkRegressionTestImageThreshold(view->GetRenderWindow(), 25);
view->GetInteractor()->Start();
return !retVal;
return EXIT_SUCCESS;
}
......@@ -21,6 +21,7 @@
vtkStandardNewMacro(vtkTestingInteractor);
int vtkTestingInteractor::TestReturnStatus = -1;
double vtkTestingInteractor::ErrorThreshold = 40.0;
std::string vtkTestingInteractor::ValidBaseline;
std::string vtkTestingInteractor::TempDirectory;
std::string vtkTestingInteractor::DataDirectory;
......@@ -47,5 +48,5 @@ void vtkTestingInteractor::Start()
testing->AddArgument(valid.c_str());
// Regression test the image
vtkTestingInteractor::TestReturnStatus = testing->RegressionTest(40);
vtkTestingInteractor::TestReturnStatus = testing->RegressionTest(vtkTestingInteractor::ErrorThreshold);
}
......@@ -38,6 +38,7 @@ public:
virtual void Start();
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 TempDirectory; // Location of Testing/Temporary
static std::string DataDirectory; // Location of VTKData
......
......@@ -38,6 +38,13 @@ SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN
++ii;
continue;
}
if ( strcmp(av[ii],\"-E\") == 0)
{
vtkTestingInteractor::ErrorThreshold =
static_cast<double>(atof(av[ii+1]));
++ii;
continue;
}
}
vtkSmartPointer<vtkTestingObjectFactory> factory = vtkSmartPointer<vtkTestingObjectFactory>::New();
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