vtkPVTestUtilities.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-License-Identifier: BSD-3-Clause
10 #ifndef vtkPVTestUtilities_h
11 #define vtkPVTestUtilities_h
12 
13 #include "vtkObject.h"
14 #include "vtkPVVTKExtensionsCoreModule.h" // needed for export macro
15 
16 class vtkPolyData;
17 class vtkDataArray;
18 
20 {
21 public:
22  // the usual vtk stuff
23  vtkTypeMacro(vtkPVTestUtilities, vtkObject);
24  void PrintSelf(ostream& os, vtkIndent indent) override;
25  static vtkPVTestUtilities* New();
26 
30  void Initialize(int argc, char** argv);
39  char* GetDataFilePath(const char* name) { return this->GetFilePath(this->DataRoot, name); }
48  char* GetTempFilePath(const char* name) { return this->GetFilePath(this->TempRoot, name); }
49 
50 protected:
51  vtkPVTestUtilities() { this->Initialize(0, nullptr); }
52  ~vtkPVTestUtilities() override { this->Initialize(0, nullptr); }
53 
54 private:
55  vtkPVTestUtilities(const vtkPVTestUtilities&) = delete;
56  void operator=(const vtkPVTestUtilities&) = delete;
58  char GetPathSep();
59  char* GetDataRoot();
60  char* GetTempRoot();
61  char* GetCommandTailArgument(const char* tag);
62  char* GetFilePath(const char* base, const char* name);
63  //
64  int Argc;
65  char** Argv;
66  char* DataRoot;
67  char* TempRoot;
68 };
69 
70 #endif
~vtkPVTestUtilities() override
#define VTKPVVTKEXTENSIONSCORE_EXPORT
void PrintSelf(ostream &os, vtkIndent indent) VTK_OVERRIDE
name
char * GetTempFilePath(const char *name)
Given a path relative to the working directory (provided in argv by -T option), construct a OS indepe...
A class to facilitate common test operations.
char * GetDataFilePath(const char *name)
Given a path relative to the Data root (provided in argv by -D option), construct a OS independent pa...
static vtkObject * New()
void operator=(const vtkObjectBase &)