On Wed, Mar 03, 2021 at 08:59:30PM +0100, Juan José Santamaría Flecha wrote: > This seems to me as if setting the variables in the shell is the proposed > way to do so. In the previous doc point we do the same with the buildenv.pl > file. It looks inconsistent, as if it was one way or the other, when it > could be either.
Okay, that makes sense. PROVE_TESTS is a runtime-only dependency so my guess is that most people would set that directly on the command prompt like I do, still it can be useful to enforce that in build.pl. PROVE_FLAGS can be both, but you are right that setting it in build.pl would be the most common approach. So let's document both. Attached is a proposal for that, what do you think? I have extended the example of PROVE_FLAGS to show how to set up more --jobs. -- Michael
diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index 47e5f7c8ae..b84d8ee2b1 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -496,6 +496,24 @@ $ENV{PERL5LIB}=$ENV{PERL5LIB} . ';c:\IPC-Run-0.94\lib'; </varlistentry> </variablelist> </para> + + <para> + The TAP tests run with <command>vcregress</command> support the + environment variables <varname>PROVE_TESTS</varname>, that is expanded + automatically using the name patterns given, and + <varname>PROVE_FLAGS</varname>. These can be set on a Windows terminal, + before running <command>vcregress</command>: +<programlisting> +set PROVE_FLAGS=--timer --jobs 2 +set PROVE_TESTS=t/020*.pl t/010*.pl +</programlisting> + It is also possible to set up those parameters in + <filename>buildenv.pl</filename>: +<programlisting> +$ENV{PROVE_FLAGS}=$ENV{PROVE_FLAGS} . '--timer --jobs 2' +$ENV{PROVE_TESTS}=$ENV{PROVE_TESTS} . 't/020*.pl t/010*.pl' +</programlisting> + </para> </sect2> </sect1> diff --git a/src/tools/msvc/vcregress.pl b/src/tools/msvc/vcregress.pl index 266098e193..d6c33f68ee 100644 --- a/src/tools/msvc/vcregress.pl +++ b/src/tools/msvc/vcregress.pl @@ -209,7 +209,21 @@ sub tap_check my $dir = shift; chdir $dir; - my @args = ("prove", @flags, glob("t/*.pl")); + # Fetch and adjust PROVE_TESTS, applying glob() to each element + # defined to get and list individual tests. + my $prove_tests_val = $ENV{PROVE_TESTS} || "t/*.pl"; + my @prove_tests_array = split(/\s+/, $prove_tests_val); + my @prove_tests = (); + foreach (@prove_tests_array) + { + push(@prove_tests, glob($_)); + } + + # Fetch and adjust PROVE_FLAGS, handling multiple arguments. + my $prove_flags_val = $ENV{PROVE_FLAGS} || ""; + my @prove_flags = split(/\s+/, $prove_flags_val); + + my @args = ("prove", @flags, @prove_tests, @prove_flags); # adjust the environment for just this test local %ENV = %ENV;
signature.asc
Description: PGP signature