3434
3535my $what =shift ||" " ;
3636if ($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 ;
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-
6457if ($ENV {PERL5LIB })
6558{
6659$ENV {PERL5LIB } =" $topdir /src/tools/msvc;$ENV {PERL5LIB}" ;
9083ISOLATIONCHECK => \&isolationcheck,
9184BINCHECK => \&bincheck,
9285RECOVERYCHECK => \&recoverycheck,
93- UPGRADECHECK => \&upgradecheck,);
86+ UPGRADECHECK => \&upgradecheck,
87+ TAPTEST => \&taptest,);
9488
9589my $proc =$command {$what };
9690
9791exit 3unless $proc ;
9892
99- &$proc ();
93+ &$proc (@_ );
10094
10195exit 0;
10296
10397# #######################################################################
10498
10599sub installcheck
106100{
101+ my $schedule =shift ||' serial' ;
107102my @args = (
108103" ../../../$Config /pg_regress/pg_regress" ,
109104" --dlpath=." ,
@@ -119,6 +114,7 @@ sub installcheck
119114
120115sub check
121116{
117+ my $schedule =shift ||' parallel' ;
122118InstallTemp();
123119chdir " ${topdir} /src/test/regress" ;
124120my @args = (
@@ -138,15 +134,15 @@ sub check
138134
139135sub ecpgcheck
140136{
141- my $msbflags =$ENV {MSBFLAGS } ||" " ;
137+ my $msbflags =$ENV {MSBFLAGS } ||" " ;
142138chdir $startdir ;
143139system (" msbuild ecpg_regression.proj$msbflags /p:config=$Config " );
144140my $status =$? >> 8;
145141exit $status if $status ;
146142InstallTemp();
147143chdir " $topdir /src/interfaces/ecpg/test" ;
148- $schedule =" ecpg" ;
149- my @args = (
144+ my $schedule =" ecpg" ;
145+ my @args = (
150146" ../../../../$Config /pg_regress_ecpg/pg_regress_ecpg" ,
151147" --bindir=" ,
152148" --dbname=ecpg1_regression,ecpg2_regression" ,
@@ -219,6 +215,17 @@ sub bincheck
219215exit $mstat if $mstat ;
220216}
221217
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+
222229sub plcheck
223230{
224231chdir " ../../pl" ;
@@ -516,7 +523,6 @@ sub fetchRegressOpts
516523$m =~s {\\\r ?\n } {} g ;
517524if ($m =~/ ^\s *REGRESS_OPTS\s *\+ ?=(.*)/m )
518525{
519-
520526# Substitute known Makefile variables, then ignore options that retain
521527# an unhandled variable reference. Ignore anything that isn't an
522528# option starting with "--".
@@ -588,15 +594,18 @@ sub GetTests
588594
589595sub 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
596605sub usage
597606{
598607print 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- " \n Options for <schedule>: \n " ,
621+ " \n Options for <arg>: (used by check and installcheck) \n " ,
612622" 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 " ;
614626exit (1);
615627}