提交 f10589e5 编写于 作者: T Tom Lane

Make pg_regress clean out the testtablespace directory only on Windows.

On other platforms it's better to let the Makefile handle it, but we want
the regression tests to be invokable without make on Windows.  A batch
file would be a better solution, but no time for that before 8.3.
Per my discovery that this breaks testing under SELinux, and subsequent
discussion.
上级 aeeef411
......@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.40 2008/01/01 19:46:00 momjian Exp $
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.41 2008/01/19 17:43:42 tgl Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -102,10 +102,8 @@ static int success_count = 0;
static int fail_count = 0;
static int fail_ignore_count = 0;
static bool
directory_exists(const char *dir);
static void
make_directory(const char *dir);
static bool directory_exists(const char *dir);
static void make_directory(const char *dir);
static void
header(const char *fmt,...)
......@@ -453,11 +451,23 @@ convert_sourcefiles_in(char *source, char *dest, char *suffix)
*c = '/';
#endif
/* try to create the test tablespace dir if it doesn't exist */
snprintf(testtablespace, MAXPGPATH, "%s/testtablespace", abs_builddir);
#ifdef WIN32
/*
* On Windows only, clean out the test tablespace dir, or create it if it
* doesn't exist. On other platforms we expect the Makefile to take
* care of that. (We don't migrate that functionality in here because
* it'd be harder to cope with platform-specific issues such as SELinux.)
*
* XXX it would be better if pg_regress.c had nothing at all to do with
* testtablespace, and this were handled by a .BAT file or similar on
* Windows. See pgsql-hackers discussion of 2008-01-18.
*/
if (directory_exists(testtablespace))
rmtree(testtablespace, true);
make_directory(testtablespace);
#endif
/* finally loop on each file and do the replacement */
for (name = names; *name; name++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册