Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2b2a070

Browse files
committed
Remove reset of testtablespace from pg_regress on Windows
testtablespace is an extra path used as tablespace location in the mainregression test suite, computed from --outputdir as defined by thecaller of pg_regress (current directory if undefined).This special handling was introduced as off10589e to be specific toMSVC, as we let pg_regress' Makefile handle this cleanup in otherenvironments. This moves the cleanup to the MSVC script runningregression tests instead where needed: check, installcheck andupgradecheck. I have also checked this patch on MSVC with repeated runsof each target.Author: Kyotaro Horiguchi, Michael PaquierDiscussion:https://postgr.es/m/20200219.142519.437573253063431435.horikyota.ntt@gmail.com
1 parentd8b15ee commit2b2a070

File tree

2 files changed

+15
-24
lines changed

2 files changed

+15
-24
lines changed

‎src/test/regress/pg_regress.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -494,28 +494,6 @@ convert_sourcefiles_in(const char *source_subdir, const char *dest_dir, const ch
494494

495495
snprintf(testtablespace,MAXPGPATH,"%s/testtablespace",outputdir);
496496

497-
#ifdefWIN32
498-
499-
/*
500-
* On Windows only, clean out the test tablespace dir, or create it if it
501-
* doesn't exist. On other platforms we expect the Makefile to take care
502-
* of that. (We don't migrate that functionality in here because it'd be
503-
* harder to cope with platform-specific issues such as SELinux.)
504-
*
505-
* XXX it would be better if pg_regress.c had nothing at all to do with
506-
* testtablespace, and this were handled by a .BAT file or similar on
507-
* Windows. See pgsql-hackers discussion of 2008-01-18.
508-
*/
509-
if (directory_exists(testtablespace))
510-
if (!rmtree(testtablespace, true))
511-
{
512-
fprintf(stderr,_("\n%s: could not remove test tablespace \"%s\"\n"),
513-
progname,testtablespace);
514-
exit(2);
515-
}
516-
make_directory(testtablespace);
517-
#endif
518-
519497
/* finally loop on each file and do the replacement */
520498
for (name=names;*name;name++)
521499
{

‎src/tools/msvc/vcregress.pl

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ sub installcheck_internal
123123
subinstallcheck
124124
{
125125
my$schedule =shift ||'serial';
126+
127+
CleanupTablespaceDirectory();
126128
installcheck_internal($schedule);
127129
return;
128130
}
@@ -143,6 +145,7 @@ sub check
143145
"--temp-instance=./tmp_check");
144146
push(@args,$maxconn)if$maxconn;
145147
push(@args,$temp_config)if$temp_config;
148+
CleanupTablespaceDirectory();
146149
system(@args);
147150
my$status =$? >> 8;
148151
exit$statusif$status;
@@ -570,8 +573,8 @@ sub upgradecheck
570573
$ENV{PGDATA} ="$data.old";
571574
my$outputdir ="$tmp_root/regress";
572575
my@EXTRA_REGRESS_OPTS = ("--outputdir=$outputdir");
573-
mkdir"$outputdir"||die$!;
574-
mkdir"$outputdir/testtablespace" ||die$!;
576+
mkdir"$outputdir" ||die$!;
577+
CleanupTablespaceDirectory($outputdir);
575578

576579
my$logdir ="$topdir/src/bin/pg_upgrade/log";
577580
rmtree($logdir);
@@ -737,6 +740,16 @@ sub InstallTemp
737740
return;
738741
}
739742

743+
subCleanupTablespaceDirectory
744+
{
745+
my$testdir =shift || getcwd();
746+
747+
my$testtablespace ="$testdir/testtablespace";
748+
749+
rmtree($testtablespace)if (-d$testtablespace);
750+
mkdir($testtablespace);
751+
}
752+
740753
subusage
741754
{
742755
printSTDERR

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp