1/*-------------------------------------------------------------------------
2 * pg_regress.h --- regression test driver
3 *
4 * Portions Copyright (c) 1996-2019, 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 */
22typedef struct _stringlist
23{
24 char *str;
25 struct _stringlist *next;
26} _stringlist;
27
28typedef PID_TYPE(*test_function) (const char *,
29 _stringlist **,
30 _stringlist **,
31 _stringlist **);
32typedef void (*init_function) (int argc, char **argv);
33
34extern char *bindir;
35extern char *libdir;
36extern char *datadir;
37extern char *host_platform;
38
39extern _stringlist *dblist;
40extern bool debug;
41extern char *inputdir;
42extern char *outputdir;
43extern char *launcher;
44
45extern const char *basic_diff_opts;
46extern const char *pretty_diff_opts;
47
48int regression_main(int argc, char *argv[],
49 init_function ifunc, test_function tfunc);
50void add_stringlist_item(_stringlist **listhead, const char *str);
51PID_TYPE spawn_process(const char *cmdline);
52void replace_string(char *string, const char *replace, const char *replacement);
53bool file_exists(const char *file);
54