diff options
| author | Michael Paquier | 2020-06-18 01:40:10 +0000 |
|---|---|---|
| committer | Michael Paquier | 2020-06-18 01:40:10 +0000 |
| commit | 2b2a070d98b2f2c7ecc031e582cfefa400316ce3 (patch) | |
| tree | 9506ca56330605a757758c769a40d36d14514b07 /src/tools | |
| parent | d8b15eeb8a1acbe01b502ddd3390d7f1824c7a25 (diff) | |
Remove reset of testtablespace from pg_regress on Windows
testtablespace is an extra path used as tablespace location in the main
regression test suite, computed from --outputdir as defined by the
caller of pg_regress (current directory if undefined).
This special handling was introduced as of f10589e to be specific to
MSVC, as we let pg_regress' Makefile handle this cleanup in other
environments. This moves the cleanup to the MSVC script running
regression tests instead where needed: check, installcheck and
upgradecheck. I have also checked this patch on MSVC with repeated runs
of each target.
Author: Kyotaro Horiguchi, Michael Paquier
Discussion: https://postgr.es/m/20200219.142519.437573253063431435.horikyota.ntt@gmail.com
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/msvc/vcregress.pl | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 3365ee578c3..d6763ad4ac5 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -123,6 +123,8 @@ sub installcheck_internal sub installcheck { my $schedule = shift || 'serial'; + + CleanupTablespaceDirectory(); installcheck_internal($schedule); return; } @@ -143,6 +145,7 @@ sub check "--temp-instance=./tmp_check"); push(@args, $maxconn) if $maxconn; push(@args, $temp_config) if $temp_config; + CleanupTablespaceDirectory(); system(@args); my $status = $? >> 8; exit $status if $status; @@ -570,8 +573,8 @@ sub upgradecheck $ENV{PGDATA} = "$data.old"; my $outputdir = "$tmp_root/regress"; my @EXTRA_REGRESS_OPTS = ("--outputdir=$outputdir"); - mkdir "$outputdir" || die $!; - mkdir "$outputdir/testtablespace" || die $!; + mkdir "$outputdir" || die $!; + CleanupTablespaceDirectory($outputdir); my $logdir = "$topdir/src/bin/pg_upgrade/log"; rmtree($logdir); @@ -737,6 +740,16 @@ sub InstallTemp return; } +sub CleanupTablespaceDirectory +{ + my $testdir = shift || getcwd(); + + my $testtablespace = "$testdir/testtablespace"; + + rmtree($testtablespace) if (-d $testtablespace); + mkdir($testtablespace); +} + sub usage { print STDERR |
