1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Probe $PROVE not $PERL while checking for modules needed by TAP tests.

Normally "prove" and "perl" come from the same Perl installation,
but we support the case where they don't (mainly because the MSys
buildfarm animals need this).  In that case, AX_PROG_PERL_MODULES
is completely the wrong thing to use, because it's checking what
"perl" has.  Instead, make a little TAP test script including the
required modules, and run that under "prove".

We don't need ax_prog_perl_modules.m4 at all after this change,
so remove it.

Back-patch to all supported branches, for the buildfarm's benefit.
(In v10, this also back-patches the effects of commit 264eb03aa.)

Andrew Dunstan and Tom Lane, per an observation by Noah Misch

Discussion: https://postgr.es/m/E1moZHS-0002Cu-Ei@gemulon.postgresql.org
This commit is contained in:
Tom Lane
2021-11-22 12:54:52 -05:00
parent 3ce5d0884c
commit c23796b1a6
5 changed files with 53 additions and 171 deletions

View File

@ -2216,19 +2216,25 @@ PGAC_PATH_PROGS(FOP, fop)
# Check for test tools
#
if test "$enable_tap_tests" = yes; then
# Check for necessary modules, unless user has specified the "prove" to use;
# in that case it's her responsibility to have a working configuration.
# (prove might be part of a different Perl installation than perl, eg on
# MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
if test -z "$PROVE"; then
AX_PROG_PERL_MODULES(IPC::Run, ,
AC_MSG_ERROR([Perl module IPC::Run is required to run TAP tests]))
fi
# Now make sure we know where prove is
# Make sure we know where prove is.
PGAC_PATH_PROGS(PROVE, prove)
if test -z "$PROVE"; then
AC_MSG_ERROR([prove not found])
fi
# Check for necessary Perl modules. You might think we should use
# AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
# installation than perl, eg on MSys, so we have to check using prove.
AC_MSG_CHECKING(for Perl modules required for TAP tests)
[modulestderr=`"$PROVE" "$srcdir/config/check_modules.pl" 2>&1 >/dev/null`]
if test $? -eq 0; then
# log the module version details, but don't show them interactively
echo "$modulestderr" >&AS_MESSAGE_LOG_FD
AC_MSG_RESULT(yes)
else
# on failure, though, show the results to the user
AC_MSG_RESULT([$modulestderr])
AC_MSG_ERROR([Additional Perl modules are required to run TAP tests])
fi
fi
# Thread testing