vtkTesting Class Reference
#include <vtkTesting.h>
Inheritance diagram for vtkTesting:
[legend]Collaboration diagram for vtkTesting:
[legend]List of all members.
Detailed Description
a unified VTK regression testing framework
This is a VTK regression testing framework. Looks like this:
vtkTesting* t = vtkTesting::New();
Two options for setting arguments
Option 1: for ( cc = 1; cc < argc; cc ++ ) { t->AddArgument(argv[cc]); }
Option 2: t->AddArgument("-D"); t->AddArgument(my_data_dir); t->AddArgument("-V"); t->AddArgument(my_valid_image);
...
Two options of doing testing:
Option 1: t->SetRenderWindow(renWin); int res = t->RegressionTest(threshold);
Option 2: int res = t->RegressionTest(test_image, threshold);
...
if ( res == vtkTesting::PASSED ) { Test passed } else { Test failed }
- Tests:
- vtkTesting (Tests)
Definition at line 74 of file vtkTesting.h.
|
virtual void | SetFrontBuffer (int) |
virtual void | FrontBufferOn () |
virtual void | FrontBufferOff () |
virtual int | GetFrontBuffer () |
static int | Test (int argc, char *argv[], vtkRenderWindow *rw, double thresh) |
Public Types |
typedef vtkObject | Superclass |
enum | ReturnValue { FAILED = 0,
PASSED = 1,
NOT_RUN = 2,
DO_INTERACTOR = 3
} |
Public Member Functions |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
void | AddArgument (const char *argv) |
int | IsValidImageSpecified () |
|
virtual int | RegressionTest (double thresh) |
virtual int | RegressionTest (double thresh, ostream &os) |
|
virtual int | RegressionTest (vtkImageData *image, double thresh) |
virtual int | RegressionTest (vtkImageData *image, double thresh, ostream &os) |
|
virtual void | SetRenderWindow (vtkRenderWindow *rw) |
virtual vtkRenderWindow * | GetRenderWindow () |
|
virtual void | SetValidImageFileName (const char *) |
const char * | GetValidImageFileName () |
|
virtual double | GetImageDifference () |
|
void | CleanArguments () |
const char * | GetDataRoot () |
virtual void | SetDataRoot (const char *) |
|
const char * | GetTempDirectory () |
virtual void | SetTempDirectory (const char *) |
|
int | IsInteractiveModeSpecified () |
virtual void | SetBorderOffset (int) |
virtual int | GetBorderOffset () |
Static Public Member Functions |
static vtkTesting * | New () |
static int | IsTypeOf (const char *type) |
static vtkTesting * | SafeDownCast (vtkObject *o) |
Protected Member Functions |
| vtkTesting () |
| ~vtkTesting () |
Static Protected Member Functions |
static char * | IncrementFileName (const char *fname, int count) |
static int | LookForFile (const char *newFileName) |
Protected Attributes |
int | FrontBuffer |
vtkRenderWindow * | RenderWindow |
char * | ValidImageFileName |
double | ImageDifference |
char * | TempDirectory |
int | BorderOffset |
vtkstd::vector< vtkstd::string > | Args |
char * | DataRoot |
double | StartWallTime |
double | StartCPUTime |
Member Typedef Documentation
Member Enumeration Documentation
|
- Enumerator:
-
FAILED |
|
PASSED |
|
NOT_RUN |
|
DO_INTERACTOR |
|
Definition at line 82 of file vtkTesting.h. |
Constructor & Destructor Documentation
vtkTesting::vtkTesting |
( |
|
) |
[protected] |
|
vtkTesting::~vtkTesting |
( |
|
) |
[protected] |
|
Member Function Documentation
|
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkObject. |
virtual const char* vtkTesting::GetClassName |
( |
|
) |
[virtual] |
|
static int vtkTesting::IsTypeOf |
( |
const char * |
type |
) |
[static] |
|
|
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
virtual int vtkTesting::IsA |
( |
const char * |
type |
) |
[virtual] |
|
|
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeRevisionMacro found in vtkSetGet.h.
Reimplemented from vtkObject. |
void vtkTesting::PrintSelf |
( |
ostream & |
os, |
|
|
vtkIndent |
indent |
|
) |
[virtual] |
|
|
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkObject. |
static int vtkTesting::Test |
( |
int |
argc, |
|
|
char * |
argv[], |
|
|
vtkRenderWindow * |
rw, |
|
|
double |
thresh |
|
) |
[static] |
|
|
Use front buffer for tests. By default use back buffer. |
virtual void vtkTesting::SetFrontBuffer |
( |
int |
|
) |
[virtual] |
|
|
Use front buffer for tests. By default use back buffer. |
virtual void vtkTesting::FrontBufferOn |
( |
|
) |
[virtual] |
|
|
Use front buffer for tests. By default use back buffer. |
virtual void vtkTesting::FrontBufferOff |
( |
|
) |
[virtual] |
|
|
Use front buffer for tests. By default use back buffer. |
virtual int vtkTesting::GetFrontBuffer |
( |
|
) |
[virtual] |
|
|
Use front buffer for tests. By default use back buffer. |
virtual int vtkTesting::RegressionTest |
( |
double |
thresh |
) |
[virtual] |
|
|
Perform the test and return result. At the same time the output will be written cout |
virtual int vtkTesting::RegressionTest |
( |
double |
thresh, |
|
|
ostream & |
os |
|
) |
[virtual] |
|
|
Perform the test and return result. At the same time the output will be written cout |
virtual int vtkTesting::RegressionTest |
( |
vtkImageData * |
image, |
|
|
double |
thresh |
|
) |
[virtual] |
|
|
Compare the image with the valid image. |
virtual int vtkTesting::RegressionTest |
( |
vtkImageData * |
image, |
|
|
double |
thresh, |
|
|
ostream & |
os |
|
) |
[virtual] |
|
|
Compare the image with the valid image. |
virtual void vtkTesting::SetRenderWindow |
( |
vtkRenderWindow * |
rw |
) |
[virtual] |
|
|
Set and get the render window that will be used for regression testing. |
|
Set and get the render window that will be used for regression testing. |
virtual void vtkTesting::SetValidImageFileName |
( |
const char * |
|
) |
[virtual] |
|
|
Set/Get the name of the valid image file |
const char* vtkTesting::GetValidImageFileName |
( |
|
) |
|
|
|
Set/Get the name of the valid image file |
virtual double vtkTesting::GetImageDifference |
( |
|
) |
[virtual] |
|
|
Get the image difference. |
void vtkTesting::AddArgument |
( |
const char * |
argv |
) |
|
|
|
Pass the command line arguments into this class to be processed. Many of the Get methods such as GetValidImage and GetBaselineRoot rely on the arguments to be passed in prior to retrieving these values. Just call AddArgument for each argument that was passed into the command line |
void vtkTesting::CleanArguments |
( |
|
) |
|
|
|
This method delete all arguments in vtkTesting, this way you can reuse it in a loop where you would have multiple testing. |
const char* vtkTesting::GetDataRoot |
( |
|
) |
|
|
|
Get some paramters from the command line arguments, env, or defaults |
virtual void vtkTesting::SetDataRoot |
( |
const char * |
|
) |
[virtual] |
|
|
This method delete all arguments in vtkTesting, this way you can reuse it in a loop where you would have multiple testing. |
const char* vtkTesting::GetTempDirectory |
( |
|
) |
|
|
|
Get some paramters from the command line arguments, env, or defaults |
virtual void vtkTesting::SetTempDirectory |
( |
const char * |
|
) |
[virtual] |
|
|
Get some paramters from the command line arguments, env, or defaults |
int vtkTesting::IsValidImageSpecified |
( |
|
) |
|
|
|
Is a valid image specified on the command line areguments? |
int vtkTesting::IsInteractiveModeSpecified |
( |
|
) |
|
|
|
Is the interactive mode specified? |
virtual void vtkTesting::SetBorderOffset |
( |
int |
|
) |
[virtual] |
|
|
Number of pixels added as borders to avoid problems with window decorations added by some window managers. |
virtual int vtkTesting::GetBorderOffset |
( |
|
) |
[virtual] |
|
|
Is the interactive mode specified? |
static char* vtkTesting::IncrementFileName |
( |
const char * |
fname, |
|
|
int |
count |
|
) |
[static, protected] |
|
static int vtkTesting::LookForFile |
( |
const char * |
newFileName |
) |
[static, protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file:
Generated on Tue Jan 22 00:21:29 2008 for VTK by
1.4.3-20050530