1 /*-------------------------------------------------------------------------
2  * pg_regress.h --- regression test driver
3  *
4  * Portions Copyright (c) 1996-2016, 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 "postgres_fe.h"
12 #include <unistd.h>
13 
14 #ifndef WIN32
15 #define PID_TYPE pid_t
16 #define INVALID_PID (-1)
17 #else
18 #define PID_TYPE HANDLE
19 #define INVALID_PID INVALID_HANDLE_VALUE
20 #endif
21 
22 /* simple list of strings */
23 typedef struct _stringlist
24 {
25 	char	   *str;
26 	struct _stringlist *next;
27 } _stringlist;
28 
29 typedef PID_TYPE(*test_function) (const char *,
30 						  _stringlist **,
31 						  _stringlist **,
32 						  _stringlist **);
33 typedef void (*init_function) (int argc, char **argv);
34 
35 extern char *bindir;
36 extern char *libdir;
37 extern char *datadir;
38 extern char *host_platform;
39 
40 extern _stringlist *dblist;
41 extern bool debug;
42 extern char *inputdir;
43 extern char *outputdir;
44 extern char *launcher;
45 
46 extern const char *basic_diff_opts;
47 extern const char *pretty_diff_opts;
48 
49 int regression_main(int argc, char *argv[],
50 				init_function ifunc, test_function tfunc);
51 void		add_stringlist_item(_stringlist **listhead, const char *str);
52 PID_TYPE	spawn_process(const char *cmdline);
53 void		replace_string(char *string, char *replace, char *replacement);
54 bool		file_exists(const char *file);
55