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