30 #ifndef vtkTestUtilities_h
31 #define vtkTestUtilities_h
35 #if defined( _MSC_VER )
36 #pragma warning( disable : 4996 ) // 'function': was declared deprecated
44 static inline char*
GetDataRoot(
int argc,
char* argv[]);
62 int argc,
char* argv[],
75 int argc,
char* argv[],
89 "../../../../VTKData");
100 "../../../../VTKData",
107 int argc,
char* argv[],
113 for (
int i = 0; i < argc; i++)
115 if (strcmp(arg, argv[i]) == 0 && i < argc - 1)
125 value =
new char[strlen(argv[index]) + 1];
126 strcpy(value, argv[index]);
130 char *foundenv = getenv(env);
133 value =
new char[strlen(foundenv) + 1];
134 strcpy(value, foundenv);
138 value =
new char[strlen(def) + 1];
166 fullName =
new char[strlen(value) + strlen(fname) + 2 +
167 static_cast<size_t>(slash ? 1 : 0)];
169 strcat(fullName, value);
170 size_t len = strlen(fullName);
173 strcat(fullName, fname);
177 fullName =
new char[strlen(fname) + 1 +
static_cast<size_t>(slash ? 1 : 0)];
178 strcpy(fullName, fname);
183 strcat(fullName,
"/");
191 #endif // vtkTestUtilities_h
static char * ExpandFileNameWithArgOrEnvOrDefault(const char *arg, int argc, char *argv[], const char *env, const char *def, const char *fname, int slash=0)
static char * ExpandDataFileName(int argc, char *argv[], const char *fname, int slash=0)
static char * GetDataRoot(int argc, char *argv[])
Utility functions used for regression testing.
static char * GetArgOrEnvOrDefault(const char *arg, int argc, char *argv[], const char *env, const char *def)