2007-06-12 13:07:34 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* pg_regress.h --- regression test driver
|
|
|
|
*
|
2010-01-02 17:58:17 +01:00
|
|
|
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
2007-06-12 13:07:34 +02:00
|
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
2010-09-20 22:08:53 +02:00
|
|
|
* src/test/regress/pg_regress.h
|
2007-06-12 13:07:34 +02:00
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "postgres_fe.h"
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifndef WIN32
|
|
|
|
#define PID_TYPE pid_t
|
|
|
|
#define INVALID_PID (-1)
|
|
|
|
#else
|
|
|
|
#define PID_TYPE HANDLE
|
|
|
|
#define INVALID_PID INVALID_HANDLE_VALUE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* simple list of strings */
|
|
|
|
typedef struct _stringlist
|
|
|
|
{
|
|
|
|
char *str;
|
|
|
|
struct _stringlist *next;
|
|
|
|
} _stringlist;
|
|
|
|
|
2007-11-15 22:14:46 +01:00
|
|
|
typedef PID_TYPE(*test_function) (const char *,
|
|
|
|
_stringlist **,
|
|
|
|
_stringlist **,
|
|
|
|
_stringlist **);
|
|
|
|
typedef void (*init_function) (void);
|
2007-06-12 13:07:34 +02:00
|
|
|
|
|
|
|
extern char *bindir;
|
|
|
|
extern char *libdir;
|
|
|
|
extern char *datadir;
|
|
|
|
extern char *host_platform;
|
|
|
|
|
|
|
|
extern _stringlist *dblist;
|
|
|
|
extern bool debug;
|
|
|
|
extern char *inputdir;
|
|
|
|
extern char *outputdir;
|
2007-11-15 22:14:46 +01:00
|
|
|
|
2007-06-12 13:07:34 +02:00
|
|
|
/*
|
|
|
|
* This should not be global but every module should be able to read command
|
|
|
|
* line parameters.
|
|
|
|
*/
|
|
|
|
extern char *psqldir;
|
|
|
|
|
|
|
|
extern const char *basic_diff_opts;
|
|
|
|
extern const char *pretty_diff_opts;
|
|
|
|
|
|
|
|
int regression_main(int argc, char *argv[],
|
2007-11-15 22:14:46 +01:00
|
|
|
init_function ifunc, test_function tfunc);
|
|
|
|
void add_stringlist_item(_stringlist ** listhead, const char *str);
|
|
|
|
PID_TYPE spawn_process(const char *cmdline);
|
|
|
|
void exit_nicely(int code);
|
|
|
|
void replace_string(char *string, char *replace, char *replacement);
|
2008-10-02 00:38:57 +02:00
|
|
|
bool file_exists(const char *file);
|