00001 /*------------------------------------------------------------------------- 00002 * pg_regress.h --- regression test driver 00003 * 00004 * Portions Copyright (c) 1996-2013, PostgreSQL Global Development Group 00005 * Portions Copyright (c) 1994, Regents of the University of California 00006 * 00007 * src/test/regress/pg_regress.h 00008 *------------------------------------------------------------------------- 00009 */ 00010 00011 #include "postgres_fe.h" 00012 #include <unistd.h> 00013 00014 #ifndef WIN32 00015 #define PID_TYPE pid_t 00016 #define INVALID_PID (-1) 00017 #else 00018 #define PID_TYPE HANDLE 00019 #define INVALID_PID INVALID_HANDLE_VALUE 00020 #endif 00021 00022 /* simple list of strings */ 00023 typedef struct _stringlist 00024 { 00025 char *str; 00026 struct _stringlist *next; 00027 } _stringlist; 00028 00029 typedef PID_TYPE(*test_function) (const char *, 00030 _stringlist **, 00031 _stringlist **, 00032 _stringlist **); 00033 typedef void (*init_function) (void); 00034 00035 extern char *bindir; 00036 extern char *libdir; 00037 extern char *datadir; 00038 extern char *host_platform; 00039 00040 extern _stringlist *dblist; 00041 extern bool debug; 00042 extern char *inputdir; 00043 extern char *outputdir; 00044 extern char *launcher; 00045 00046 /* 00047 * This should not be global but every module should be able to read command 00048 * line parameters. 00049 */ 00050 extern char *psqldir; 00051 00052 extern const char *basic_diff_opts; 00053 extern const char *pretty_diff_opts; 00054 00055 int regression_main(int argc, char *argv[], 00056 init_function ifunc, test_function tfunc); 00057 void add_stringlist_item(_stringlist ** listhead, const char *str); 00058 PID_TYPE spawn_process(const char *cmdline); 00059 void replace_string(char *string, char *replace, char *replacement); 00060 bool file_exists(const char *file);