my $what = shift || "";
if ($what =~
-/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck)$/i
+/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck|recoverycheck|taptest)$/i
)
{
$what = uc $what;
$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}";
-my $schedule = shift;
-unless ($schedule)
-{
- $schedule = "serial";
- $schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/);
-}
-
if ($ENV{PERL5LIB})
{
$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}";
ISOLATIONCHECK => \&isolationcheck,
BINCHECK => \&bincheck,
RECOVERYCHECK => \&recoverycheck,
- UPGRADECHECK => \&upgradecheck,);
+ UPGRADECHECK => \&upgradecheck,
+ TAPTEST => \&taptest,);
my $proc = $command{$what};
exit 3 unless $proc;
-&$proc();
+&$proc(@_);
exit 0;
sub installcheck
{
+ my $schedule = shift || 'serial';
my @args = (
"../../../$Config/pg_regress/pg_regress",
"--dlpath=.",
sub check
{
+ my $schedule = shift || 'parallel';
InstallTemp();
chdir "${topdir}/src/test/regress";
my @args = (
sub ecpgcheck
{
- my $msbflags = $ENV{MSBFLAGS} || "";
+ my $msbflags = $ENV{MSBFLAGS} || "";
chdir $startdir;
system("msbuild ecpg_regression.proj $msbflags /p:config=$Config");
my $status = $? >> 8;
exit $status if $status;
InstallTemp();
chdir "$topdir/src/interfaces/ecpg/test";
- $schedule = "ecpg";
- my @args = (
+ my $schedule = "ecpg";
+ my @args = (
"../../../../$Config/pg_regress_ecpg/pg_regress_ecpg",
"--bindir=",
"--dbname=ecpg1_regression,ecpg2_regression",
exit $mstat if $mstat;
}
+sub taptest
+{
+ my $dir = shift;
+
+ die "no tests found!" unless -d "$topdir/$dir/t";
+
+ InstallTemp();
+ my $status = tap_check("$topdir/$dir");
+ exit $status if $status;
+}
+
sub plcheck
{
chdir "../../pl";
$m =~ s{\\\r?\n}{}g;
if ($m =~ /^\s*REGRESS_OPTS\s*\+?=(.*)/m)
{
-
# Substitute known Makefile variables, then ignore options that retain
# an unhandled variable reference. Ignore anything that isn't an
# option starting with "--".
sub InstallTemp
{
- print "Setting up temp install\n\n";
- Install("$tmp_installdir", "all", $config);
+ unless ($ENV{NO_TEMP_INSTALL})
+ {
+ print "Setting up temp install\n\n";
+ Install("$tmp_installdir", "all", $config);
+ }
$ENV{PATH} = "$tmp_installdir/bin;$ENV{PATH}";
}
sub usage
{
print STDERR
- "Usage: vcregress.pl <mode> [ <schedule> ]\n\n",
+ "Usage: vcregress.pl <mode> [ <arg>]\n\n",
"Options for <mode>:\n",
" bincheck run tests of utilities in src/bin/\n",
" check deploy instance and run regression tests on it\n",
" modulescheck run tests of modules in src/test/modules/\n",
" plcheck run tests of PL languages\n",
" recoverycheck run recovery test suite\n",
+ " taptest run an arbitrary TAP test set\n",
" upgradecheck run tests of pg_upgrade\n",
- "\nOptions for <schedule>:\n",
+ "\nOptions for <arg>: (used by check and installcheck)\n",
" serial serial mode\n",
- " parallel parallel mode\n";
+ " parallel parallel mode\n",
+ "\nOption for <arg>: for taptest\n",
+ " TEST_DIR (required) directory where tests reside\n";
exit(1);
}