| 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 */ |
| 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); |
| 54 | |