Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f10589e

Browse files
committed
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.
1 parent aeeef41 commit f10589e

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

src/test/regress/pg_regress.c

+16-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.40 2008/01/01 19:46:00 momjian Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.41 2008/01/19 17:43:42 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -102,10 +102,8 @@ static int success_count = 0;
102102
static int fail_count = 0;
103103
static int fail_ignore_count = 0;
104104

105-
static bool
106-
directory_exists(const char *dir);
107-
static void
108-
make_directory(const char *dir);
105+
static bool directory_exists(const char *dir);
106+
static void make_directory(const char *dir);
109107

110108
static void
111109
header(const char *fmt,...)
@@ -453,11 +451,23 @@ convert_sourcefiles_in(char *source, char *dest, char *suffix)
453451
*c = '/';
454452
#endif
455453

456-
/* try to create the test tablespace dir if it doesn't exist */
457454
snprintf(testtablespace, MAXPGPATH, "%s/testtablespace", abs_builddir);
455+
456+
#ifdef WIN32
457+
/*
458+
* On Windows only, clean out the test tablespace dir, or create it if it
459+
* doesn't exist. On other platforms we expect the Makefile to take
460+
* care of that. (We don't migrate that functionality in here because
461+
* it'd be harder to cope with platform-specific issues such as SELinux.)
462+
*
463+
* XXX it would be better if pg_regress.c had nothing at all to do with
464+
* testtablespace, and this were handled by a .BAT file or similar on
465+
* Windows. See pgsql-hackers discussion of 2008-01-18.
466+
*/
458467
if (directory_exists(testtablespace))
459468
rmtree(testtablespace, true);
460469
make_directory(testtablespace);
470+
#endif
461471

462472
/* finally loop on each file and do the replacement */
463473
for (name = names; *name; name++)

0 commit comments

Comments
 (0)