Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0416c9c

Browse files
committed
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 MSysbuildfarm animals need this). In that case, AX_PROG_PERL_MODULESis completely the wrong thing to use, because it's checking what"perl" has. Instead, make a little TAP test script including therequired 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 commit264eb03.)Andrew Dunstan and Tom Lane, per an observation by Noah MischDiscussion:https://postgr.es/m/E1moZHS-0002Cu-Ei@gemulon.postgresql.org
1 parent9329593 commit0416c9c

File tree

5 files changed

+53
-179
lines changed

5 files changed

+53
-179
lines changed

‎aclocal.m4

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
dnl aclocal.m4
22
m4_include([config/ac_func_accept_argtypes.m4])
3-
m4_include([config/ax_prog_perl_modules.m4])
43
m4_include([config/ax_pthread.m4])
54
m4_include([config/c-compiler.m4])
65
m4_include([config/c-library.m4])

‎config/ax_prog_perl_modules.m4

Lines changed: 0 additions & 77 deletions
This file was deleted.

‎config/check_modules.pl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Verify that required Perl modules are available,
3+
# in at least the required minimum versions.
4+
# (The required minimum versions are all quite ancient now,
5+
# but specify them anyway for documentation's sake.)
6+
#
7+
use IPC::Run 0.79;
8+
9+
# Test::More and Time::HiRes are supposed to be part of core Perl,
10+
# but some distros omit them in a minimal installation.
11+
use Test::More 0.87;
12+
use Time::HiRes 1.52;
13+
14+
# While here, we might as well report exactly what versions we found.
15+
diag("IPC::Run::VERSION:$IPC::Run::VERSION");
16+
diag("Test::More::VERSION:$Test::More::VERSION");
17+
diag("Time::HiRes::VERSION:$Time::HiRes::VERSION");
18+
19+
ok(1);
20+
done_testing();

‎configure

Lines changed: 18 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -19259,96 +19259,7 @@ fi
1925919259
# Check for test tools
1926019260
#
1926119261
if test "$enable_tap_tests" = yes; then
19262-
# Check for necessary modules, unless user has specified the "prove" to use;
19263-
# in that case it's her responsibility to have a working configuration.
19264-
# (prove might be part of a different Perl installation than perl, eg on
19265-
# MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
19266-
if test -z "$PROVE"; then
19267-
# Test::More and Time::HiRes are supposed to be part of core Perl,
19268-
# but some distros omit them in a minimal installation.
19269-
19270-
19271-
19272-
19273-
19274-
19275-
19276-
19277-
19278-
19279-
# Make sure we have perl
19280-
if test -z "$PERL"; then
19281-
# Extract the first word of "perl", so it can be a program name with args.
19282-
set dummy perl; ac_word=$2
19283-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
19284-
$as_echo_n "checking for $ac_word... " >&6; }
19285-
if ${ac_cv_prog_PERL+:} false; then :
19286-
$as_echo_n "(cached) " >&6
19287-
else
19288-
if test -n "$PERL"; then
19289-
ac_cv_prog_PERL="$PERL" # Let the user override the test.
19290-
else
19291-
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19292-
for as_dir in $PATH
19293-
do
19294-
IFS=$as_save_IFS
19295-
test -z "$as_dir" && as_dir=.
19296-
for ac_exec_ext in '' $ac_executable_extensions; do
19297-
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19298-
ac_cv_prog_PERL="perl"
19299-
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
19300-
break 2
19301-
fi
19302-
done
19303-
done
19304-
IFS=$as_save_IFS
19305-
19306-
fi
19307-
fi
19308-
PERL=$ac_cv_prog_PERL
19309-
if test -n "$PERL"; then
19310-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5
19311-
$as_echo "$PERL" >&6; }
19312-
else
19313-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19314-
$as_echo "no" >&6; }
19315-
fi
19316-
19317-
19318-
fi
19319-
19320-
if test "x$PERL" != x; then
19321-
ax_perl_modules_failed=0
19322-
for ax_perl_module in 'IPC::Run' 'Test::More 0.87' 'Time::HiRes' ; do
19323-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for perl module $ax_perl_module" >&5
19324-
$as_echo_n "checking for perl module $ax_perl_module... " >&6; }
19325-
19326-
# Would be nice to log result here, but can't rely on autoconf internals
19327-
$PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
19328-
if test $? -ne 0; then
19329-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
19330-
$as_echo "no" >&6; };
19331-
ax_perl_modules_failed=1
19332-
else
19333-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
19334-
$as_echo "ok" >&6; };
19335-
fi
19336-
done
19337-
19338-
# Run optional shell commands
19339-
if test "$ax_perl_modules_failed" = 0; then
19340-
:
19341-
19342-
else
19343-
:
19344-
as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
19345-
fi
19346-
else
19347-
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: could not find perl" >&5
19348-
$as_echo "$as_me: WARNING: could not find perl" >&2;}
19349-
fi
19350-
fi
19351-
# Now make sure we know where prove is
19262+
# Make sure we know where prove is.
1935219263
if test -z "$PROVE"; then
1935319264
for ac_prog in prove
1935419265
do
@@ -19406,6 +19317,23 @@ fi
1940619317
if test -z "$PROVE"; then
1940719318
as_fn_error $? "prove not found" "$LINENO" 5
1940819319
fi
19320+
# Check for necessary Perl modules. You might think we should use
19321+
# AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
19322+
# installation than perl, eg on MSys, so we have to check using prove.
19323+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Perl modules required for TAP tests" >&5
19324+
$as_echo_n "checking for Perl modules required for TAP tests... " >&6; }
19325+
modulestderr=`"$PROVE" "$srcdir/config/check_modules.pl" 2>&1 >/dev/null`
19326+
if test $? -eq 0; then
19327+
# log the module version details, but don't show them interactively
19328+
echo "$modulestderr" >&5
19329+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
19330+
$as_echo "yes" >&6; }
19331+
else
19332+
# on failure, though, show the results to the user
19333+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $modulestderr" >&5
19334+
$as_echo "$modulestderr" >&6; }
19335+
as_fn_error $? "Additional Perl modules are required to run TAP tests" "$LINENO" 5
19336+
fi
1940919337
fi
1941019338

1941119339
# Thread testing

‎configure.in

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2371,21 +2371,25 @@ PGAC_PATH_PROGS(DBTOEPUB, dbtoepub)
23712371
# Check for test tools
23722372
#
23732373
if test "$enable_tap_tests" = yes; then
2374-
# Check for necessary modules, unless user has specified the "prove" to use;
2375-
# in that case it's her responsibility to have a working configuration.
2376-
# (prove might be part of a different Perl installation than perl, eg on
2377-
# MSys, so the result of AX_PROG_PERL_MODULES could be irrelevant anyway.)
2378-
if test -z "$PROVE"; then
2379-
# Test::More and Time::HiRes are supposed to be part of core Perl,
2380-
# but some distros omit them in a minimal installation.
2381-
AX_PROG_PERL_MODULES([IPC::Run Test::More=0.87 Time::HiRes], ,
2382-
[AC_MSG_ERROR([Additional Perl modules are required to run TAP tests])])
2383-
fi
2384-
# Now make sure we know where prove is
2374+
# Make sure we know where prove is.
23852375
PGAC_PATH_PROGS(PROVE, prove)
23862376
if test -z "$PROVE"; then
23872377
AC_MSG_ERROR([prove not found])
23882378
fi
2379+
# Check for necessary Perl modules. You might think we should use
2380+
# AX_PROG_PERL_MODULES here, but prove might be part of a different Perl
2381+
# installation than perl, eg on MSys, so we have to check using prove.
2382+
AC_MSG_CHECKING(for Perl modules required for TAP tests)
2383+
[modulestderr=`"$PROVE" "$srcdir/config/check_modules.pl" 2>&1 >/dev/null`]
2384+
if test $? -eq 0; then
2385+
# log the module version details, but don't show them interactively
2386+
echo "$modulestderr" >&AS_MESSAGE_LOG_FD
2387+
AC_MSG_RESULT(yes)
2388+
else
2389+
# on failure, though, show the results to the user
2390+
AC_MSG_RESULT([$modulestderr])
2391+
AC_MSG_ERROR([Additional Perl modules are required to run TAP tests])
2392+
fi
23892393
fi
23902394

23912395
# Thread testing

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp