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

Commit 6651063

Browse files
committed
Allow vcregress.pl to run an arbitrary TAP test set
Currently only provision for running the bin checks in a single step is provided for. Now these tests can be run individually, as well as tests in other locations (e.g. src.test/recover). Also provide for suppressing unnecessary temp installs by setting the NO_TEMP_INSTALL environment variable just as the Makefiles do. Backpatch to 9.4.
1 parent 6872d96 commit 6651063

File tree

1 file changed

+30
-18
lines changed

1 file changed

+30
-18
lines changed

src/tools/msvc/vcregress.pl

+30-18
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
my $what = shift || "";
3636
if ($what =~
37-
/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck)$/i
37+
/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck|taptest)$/i
3838
)
3939
{
4040
$what = uc $what;
@@ -54,13 +54,6 @@
5454

5555
$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}";
5656

57-
my $schedule = shift;
58-
unless ($schedule)
59-
{
60-
$schedule = "serial";
61-
$schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/);
62-
}
63-
6457
if ($ENV{PERL5LIB})
6558
{
6659
$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}";
@@ -90,20 +83,22 @@
9083
ISOLATIONCHECK => \&isolationcheck,
9184
BINCHECK => \&bincheck,
9285
RECOVERYCHECK => \&recoverycheck,
93-
UPGRADECHECK => \&upgradecheck,);
86+
UPGRADECHECK => \&upgradecheck,
87+
TAPTEST => \&taptest,);
9488

9589
my $proc = $command{$what};
9690

9791
exit 3 unless $proc;
9892

99-
&$proc();
93+
&$proc(@_);
10094

10195
exit 0;
10296

10397
########################################################################
10498

10599
sub installcheck
106100
{
101+
my $schedule = shift || 'serial';
107102
my @args = (
108103
"../../../$Config/pg_regress/pg_regress",
109104
"--dlpath=.",
@@ -119,6 +114,7 @@ sub installcheck
119114

120115
sub check
121116
{
117+
my $schedule = shift || 'parallel';
122118
InstallTemp();
123119
chdir "${topdir}/src/test/regress";
124120
my @args = (
@@ -144,8 +140,8 @@ sub ecpgcheck
144140
exit $status if $status;
145141
InstallTemp();
146142
chdir "$topdir/src/interfaces/ecpg/test";
147-
$schedule = "ecpg";
148-
my @args = (
143+
my $schedule = "ecpg";
144+
my @args = (
149145
"../../../../$Config/pg_regress_ecpg/pg_regress_ecpg",
150146
"--bindir=",
151147
"--dbname=ecpg1_regression,ecpg2_regression",
@@ -218,6 +214,17 @@ sub bincheck
218214
exit $mstat if $mstat;
219215
}
220216

217+
sub taptest
218+
{
219+
my $dir = shift;
220+
221+
die "no tests found!" unless -d "$topdir/$dir/t";
222+
223+
InstallTemp();
224+
my $status = tap_check("$topdir/$dir");
225+
exit $status if $status;
226+
}
227+
221228
sub plcheck
222229
{
223230
chdir "../../pl";
@@ -515,7 +522,6 @@ sub fetchRegressOpts
515522
$m =~ s{\\\r?\n}{}g;
516523
if ($m =~ /^\s*REGRESS_OPTS\s*\+?=(.*)/m)
517524
{
518-
519525
# Substitute known Makefile variables, then ignore options that retain
520526
# an unhandled variable reference. Ignore anything that isn't an
521527
# option starting with "--".
@@ -588,15 +594,18 @@ sub GetTests
588594

589595
sub InstallTemp
590596
{
591-
print "Setting up temp install\n\n";
592-
Install("$tmp_installdir", "all", $config);
597+
unless ($ENV{NO_TEMP_INSTALL})
598+
{
599+
print "Setting up temp install\n\n";
600+
Install("$tmp_installdir", "all", $config);
601+
}
593602
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
594603
}
595604

596605
sub usage
597606
{
598607
print STDERR
599-
"Usage: vcregress.pl <mode> [ <schedule> ]\n\n",
608+
"Usage: vcregress.pl <mode> [ <arg>]\n\n",
600609
"Options for <mode>:\n",
601610
" bincheck run tests of utilities in src/bin/\n",
602611
" check deploy instance and run regression tests on it\n",
@@ -607,9 +616,12 @@ sub usage
607616
" modulescheck run tests of modules in src/test/modules/\n",
608617
" plcheck run tests of PL languages\n",
609618
" recoverycheck run recovery test suite\n",
619+
" taptest run an arbitrary TAP test set\n",
610620
" upgradecheck run tests of pg_upgrade\n",
611-
"\nOptions for <schedule>:\n",
621+
"\nOptions for <arg>: (used by check and installcheck)\n",
612622
" serial serial mode\n",
613-
" parallel parallel mode\n";
623+
" parallel parallel mode\n",
624+
"\nOption for <arg>: for taptest\n",
625+
" TEST_DIR (required) directory where tests reside\n";
614626
exit(1);
615627
}

0 commit comments

Comments
 (0)