Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 7acd010

Browse files
committed
Adjust behavior of some env settings for the TAP tests of MSVC
edc2332 has introduced in vcregress.pl some control on the environment variables LZ4, TAR and GZIP_PROGRAM to allow any TAP tests to be able use those commands. This makes the settings more consistent with src/Makefile.global.in, as the same default gets used for Make and MSVC builds. Each parameter can be changed in buildenv.pl, but as a default gets assigned after loading buldenv.pl, it is not possible to unset any of these, and using an empty value would not work with "||=" either. As some environments may not have a compatible command in their PATH (tar coming from MinGW is an issue, for one), this could break tests without an exit path to bypass any failing test. This commit changes things so as the default values for LZ4, TAR and GZIP_PROGRAM are assigned before loading buildenv.pl, not after. This way, we keep the same amount of compatibility as a GNU build with the same defaults, and it becomes possible to unset any of those values. While on it, this adds some documentation about those three variables in the section dedicated to the TAP tests for MSVC. Per discussion with Andrew Dunstan. Discussion: https://postgr.es/m/YbGYe483803il3X7@paquier.xyz Backpatch-through: 10
1 parent e469f0a commit 7acd010

File tree

2 files changed

+41
-7
lines changed

2 files changed

+41
-7
lines changed

doc/src/sgml/install-windows.sgml

+34
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,40 @@ $ENV{PROVE_FLAGS}='--timer --jobs 2'
517517
$ENV{PROVE_TESTS}='t/020*.pl t/010*.pl'
518518
</programlisting>
519519
</para>
520+
521+
<para>
522+
Some of the TAP tests depend on a set of external commands that would
523+
optionally trigger tests related to them. Each one of those variables
524+
can be set or unset in <filename>buildenv.pl</filename>:
525+
<variablelist>
526+
<varlistentry>
527+
<term><varname>GZIP_PROGRAM</varname></term>
528+
<listitem><para>
529+
Path to a <application>gzip</application> command. The default is
530+
<literal>gzip</literal>, that would be the command found in
531+
<varname>PATH</varname>.
532+
</para></listitem>
533+
</varlistentry>
534+
535+
<varlistentry>
536+
<term><varname>LZ4</varname></term>
537+
<listitem><para>
538+
Path to a <application>lz4</application> command. The default is
539+
<literal>lz4</literal>, that would be the command found in
540+
<varname>PATH</varname>.
541+
</para></listitem>
542+
</varlistentry>
543+
544+
<varlistentry>
545+
<term><varname>TAR</varname></term>
546+
<listitem><para>
547+
Path to a <application>tar</application> command. The default is
548+
<literal>tar</literal>, that would be the command found in
549+
<varname>PATH</varname>.
550+
</para></listitem>
551+
</varlistentry>
552+
</variablelist>
553+
</para>
520554
</sect2>
521555

522556
</sect1>

src/tools/msvc/vcregress.pl

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,13 @@
3030
do './src/tools/msvc/config_default.pl';
3131
do './src/tools/msvc/config.pl' if (-f 'src/tools/msvc/config.pl');
3232

33+
# These values are defaults that can be overridden by the calling environment
34+
# (see buildenv.pl processing below).
35+
# c.f. src/Makefile.global.in and configure.ac
36+
$ENV{GZIP_PROGRAM} ||= 'gzip';
37+
$ENV{LZ4} ||= 'lz4';
38+
$ENV{TAR} ||= 'tar';
39+
3340
# buildenv.pl is for specifying the build environment settings
3441
# it should contain lines like:
3542
# $ENV{PATH} = "c:/path/to/bison/bin;$ENV{PATH}";
@@ -67,13 +74,6 @@
6774
$ENV{with_krb_srvnam} = $config->{krb_srvnam} || 'postgres';
6875
$ENV{with_readline} = 'no';
6976

70-
# These values are defaults that can be overridden by the calling environment
71-
# (see buildenv.pl processing above).
72-
# c.f. src/Makefile.global.in and configure.ac
73-
$ENV{TAR} ||= 'tar';
74-
$ENV{LZ4} ||= 'lz4';
75-
$ENV{GZIP_PROGRAM} ||= 'gzip';
76-
7777
$ENV{PATH} = "$topdir/$Config/libpq;$ENV{PATH}";
7878

7979
if ($ENV{PERL5LIB})

0 commit comments

Comments
 (0)