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-2024, 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;
27 
28 /*
29  * Callback function signatures for test programs that use regression_main()
30  */
31 
32 /* Initialize at program start */
33 typedef void (*init_function) (int argc, char **argv);
34 
35 /* Launch one test case */
36 typedef PID_TYPE(*test_start_function) (const char *testname,
37  _stringlist **resultfiles,
38  _stringlist **expectfiles,
39  _stringlist **tags);
40 
41 /* Postprocess one result file (optional) */
42 typedef void (*postprocess_result_function) (const char *filename);
43 
44 
45 extern char *bindir;
46 extern char *libdir;
47 extern char *datadir;
48 extern char *host_platform;
49 
50 extern _stringlist *dblist;
51 extern bool debug;
52 extern char *inputdir;
53 extern char *outputdir;
54 extern char *expecteddir;
55 extern char *launcher;
56 
57 extern const char *basic_diff_opts;
58 extern const char *pretty_diff_opts;
59 
60 int regression_main(int argc, char *argv[],
61  init_function ifunc,
62  test_start_function startfunc,
64 
65 void add_stringlist_item(_stringlist **listhead, const char *str);
66 PID_TYPE spawn_process(const char *cmdline);
67 bool file_exists(const char *file);
const char * str
static char * filename
Definition: pg_dumpall.c:119
bool file_exists(const char *file)
Definition: pg_regress.c:1304
void(* init_function)(int argc, char **argv)
Definition: pg_regress.h:33
#define PID_TYPE
Definition: pg_regress.h:14
bool debug
Definition: pg_regress.c:99
PID_TYPE(* test_start_function)(const char *testname, _stringlist **resultfiles, _stringlist **expectfiles, _stringlist **tags)
Definition: pg_regress.h:36
struct _stringlist _stringlist
char * outputdir
Definition: pg_regress.c:101
char * libdir
char * launcher
Definition: pg_regress.c:104
const char * pretty_diff_opts
Definition: pg_regress.c:66
char * inputdir
Definition: pg_regress.c:100
int regression_main(int argc, char *argv[], init_function ifunc, test_start_function startfunc, postprocess_result_function postfunc)
Definition: pg_regress.c:2066
char * expecteddir
Definition: pg_regress.c:102
char * host_platform
Definition: pg_regress.c:53
const char * basic_diff_opts
Definition: pg_regress.c:65
void(* postprocess_result_function)(const char *filename)
Definition: pg_regress.h:42
char * datadir
_stringlist * dblist
Definition: pg_regress.c:98
PID_TYPE spawn_process(const char *cmdline)
Definition: pg_regress.c:1201
char * bindir
Definition: pg_regress.c:103
void add_stringlist_item(_stringlist **listhead, const char *str)
Definition: pg_regress.c:198
char * str
Definition: initdb.c:92
struct _stringlist * next
Definition: initdb.c:93