doc: Fix section of functions age(xid) and mxid_age(xid)
[pgsql.git] / src / test / regress / pg_regress.h
blob141521c8910424e95afe504216636ee3d42f5fa3
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 *-------------------------------------------------------------------------
9 */
11 #include <unistd.h>
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
21 /* simple list of strings */
22 typedef struct _stringlist
24 char *str;
25 struct _stringlist *next;
26 } _stringlist;
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,
39 _stringlist **tags);
41 /* Postprocess one result file (optional) */
42 typedef void (*postprocess_result_function) (const char *filename);
45 extern char *bindir;
46 extern char *libdir;
47 extern char *datadir;
48 extern char *host_platform;
50 extern _stringlist *dblist;
51 extern bool debug;
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[],
61 init_function ifunc,
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);