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 struct StringInfoData
; /* avoid including stringinfo.h here */
23 /* simple list of strings */
24 typedef struct _stringlist
27 struct _stringlist
*next
;
31 * Callback function signatures for test programs that use regression_main()
34 /* Initialize at program start */
35 typedef void (*init_function
) (int argc
, char **argv
);
37 /* Launch one test case */
38 typedef PID_TYPE(*test_start_function
) (const char *testname
,
39 _stringlist
**resultfiles
,
40 _stringlist
**expectfiles
,
43 /* Postprocess one result file (optional) */
44 typedef void (*postprocess_result_function
) (const char *filename
);
50 extern char *host_platform
;
52 extern _stringlist
*dblist
;
54 extern char *inputdir
;
55 extern char *outputdir
;
56 extern char *expecteddir
;
57 extern char *launcher
;
59 extern const char *basic_diff_opts
;
60 extern const char *pretty_diff_opts
;
62 int regression_main(int argc
, char *argv
[],
64 test_start_function startfunc
,
65 postprocess_result_function postfunc
);
67 void add_stringlist_item(_stringlist
**listhead
, const char *str
);
68 PID_TYPE
spawn_process(const char *cmdline
);
69 bool file_exists(const char *file
);