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 = (
@@ -138,15 +134,15 @@ sub check
138
134
139
135
sub ecpgcheck
140
136
{
141
- my $msbflags = $ENV {MSBFLAGS } || " " ;
137
+ my $msbflags = $ENV {MSBFLAGS } || " " ;
142
138
chdir $startdir ;
143
139
system (" msbuild ecpg_regression.proj $msbflags /p:config=$Config " );
144
140
my $status = $? >> 8;
145
141
exit $status if $status ;
146
142
InstallTemp();
147
143
chdir " $topdir /src/interfaces/ecpg/test" ;
148
- $schedule = " ecpg" ;
149
- my @args = (
144
+ my $schedule = " ecpg" ;
145
+ my @args = (
150
146
" ../../../../$Config /pg_regress_ecpg/pg_regress_ecpg" ,
151
147
" --bindir=" ,
152
148
" --dbname=ecpg1_regression,ecpg2_regression" ,
@@ -219,6 +215,17 @@ sub bincheck
219
215
exit $mstat if $mstat ;
220
216
}
221
217
218
+ sub taptest
219
+ {
220
+ my $dir = shift ;
221
+
222
+ die " no tests found!" unless -d " $topdir /$dir /t" ;
223
+
224
+ InstallTemp();
225
+ my $status = tap_check(" $topdir /$dir " );
226
+ exit $status if $status ;
227
+ }
228
+
222
229
sub plcheck
223
230
{
224
231
chdir " ../../pl" ;
@@ -516,7 +523,6 @@ sub fetchRegressOpts
516
523
$m =~ s {\\\r ?\n } {} g ;
517
524
if ($m =~ / ^\s *REGRESS_OPTS\s *\+ ?=(.*)/m )
518
525
{
519
-
520
526
# Substitute known Makefile variables, then ignore options that retain
521
527
# an unhandled variable reference. Ignore anything that isn't an
522
528
# 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