1 /*-------------------------------------------------------------------------
2 * pg_regress.h --- regression test driver
4 * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
5 * Portions Copyright (c) 1994, Regents of the University of California
7 * src/test/regress/pg_regress.h
8 *-------------------------------------------------------------------------
14 #define PID_TYPE pid_t
15 #define INVALID_PID (-1)
17 #define PID_TYPE HANDLE
18 #define INVALID_PID INVALID_HANDLE_VALUE
21 /* simple list of strings */
22 typedef struct _stringlist
25 struct _stringlist
*next
;
29 * Callback function signatures for test programs that use regression_main()
32 /* Initialize at program start */
33 typedef void (*init_function
) (int argc
, char **argv
);
35 /* Launch one test case */
36 typedef PID_TYPE(*test_start_function
) (const char *testname
,
37 _stringlist
**resultfiles
,
38 _stringlist
**expectfiles
,
41 /* Postprocess one result file (optional) */
42 typedef void (*postprocess_result_function
) (const char *filename
);
48 extern char *host_platform
;
50 extern _stringlist
*dblist
;
52 extern char *inputdir
;
53 extern char *outputdir
;
54 extern char *expecteddir
;
55 extern char *launcher
;
57 extern const char *basic_diff_opts
;
58 extern const char *pretty_diff_opts
;
60 int regression_main(int argc
, char *argv
[],
62 test_start_function startfunc
,
63 postprocess_result_function postfunc
);
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
);