34
34
35
35
my $what = shift || " " ;
36
36
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
38
38
)
39
39
{
40
40
$what = uc $what ;
54
54
55
55
$ENV {PATH } = " $topdir /$Config /libpq;$ENV {PATH}" ;
56
56
57
- my $schedule = shift ;
58
- unless ($schedule )
59
- {
60
- $schedule = " serial" ;
61
- $schedule = " parallel" if ($what eq ' CHECK' || $what =~ / PARALLEL/ );
62
- }
63
-
64
57
if ($ENV {PERL5LIB })
65
58
{
66
59
$ENV {PERL5LIB } = " $topdir /src/tools/msvc;$ENV {PERL5LIB}" ;
90
83
ISOLATIONCHECK => \&isolationcheck,
91
84
BINCHECK => \&bincheck,
92
85
RECOVERYCHECK => \&recoverycheck,
93
- UPGRADECHECK => \&upgradecheck,);
86
+ UPGRADECHECK => \&upgradecheck,
87
+ TAPTEST => \&taptest,);
94
88
95
89
my $proc = $command {$what };
96
90
97
91
exit 3 unless $proc ;
98
92
99
- &$proc ();
93
+ &$proc (@_ );
100
94
101
95
exit 0;
102
96
103
97
# #######################################################################
104
98
105
99
sub installcheck
106
100
{
101
+ my $schedule = shift || ' serial' ;
107
102
my @args = (
108
103
" ../../../$Config /pg_regress/pg_regress" ,
109
104
" --dlpath=." ,
@@ -119,6 +114,7 @@ sub installcheck
119
114
120
115
sub check
121
116
{
117
+ my $schedule = shift || ' parallel' ;
122
118
InstallTemp();
123
119
chdir " ${topdir} /src/test/regress" ;
124
120
my @args = (
@@ -144,8 +140,8 @@ sub ecpgcheck
144
140
exit $status if $status ;
145
141
InstallTemp();
146
142
chdir " $topdir /src/interfaces/ecpg/test" ;
147
- $schedule = " ecpg" ;
148
- my @args = (
143
+ my $schedule = " ecpg" ;
144
+ my @args = (
149
145
" ../../../../$Config /pg_regress_ecpg/pg_regress_ecpg" ,
150
146
" --bindir=" ,
151
147
" --dbname=ecpg1_regression,ecpg2_regression" ,
@@ -218,6 +214,17 @@ sub bincheck
218
214
exit $mstat if $mstat ;
219
215
}
220
216
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
+
221
228
sub plcheck
222
229
{
223
230
chdir " ../../pl" ;
@@ -515,7 +522,6 @@ sub fetchRegressOpts
515
522
$m =~ s {\\\r ?\n } {} g ;
516
523
if ($m =~ / ^\s *REGRESS_OPTS\s *\+ ?=(.*)/m )
517
524
{
518
-
519
525
# Substitute known Makefile variables, then ignore options that retain
520
526
# an unhandled variable reference. Ignore anything that isn't an
521
527
# option starting with "--".
@@ -588,15 +594,18 @@ sub GetTests
588
594
589
595
sub InstallTemp
590
596
{
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
+ }
593
602
$ENV {PATH } = " $tmp_installdir /bin;$ENV {PATH}" ;
594
603
}
595
604
596
605
sub usage
597
606
{
598
607
print STDERR
599
- " Usage: vcregress.pl <mode> [ <schedule> ]\n\n " ,
608
+ " Usage: vcregress.pl <mode> [ <arg> ]\n\n " ,
600
609
" Options for <mode>:\n " ,
601
610
" bincheck run tests of utilities in src/bin/\n " ,
602
611
" check deploy instance and run regression tests on it\n " ,
@@ -607,9 +616,12 @@ sub usage
607
616
" modulescheck run tests of modules in src/test/modules/\n " ,
608
617
" plcheck run tests of PL languages\n " ,
609
618
" recoverycheck run recovery test suite\n " ,
619
+ " taptest run an arbitrary TAP test set\n " ,
610
620
" upgradecheck run tests of pg_upgrade\n " ,
611
- " \n Options for <schedule>: \n " ,
621
+ " \n Options for <arg>: (used by check and installcheck) \n " ,
612
622
" serial serial mode\n " ,
613
- " parallel parallel mode\n " ;
623
+ " parallel parallel mode\n " ,
624
+ " \n Option for <arg>: for taptest\n " ,
625
+ " TEST_DIR (required) directory where tests reside\n " ;
614
626
exit (1);
615
627
}
0 commit comments