PostgreSQL Source Code  git master
pg_regress.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  * pg_regress.h --- regression test driver
3  *
4  * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
5  * Portions Copyright (c) 1994, Regents of the University of California
6  *
7  * src/test/regress/pg_regress.h
8  *-------------------------------------------------------------------------
9  */
10 
11 #include <unistd.h>
12 
13 #ifndef WIN32
14 #define PID_TYPE pid_t
15 #define INVALID_PID (-1)
16 #else
17 #define PID_TYPE HANDLE
18 #define INVALID_PID INVALID_HANDLE_VALUE
19 #endif
20 
21 /* simple list of strings */
22 typedef struct _stringlist
23 {
24  char *str;
25  struct _stringlist *next;
26 } _stringlist;
27 
28 typedef PID_TYPE(*test_function) (const char *,
29  _stringlist **,
30  _stringlist **,
31  _stringlist **);
32 typedef void (*init_function) (int argc, char **argv);
33 
34 extern char *bindir;
35 extern char *libdir;
36 extern char *datadir;
37 extern char *host_platform;
38 
39 extern _stringlist *dblist;
40 extern bool debug;
41 extern char *inputdir;
42 extern char *outputdir;
43 extern char *launcher;
44 
45 extern const char *basic_diff_opts;
46 extern const char *pretty_diff_opts;
47 
48 int regression_main(int argc, char *argv[],
49  init_function ifunc, test_function tfunc);
50 void add_stringlist_item(_stringlist **listhead, const char *str);
51 PID_TYPE spawn_process(const char *cmdline);
52 void replace_string(char *string, const char *replace, const char *replacement);
53 bool file_exists(const char *file);
bool debug
Definition: pg_standby.c:48
void add_stringlist_item(_stringlist **listhead, const char *str)
Definition: pg_regress.c:155
PID_TYPE(* test_function)(const char *, _stringlist **, _stringlist **, _stringlist **)
Definition: pg_regress.h:28
char * str
Definition: pg_regress.h:24
int regression_main(int argc, char *argv[], init_function ifunc, test_function tfunc)
Definition: pg_regress.c:2050
#define PID_TYPE
Definition: pg_regress.h:14
char * libdir
const char * basic_diff_opts
Definition: pg_regress.c:64
void(* init_function)(int argc, char **argv)
Definition: pg_regress.h:32
void replace_string(char *string, const char *replace, const char *replacement)
Definition: pg_regress.c:441
char * inputdir
Definition: pg_regress.c:74
PID_TYPE spawn_process(const char *cmdline)
Definition: pg_regress.c:1127
char * datadir
struct _stringlist _stringlist
char * outputdir
Definition: pg_regress.c:75
const char * pretty_diff_opts
Definition: pg_regress.c:65
char * launcher
Definition: pg_regress.c:77
char * host_platform
Definition: pg_regress.c:52
_stringlist * dblist
Definition: pg_regress.c:72
struct _stringlist * next
Definition: pg_regress.h:25
char * bindir
Definition: pg_regress.c:76
bool file_exists(const char *file)
Definition: pg_regress.c:1231