Skip to content

Commit 5bca69a

Browse files
committed
Add support for PROVE_TESTS and PROVE_FLAGS in MSVC scripts
These can be set in buildenv.pl or a "set" command within a Windows terminal. The MSVC script vcregress.pl parses the values available in the environment to build the resulting prove commands, and the parsing of PROVE_TESTS is able to handle name patterns in the same way as other platforms. Not specifying those environment values makes vcregress.pl fall back to the previous default, with no extra flags for the prove command, and all the tests run within t/. Author: Michael Paquier Reviewed-by: Juan José Santamaría Flecha, Julien Rouhaud Discussion: https://postgr.es/m/YD9GigwHoL6lFY2y@paquier.xyz
1 parent d3676a2 commit 5bca69a

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

doc/src/sgml/install-windows.sgml

+18
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,24 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib';
496496
</varlistentry>
497497
</variablelist>
498498
</para>
499+
500+
<para>
501+
The TAP tests run with <command>vcregress</command> support the
502+
environment variables <varname>PROVE_TESTS</varname>, that is expanded
503+
automatically using the name patterns given, and
504+
<varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal,
505+
before running <command>vcregress</command>:
506+
<programlisting>
507+
set PROVE_FLAGS=--timer --jobs 2
508+
set PROVE_TESTS=t/020*.pl t/010*.pl
509+
</programlisting>
510+
It is also possible to set up those parameters in
511+
<filename>buildenv.pl</filename>:
512+
<programlisting>
513+
$ENV{PROVE_FLAGS}='--timer --jobs 2'
514+
$ENV{PROVE_TESTS}='t/020*.pl t/010*.pl'
515+
</programlisting>
516+
</para>
499517
</sect2>
500518

501519
</sect1>

src/tools/msvc/vcregress.pl

+15-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,21 @@ sub tap_check
209209
my $dir = shift;
210210
chdir $dir;
211211

212-
my @args = ("prove", @flags, glob("t/*.pl"));
212+
# Fetch and adjust PROVE_TESTS, applying glob() to each element
213+
# defined to build a list of all the tests matching patterns.
214+
my $prove_tests_val = $ENV{PROVE_TESTS} || "t/*.pl";
215+
my @prove_tests_array = split(/\s+/, $prove_tests_val);
216+
my @prove_tests = ();
217+
foreach (@prove_tests_array)
218+
{
219+
push(@prove_tests, glob($_));
220+
}
221+
222+
# Fetch and adjust PROVE_FLAGS, handling multiple arguments.
223+
my $prove_flags_val = $ENV{PROVE_FLAGS} || "";
224+
my @prove_flags = split(/\s+/, $prove_flags_val);
225+
226+
my @args = ("prove", @flags, @prove_tests, @prove_flags);
213227

214228
# adjust the environment for just this test
215229
local %ENV = %ENV;

0 commit comments

Comments
 (0)