Branch
Hash :
0e480388
Author :
Date :
2025-04-09T10:00:05
test: force Autoconf config.site to /dev/null. From https://bugs.gnu.org/76622 (automake-patches). * t/ax/test-defs.in: Set `CONFIG_SITE' to `/dev/null' to avoid the local system's Autoconf site defaults from breaking the test environment. Original report from Nelson Beebe, 26 Feb 2025. * NEWS: mention this.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283
# -*- shell-script -*-
# @configure_input@
#
# Copyright (C) 1996-2025 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# Defines and minimal setup for Automake testing environment.
# IMPORTANT NOTES AND REQUIREMENTS
# - Multiple inclusions of this file should be idempotent.
# - This code has to be 'set -e' clean.
# Ensure a consistent test environment by ignoring the system's Autoconf
# `configure` site defaults.
CONFIG_SITE=/dev/null; export CONFIG_SITE
# See whether the current test script is expected to use TAP or not.
# Use a sensible default, while allowing the scripts to override this check.
if test -z "$am_test_protocol"; then
case $argv0 in
*.tap) am_test_protocol=tap;;
*) am_test_protocol=none;;
esac
fi
am_rel_srcdir='@srcdir@'
am_top_srcdir='@abs_srcdir@'
am_top_builddir='@abs_builddir@'
# Where testsuite-related helper scripts, data files and shell libraries
# are placed.
am_testaux_srcdir=$am_top_srcdir/t/ax
am_testaux_builddir=$am_top_builddir/t/ax
# Support for the "installcheck" target.
case ${am_running_installcheck:=no} in
yes)
am_amdir='@amdir@'
am_automake_acdir='@automake_acdir@'
am_bindir='@bindir@'
am_datadir='@datadir@'
am_docdir='@docdir@'
am_pkgvdatadir='@pkgvdatadir@'
am_scriptdir='@scriptdir@'
am_system_acdir='@system_acdir@'
;;
no)
am_amdir=$am_top_srcdir/lib/am
am_automake_acdir=""
am_bindir=$am_top_builddir/bin
am_datadir=$am_top_srcdir
am_docdir=$am_top_srcdir/doc
am_pkgvdatadir=$am_top_srcdir/lib
am_scriptdir=$am_top_srcdir/lib
am_system_acdir=""
;;
*)
echo "$me: variable 'am_running_installcheck' has invalid" \
"value '$am_running_installcheck'" >&2
exit 99
;;
esac
APIVERSION='@APIVERSION@'
PATH_SEPARATOR='@PATH_SEPARATOR@'
host_alias=${host_alias-'@host_alias@'}; export host_alias
build_alias=${build_alias-'@build_alias@'}; export build_alias
# Whether the testsuite is being run by faking the presence of a C
# compiler that doesn't grasp the '-c' and '-o' flags together. By
# default, of course, it isn't.
: "${AM_TESTSUITE_SIMULATING_NO_CC_C_O:=no}"
# A concurrency-safe "mkdir -p" implementation.
MKDIR_P=${AM_TESTSUITE_MKDIR_P-'@MKDIR_P@'}
# The shell we use to run our own test scripts, determined at configure
# time. It is required in the self tests, and most importantly for the
# automatic re-execution of test scripts.
AM_TEST_RUNNER_SHELL=${AM_TEST_RUNNER_SHELL-'@AM_TEST_RUNNER_SHELL@'}
# Make sure we override the user shell. And do not read the value of
# $SHELL from the environment (think to the non-uncommon situation where
# e.g., $SHELL=/bin/tcsh).
SHELL=${AM_TESTSUITE_SHELL-'@SHELL@'}; export SHELL
# User can override various tools used. Prefer overriding specific for
# that automake testsuite, if they are available.
AWK=${AM_TESTSUITE_AWK-${AWK-'@AWK@'}}
PERL=${AM_TESTSUITE_PERL-${PERL-'@PERL@'}}
MAKE=${AM_TESTSUITE_MAKE-${MAKE-'make'}}
YACC=${AM_TESTSUITE_YACC-${YACC-'@YACC@'}}
LEX=${AM_TESTSUITE_LEX-${LEX-'@LEX@'}}
AUTOCONF=${AM_TESTSUITE_AUTOCONF-${AUTOCONF-'@am_AUTOCONF@'}}
AUTOM4TE=${AM_TESTSUITE_AUTOM4TE-${AUTOM4TE-'@am_AUTOM4TE@'}}
AUTORECONF=${AM_TESTSUITE_AUTORECONF-${AUTORECONF-'@am_AUTORECONF@'}}
AUTOHEADER=${AM_TESTSUITE_AUTOHEADER-${AUTOHEADER-'@am_AUTOHEADER@'}}
AUTOUPDATE=${AM_TESTSUITE_AUTOUPDATE-${AUTOUPDATE-'@am_AUTOUPDATE@'}}
# Tests which want complete control over aclocal or automake command-line
# options should use $am_original_ACLOCAL or $am_original_AUTOMAKE. The
# "test -z" tests take care not to re-initialize them if 'test-defs.sh'
# is re-sourced, as we want that file to remain really idempotent.
if test -z "$am_original_AUTOMAKE"; then
am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
fi
if test -z "$am_original_ACLOCAL"; then
am_original_ACLOCAL=${AM_TESTSUITE_ACLOCAL-${ACLOCAL-"aclocal-$APIVERSION"}}
fi
# Use -Werror by default. Tests for which this is inappropriate should
# use -Wno-error.
# Tests which want complete control over aclocal command-line options
# should use $am_original_ACLOCAL instead.
ACLOCAL="$am_original_ACLOCAL -Werror"
# See how Automake should be run. We put --foreign as the default
# strictness to avoid having to create lots and lots of files. A test
# can override this by specifying a different strictness. Use -Wall
# -Werror by default. Tests for which this is inappropriate (e.g. when
# testing that a warning is enabled by a specific switch) should use
# -Wnone or/and -Wno-error.
# Tests who want complete control over automake command-line options
# should use $am_original_AUTOMAKE instead.
AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror -Wall"
# POSIX no longer requires 'egrep' and 'fgrep',
# but some hosts lack 'grep -E' and 'grep -F'.
EGREP=${AM_TESTSUITE_EGREP-'@EGREP@'}
FGREP=${AM_TESTSUITE_FGREP-'@FGREP@'}
# Compilers and their flags. These can point to non-GNU compilers (and
# on non-Linux and non-BSD systems, they probably will).
if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
CC=${AM_TESTSUITE_CC-${CC-'@CC@'}}
else
CC=$am_testaux_builddir/cc-no-c-o
fi
CXX=${AM_TESTSUITE_CXX-${CXX-'@CXX@'}}
F77=${AM_TESTSUITE_F77-${F77-'@F77@'}}
FC=${AM_TESTSUITE_FC-${FC-'@FC@'}}
CFLAGS=${AM_TESTSUITE_CFLAGS-${CFLAGS-'@CFLAGS@'}}
CXXFLAGS=${AM_TESTSUITE_CXXFLAGS-${CXXFLAGS-'@CXXFLAGS@'}}
FCFLAGS=${AM_TESTSUITE_FCFLAGS-${FCFLAGS-'@FCFLAGS@'}}
FFLAGS=${AM_TESTSUITE_FFLAGS-${FFLAGS-'@FFLAGS@'}}
CPPFLAGS=${AM_TESTSUITE_CPPFLAGS-${CPPFLAGS-'@CPPFLAGS@'}}
# GNU compilers and their flags.
if test $AM_TESTSUITE_SIMULATING_NO_CC_C_O = no; then
GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
else
GNU_CC=$am_testaux_builddir/cc-no-c-o
fi
GNU_CC=${AM_TESTSUITE_GNU_CC-${GNU_CC-'@GNU_CC@'}}
GNU_CXX=${AM_TESTSUITE_GNU_CXX-${GNU_CXX-'@GNU_CXX@'}}
GNU_F77=${AM_TESTSUITE_GNU_F77-${GNU_F77-'@GNU_F77@'}}
GNU_FC=${AM_TESTSUITE_GNU_FC-${GNU_FC-'@GNU_FC@'}}
GNU_FFLAGS=${AM_TESTSUITE_GNU_FFLAGS-${GNU_FFLAGS-'@GNU_FFLAGS@'}}
GNU_FCFLAGS=${AM_TESTSUITE_GNU_FCFLAGS-${GNU_FCFLAGS-'@GNU_FCFLAGS@'}}
GNU_CXXFLAGS=${AM_TESTSUITE_GNU_CXXFLAGS-${GNU_CXXFLAGS-'@GNU_CXXFLAGS@'}}
GNU_CFLAGS=${AM_TESTSUITE_GNU_CFLAGS-${GNU_CFLAGS-'@GNU_CFLAGS@'}}
GNU_GCJ=${AM_TESTSUITE_GNU_GCJ-${GNU_GCJ-'@GNU_GCJ@'}}
GNU_GCJFLAGS=${AM_TESTSUITE_GNU_GCJFLAGS-${GNU_GCJFLAGS-'@GNU_GCJFLAGS@'}}
# Not all versions of Tex support '--version', so we use a configure
# check to decide if tex is available. This decision is embodied in
# this variable.
TEX=${AM_TESTSUITE_TEX-'@TEX@'}
# The time we should wait after modifying files depends on the platform, and
# also the capabilities of the 'automake' and 'autom4te' programs, which in
# turn depend on the capabilities of the Perl interpreter. configure has
# detected the platform's resolution for file modification times; we still
# need to check automake and autom4te.
MTIME_RESOLUTION='@MTIME_RESOLUTION@'
case $MTIME_RESOLUTION in
1 | 2) ;; # Can assume these values are usable as is.
*)
if $AUTOMAKE --version 2>&1 |
grep 'Features:.*subsecond-mtime' > /dev/null 2>&1 &&
$AUTOM4TE --version 2>&1 |
grep 'Features:.*subsecond-mtime' > /dev/null 2>&1; then
# subsecond-mtime should be supported; use the timestamp
# resolution that we determined.
if test -n "$am_cv_filesystem_timestamp_resolution"; then
#echo "$BASH_SOURCE: amftr=$am_cv_filesystem_timestamp_resolution" >&2
MTIME_RESOLUTION=$am_cv_filesystem_timestamp_resolution
elif test -n "$MTIME_RESOLUTION"; then
#echo "$BASH_SOURCE: M_R=$MTIME_RESOLUTION" >&2
# This is normal when running tests: the cache variable is
# not set, but MTIME_RESOLUTION is, because config.status is sourced.
# Its value should be usable, but because this was discovered
# just before the 1.17 release, for safety, let's set it to 1,
# and try it after the release.
MTIME_RESOLUTION=1
# If MTIME_RESOLUTION is empty too, that's weird.
else
# This message ends up in test-suite.log.
echo "$me: subsecond-mtime supported per automake and auto4mte" \
"--version, but neither am_cv_filesystem_timestamp_resolution;" \
"nor MTIME_RESOLUTION are set; that's an error somewhere." \
"Proceeding with value 1." >&2
MTIME_RESOLUTION=1
fi
else
#echo "$BASH_SOURCE: some --version doesn't support subsecond-mtime" >&2
#$AUTOMAKE --version >&2
#$AUTOM4TE --version >&2
#
MTIME_RESOLUTION=1
#
# we must not sleep for fractional seconds when autom4te does not
# support subsecond-mtimes, even when sleep supports it. See bug#67670.
am_cv_sleep_fractional_seconds=no
export am_cv_sleep_fractional_seconds
fi
;;
esac
# This sleep variable is used explicitly in tests when AC_OUTPUT is not
# used, hence config.status is not created, hence AC_CONFIG_COMMANDS_*
# is not evaluated. Originally set up here:
# https://lists.gnu.org/archive/html/bug-automake/2010-10/msg00000.html
# Discovered again in this review of the "sleep" history:
# https://lists.gnu.org/archive/html/automake/2024-06/msg00054.html
# It seems a better fix would be to have Automake (in sanity.m4) figure
# out the need for sleep even when AC_OUTPUT is not used.
#
# In general, the problem is when the mtime resolution is 1 second (or
# more) and the configure file is created less than 1 second ago, which
# happens routinely in the tests, and for many fast-enough configure
# scripts in other packages, too.
#
# At any rate, with this set to "sleep 1", there were still random
# parallelization failures; setting am_cv_sleep_fractional_seconds=no
# as above was still needed.
#
sleep="sleep $MTIME_RESOLUTION"
# An old timestamp that can be given to a file, in "touch -t" format.
# The time stamp should be portable to all file systems of interest.
# Just for fun, choose the exact time of the announcement of the GNU project
# in UTC; see <https://www.gnu.org/gnu/initial-announcement.html>.
old_timestamp=198309271735.59
# We need this in multiple tests and the wording is subject to change.
# Don't include the ${br} lines since br is not defined at this point.
#
failure_footer_text="\
See ./test-suite.log for debugging.
Some test(s) failed. Please report this to bug-automake@gnu.org,
together with the test-suite.log file (gzipped) and your system
information. Thanks."
#
# And with color.
red='[0;31m'
std='[m';
failure_footer_text_colorized="`echo \"$failure_footer_text\" | sed -e "s/^/${red}/" -e s/'$'/"${std}"/`"
# Make our wrapper script (or installed scripts, if running under
# "installcheck") accessible by default. And avoid uselessly
# extending $PATH multiple times if this file is sourced multiple times.
case $PATH in
$am_bindir$PATH_SEPARATOR*) ;;
*) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
esac
export PATH