make-vcregress-run-all-tap-tests-1.patch
text/x-diff
Filename: make-vcregress-run-all-tap-tests-1.patch
Type: text/x-diff
Part: 0
Patch
Format: unified
| File | + | − |
|---|---|---|
| src/tools/msvc/vcregress.pl | 29 | 20 |
diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl
index 33d8fb5..c2f2695 100644
--- a/src/tools/msvc/vcregress.pl
+++ b/src/tools/msvc/vcregress.pl
@@ -207,7 +207,7 @@ sub tap_check
my $dir = shift;
chdir $dir;
- my @args = ("prove", @flags, "t/*.pl");
+ my @args = ("prove", @flags, glob("t/*.pl"));
# adjust the environment for just this test
local %ENV = %ENV;
@@ -391,27 +391,24 @@ sub plcheck
return;
}
+# Run tests in a specified subdirectory of current directory.
+# Returns 0 if OK, else exit code
sub subdircheck
{
my $module = shift;
- if ( !-d "$module/sql"
- || !-d "$module/expected"
- || (!-f "$module/GNUmakefile" && !-f "$module/Makefile"))
- {
- return;
- }
+ chdir($module) || return 0;
- chdir $module;
- my @tests = fetchTests();
+ my $mstat = 0;
- # Leave if no tests are listed in the module.
- if (scalar @tests == 0)
+ # Look for traditional-style regression tests.
+ if (-d "sql" && -d "expected"
+ && (-f "GNUmakefile" || -f "Makefile"))
{
- chdir "..";
- return;
- }
+ my @tests = fetchTests();
+ if (scalar @tests > 0)
+ {
my @opts = fetchRegressOpts();
# Special processing for python transform modules, see their respective
@@ -437,15 +434,29 @@ sub subdircheck
}
print "============================================================\n";
- print "Checking $module\n";
+ print "Running $module regression tests\n";
my @args = (
"$topdir/$Config/pg_regress/pg_regress",
"--bindir=${topdir}/${Config}/psql",
"--dbname=contrib_regression", @opts, @tests);
print join(' ', @args), "\n";
system(@args);
+ my $status = $? >> 8;
+ $mstat ||= $status;
+ }
+ }
+
+ # Look for TAP tests.
+ if ($config->{tap_tests} && -d "t")
+ {
+ print "============================================================\n";
+ print "Running $module TAP tests\n";
+ my $status = tap_check(getcwd());
+ $mstat ||= $status;
+ }
+
chdir "..";
- return;
+ return $mstat;
}
sub contribcheck
@@ -462,8 +473,7 @@ sub contribcheck
next if ($module =~ /_plpython$/ && !defined($config->{python}));
next if ($module eq "sepgsql");
- subdircheck($module);
- my $status = $? >> 8;
+ my $status = subdircheck($module);
$mstat ||= $status;
}
exit $mstat if $mstat;
@@ -476,8 +486,7 @@ sub modulescheck
my $mstat = 0;
foreach my $module (glob("*"))
{
- subdircheck($module);
- my $status = $? >> 8;
+ my $status = subdircheck($module);
$mstat ||= $status;
}
exit $mstat if $mstat;