Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb06a8e3

Browse files
committed
Improve vcregress.pl's handling of tap tests for client programs
The target is now named 'bincheck' rather than 'tapcheck' so that itreflects what is checked instead of the test mechanism. Some of thelogic is improved, making it easier to add further sets of TAP basedtests in future. Also, the environment setting logic is imrpoved.As discussed on -hackers a couple of months ago.
1 parentd5bb7c6 commitb06a8e3

File tree

1 file changed

+36
-25
lines changed

1 file changed

+36
-25
lines changed

‎src/tools/msvc/vcregress.pl

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
my$what =shift ||"";
3535
if ($what =~
36-
/^(check|installcheck|plcheck|contribcheck|ecpgcheck|isolationcheck|upgradecheck|tapcheck)$/i
36+
/^(check|installcheck|plcheck|contribcheck|ecpgcheck|isolationcheck|upgradecheck|bincheck)$/i
3737
)
3838
{
3939
$what =uc$what;
@@ -60,7 +60,14 @@
6060
$schedule ="parallel"if ($whateq'CHECK' ||$what =~/PARALLEL/);
6161
}
6262

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+
}
6471

6572
my$maxconn ="";
6673
$maxconn ="--max_connections=$ENV{MAX_CONNECTIONS}"
@@ -79,7 +86,7 @@
7986
ECPGCHECK=> \&ecpgcheck,
8087
CONTRIBCHECK=> \&contribcheck,
8188
ISOLATIONCHECK=> \&isolationcheck,
82-
TAPCHECK=> \&tapcheck,
89+
BINCHECK=> \&bincheck,
8390
UPGRADECHECK=> \&upgradecheck,);
8491

8592
my$proc =$command{$what};
@@ -165,39 +172,43 @@ sub isolationcheck
165172
exit$statusif$status;
166173
}
167174

168-
subtapcheck
175+
subtap_check
169176
{
177+
die"Tap tests not enabled in configuration"
178+
unless$config->{tap_tests};
179+
180+
my$dir =shift;
181+
chdir$dir;
182+
170183
my@args = ("prove","--verbose","t/*.pl");
171-
my$mstat = 0;
172184

185+
# adjust the environment for just this test
186+
local%ENV =%ENV;
173187
$ENV{PERL5LIB} ="$topdir/src/test/perl;$ENV{PERL5LIB}";
174188
$ENV{PG_REGRESS} ="$topdir/$Config/pg_regress/pg_regress";
175189

190+
$ENV{TESTDIR} ="$dir";
191+
192+
system(@args);
193+
my$status =$? >> 8;
194+
return$status;
195+
}
196+
197+
subbincheck
198+
{
199+
InstallTemp();
200+
201+
my$mstat = 0;
202+
176203
# Find out all the existing TAP tests by looking for t/ directories
177204
# 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/*");
187206

188207
# Process each test
189-
foreachmy$test_path (@$tap_dirs)
208+
foreachmy$dir (@$bin_dirs)
190209
{
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+
nextunless-d"$dir/t";
211+
my$status = tap_check($dir);
201212
$mstat ||=$status;
202213
}
203214
exit$mstatif$mstat;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp