|
11 | 11 | * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
|
12 | 12 | * Portions Copyright (c) 1994, Regents of the University of California
|
13 | 13 | *
|
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 $ |
15 | 15 | *
|
16 | 16 | *-------------------------------------------------------------------------
|
17 | 17 | */
|
@@ -102,10 +102,8 @@ static int success_count = 0;
|
102 | 102 | static int fail_count = 0;
|
103 | 103 | static int fail_ignore_count = 0;
|
104 | 104 |
|
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); |
109 | 107 |
|
110 | 108 | static void
|
111 | 109 | header(const char *fmt,...)
|
@@ -453,11 +451,23 @@ convert_sourcefiles_in(char *source, char *dest, char *suffix)
|
453 | 451 | *c = '/';
|
454 | 452 | #endif
|
455 | 453 |
|
456 |
| - /* try to create the test tablespace dir if it doesn't exist */ |
457 | 454 | 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 | + */ |
458 | 467 | if (directory_exists(testtablespace))
|
459 | 468 | rmtree(testtablespace, true);
|
460 | 469 | make_directory(testtablespace);
|
| 470 | +#endif |
461 | 471 |
|
462 | 472 | /* finally loop on each file and do the replacement */
|
463 | 473 | for (name = names; *name; name++)
|
|
0 commit comments