Add PG_TEST_EXTRA configure option to the Make builds
authorHeikki Linnakangas <[email protected]>
Mon, 4 Nov 2024 12:09:38 +0000 (14:09 +0200)
committerHeikki Linnakangas <[email protected]>
Mon, 4 Nov 2024 12:09:38 +0000 (14:09 +0200)
The Meson builds have PG_TEST_EXTRA as a configure-time variable,
which was not available in the Make builds. To ensure both build
systems are in sync, PG_TEST_EXTRA is now added as a configure-time
variable. It can be set like this:

    ./configure PG_TEST_EXTRA="kerberos, ssl, ..."

Note that to preserve the old behavior, this configure-time variable
is overridden by the PG_TEST_EXTRA environment variable when you run
the tests.

Author: Jacob Champion
Reviewed by: Ashutosh Bapat, Nazir Bilal Yavuz

configure
configure.ac
src/Makefile.global.in
src/test/Makefile

index 268ac94ae69f96e525f340aca81ef07d12c49551..6e256b417b9c20af916ac2816a4208bf52d70ab7 100755 (executable)
--- a/configure
+++ b/configure
@@ -764,6 +764,7 @@ LDFLAGS
 CFLAGS
 CC
 enable_injection_points
+PG_TEST_EXTRA
 enable_tap_tests
 enable_dtrace
 DTRACEFLAGS
@@ -880,6 +881,7 @@ enable_largefile
       ac_precious_vars='build_alias
 host_alias
 target_alias
+PG_TEST_EXTRA
 CC
 CFLAGS
 LDFLAGS
@@ -1587,6 +1589,9 @@ Optional Packages:
   --with-openssl          obsolete spelling of --with-ssl=openssl
 
 Some influential environment variables:
+  PG_TEST_EXTRA
+              enable selected extra tests (overridden at runtime by
+              PG_TEST_EXTRA environment variable)
   CC          C compiler command
   CFLAGS      C compiler flags
   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
@@ -3629,6 +3634,7 @@ fi
 
 
 
+
 #
 # Injection points
 #
index 3c89b54bf12437b6d9e62849f6ad2d73b9b41f41..3992694dacce06caf108faabc5f95faf46566bed 100644 (file)
@@ -236,6 +236,8 @@ AC_SUBST(enable_dtrace)
 PGAC_ARG_BOOL(enable, tap-tests, no,
               [enable TAP tests (requires Perl and IPC::Run)])
 AC_SUBST(enable_tap_tests)
+AC_ARG_VAR(PG_TEST_EXTRA,
+           [enable selected extra tests (overridden at runtime by PG_TEST_EXTRA environment variable)])
 
 #
 # Injection points
index 42f50b497617f96a2d1d12bf391800d1aa5d7f9e..4859343153ba05135df7adbb28ee89a4324874ee 100644 (file)
@@ -642,6 +642,16 @@ submake-libpgfeutils: | submake-generated-headers
 #
 # Testing support
 
+# Store any configure-time setting for PG_TEST_EXTRA, but let environment
+# variables override it to maintain the historical behavior of the tests.
+# (Standard `=` assignment would require devs to use a commandline option.)
+# This is skipped in PGXS mode to keep the setting from escaping into other
+# projects' builds.
+ifndef PGXS
+PG_TEST_EXTRA ?= @PG_TEST_EXTRA@
+export PG_TEST_EXTRA
+endif
+
 ifneq ($(USE_MODULE_DB),)
   PL_TESTDB = pl_regression_$(NAME)
   ifneq ($(MODULE_big),)
index abdd6e5a985df1f27cfce5306a51148ba1488dcf..511a72e6238a5449de51b886ad6ae1a176daa961 100644 (file)
@@ -27,11 +27,6 @@ ifeq ($(with_ssl),openssl)
 SUBDIRS += ssl
 endif
 
-# Test suites that are not safe by default but can be run if selected
-# by the user via the whitespace-separated list in variable PG_TEST_EXTRA.
-# Export PG_TEST_EXTRA to check it in individual tap tests.
-export PG_TEST_EXTRA
-
 # We don't build or execute these by default, but we do want "make
 # clean" etc to recurse into them.  (We must filter out those that we
 # have conditionally included into SUBDIRS above, else there will be