|
34 | 34 |
|
35 | 35 | my $what = shift || ""; |
36 | 36 | if ($what =~ |
37 | | -/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|tapcheck)$/i |
| 37 | +/^(check|installcheck|plcheck|contribcheck|modulescheck|ecpgcheck|isolationcheck|upgradecheck|bincheck)$/i |
38 | 38 | ) |
39 | 39 | { |
40 | 40 | $what = uc $what; |
|
61 | 61 | $schedule = "parallel" if ($what eq 'CHECK' || $what =~ /PARALLEL/); |
62 | 62 | } |
63 | 63 |
|
64 | | -$ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}"; |
| 64 | +if ($ENV{PERL5LIB}) |
| 65 | +{ |
| 66 | + $ENV{PERL5LIB} = "$topdir/src/tools/msvc;$ENV{PERL5LIB}"; |
| 67 | +} |
| 68 | +else |
| 69 | +{ |
| 70 | + $ENV{PERL5LIB} = "$topdir/src/tools/msvc"; |
| 71 | +} |
65 | 72 |
|
66 | 73 | my $maxconn = ""; |
67 | 74 | $maxconn = "--max_connections=$ENV{MAX_CONNECTIONS}" |
|
81 | 88 | CONTRIBCHECK => \&contribcheck, |
82 | 89 | MODULESCHECK => \&modulescheck, |
83 | 90 | ISOLATIONCHECK => \&isolationcheck, |
84 | | - TAPCHECK => \&tapcheck, |
| 91 | + BINCHECK => \&bincheck, |
85 | 92 | UPGRADECHECK => \&upgradecheck,); |
86 | 93 |
|
87 | 94 | my $proc = $command{$what}; |
@@ -168,41 +175,43 @@ sub isolationcheck |
168 | 175 | exit $status if $status; |
169 | 176 | } |
170 | 177 |
|
171 | | -sub tapcheck |
| 178 | +sub tap_check |
172 | 179 | { |
173 | | - InstallTemp(); |
| 180 | + die "Tap tests not enabled in configuration" |
| 181 | + unless $config->{tap_tests}; |
| 182 | + |
| 183 | + my $dir = shift; |
| 184 | + chdir $dir; |
174 | 185 |
|
175 | 186 | my @args = ( "prove", "--verbose", "t/*.pl"); |
176 | | - my $mstat = 0; |
177 | 187 |
|
| 188 | + # adjust the environment for just this test |
| 189 | + local %ENV = %ENV; |
178 | 190 | $ENV{PERL5LIB} = "$topdir/src/test/perl;$ENV{PERL5LIB}"; |
179 | 191 | $ENV{PG_REGRESS} = "$topdir/$Config/pg_regress/pg_regress"; |
180 | 192 |
|
| 193 | + $ENV{TESTDIR} = "$dir"; |
| 194 | + |
| 195 | + system(@args); |
| 196 | + my $status = $? >> 8; |
| 197 | + return $status; |
| 198 | +} |
| 199 | + |
| 200 | +sub bincheck |
| 201 | +{ |
| 202 | + InstallTemp(); |
| 203 | + |
| 204 | + my $mstat = 0; |
| 205 | + |
181 | 206 | # Find out all the existing TAP tests by looking for t/ directories |
182 | 207 | # in the tree. |
183 | | - my $tap_dirs = []; |
184 | | - my @top_dir = ($topdir); |
185 | | - File::Find::find( |
186 | | - { wanted => sub { |
187 | | - /^t\z/s |
188 | | - && push(@$tap_dirs, $File::Find::name); |
189 | | - } |
190 | | - }, |
191 | | - @top_dir); |
| 208 | + my @bin_dirs = glob("$topdir/src/bin/*"); |
192 | 209 |
|
193 | 210 | # Process each test |
194 | | - foreach my $test_path (@$tap_dirs) |
| 211 | + foreach my $dir (@$bin_dirs) |
195 | 212 | { |
196 | | - # Like on Unix "make check-world", don't run the SSL test suite |
197 | | - # automatically. |
198 | | - next if ($test_path =~ /\/src\/test\/ssl\//); |
199 | | - |
200 | | - my $dir = dirname($test_path); |
201 | | - chdir $dir; |
202 | | - # Reset those values, they may have been changed by another test. |
203 | | - $ENV{TESTDIR} = "$dir"; |
204 | | - system(@args); |
205 | | - my $status = $? >> 8; |
| 213 | + next unless -d "$dir/t"; |
| 214 | + my $status = tap_check($dir); |
206 | 215 | $mstat ||= $status; |
207 | 216 | } |
208 | 217 | exit $mstat if $mstat; |
|
0 commit comments