Honor PROVE_FLAGS environment setting
authorAndrew Dunstan
Fri, 12 May 2017 15:21:20 +0000 (11:21 -0400)
committerAndrew Dunstan
Fri, 12 May 2017 15:21:20 +0000 (11:21 -0400)
On MSVC builds and on back branches that means removing the hardcoded
--verbose setting. On master for Unix that means removing the empty
setting in the global Makefile so that the value can be acquired from
the environment as well as from the make arguments.

Backpatch to 9.4 where we introduced TAP tests

src/Makefile.global.in
src/test/perl/README
src/tools/msvc/vcregress.pl

index 62fc921b8016b295008b2a01d578ec67375623b0..1c9fc2bb87c6978e45b70f6a5ca45775fe6d80ed 100644 (file)
@@ -335,7 +335,8 @@ PROVE = @PROVE@
 # There are common routines in src/test/perl, and some test suites have
 # extra perl modules in their own directory.
 PG_PROVE_FLAGS = -I $(top_srcdir)/src/test/perl/ -I $(srcdir)
-PROVE_FLAGS = --verbose
+# User-supplied prove flags such as --verbose can be provided in PROVE_FLAGS.
+
 
 # prepend to path if already set, else just set it
 define add_to_path
index 710a0d8bc3916813088c771eebd06c39558f7b19..4279d316c4d113a09e627734b0c1e099321ef0d8 100644 (file)
@@ -14,6 +14,11 @@ src/test/ssl, or should be added to one of the suites for an existing utility.
 Note that all tests and test tools should have perltidy run on them before
 patches are submitted, using perltidy --profile=src/tools/pgindent/perltidyrc
 
+By default, to keep the noise low during runs, we do not set any flags via
+PROVE_FLAGS, but this can be done on the 'make' command line if desired, eg:
+
+make check-world PROVE_FLAGS='--verbose'
+
 Writing tests
 -------------
 
index d757e176a7ab58ea6482492d70e8bf4696cc2851..dc976d00729dd2e58058fee5bef75f52b0bfe95b 100644 (file)
@@ -180,7 +180,10 @@ sub tap_check
    my $dir = shift;
    chdir $dir;
 
-   my @args = ("prove", "--verbose", "t/*.pl");
+   my @flags;
+   @flags = split(/\s+/,$ENV{PROVE_FLAGS}) if exists $ENV{PROVE_FLAGS};
+
+   my @args = ("prove", @flags, "t/*.pl");
 
    # adjust the environment for just this test
    local %ENV = %ENV;