/doc/automake*.dvi
/doc/automake*.pdf
/doc/automake*.ps
+/doc/automake*.t2d/
+/doc/automake*.t2p/
/doc/automake*.1
/doc/aclocal*.1
/doc/stamp-vti
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+ifeq ($(filter bootstrap,$(MAKECMDGOALS)),)
+
ifeq ($(wildcard Makefile),)
- ifeq ($(filter bootstrap,$(MAKECMDGOALS)),bootstrap)
- # Allow the user (or more likely the developer) to ask for a bootstrap
- # of the package; of course, this can happen before configure is run,
- # and in fact even before it is created.
- else
- # Else, If the user runs GNU make but has not yet run ./configure,
- # give them an helpful diagnostic instead of a cryptic error.
- $(warning There seems to be no Makefile in this directory.)
- $(warning You must run ./configure before running 'make'.)
- $(error Fatal Error)
- endif
-else
- include ./Makefile
- include $(srcdir)/syntax-checks.mk
+ # Any target but 'bootstrap' specified in an unconfigured tree
+ # is an error, even when the user is running GNU make.
+ $(warning There seems to be no Makefile in this directory.)
+ $(warning You must run ./configure before running 'make'.)
+ $(error Fatal Error)
endif
+include ./Makefile
+include $(srcdir)/syntax-checks.mk
+
+else # ! bootstrap in $(MAKECMDGOALS)
+
+other-targets := $(filter-out bootstrap,$(MAKECMDGOALS))
+config-status := $(wildcard ./config.status)
-# To allow bootstrapping also in an unconfigured tree.
-srcdir ?= .
-am__cd ?= CDPATH=. && unset CDPATH && cd
-AM_DEFAULT_VERBOSITY ?= 0
-V ?= $(AM_DEFAULT_VERBOSITY)
+BOOTSTRAP_SHELL ?= /bin/sh
+export BOOTSTRAP_SHELL
-ifeq ($(V),0)
- AM_V_BOOTSTRAP = @echo " BOOTSTRAP";
- AM_V_CONFIGURE = @echo " CONFIGURE";
- AM_V_REMAKE = @echo " REMAKE";
-else
- AM_V_BOOTSTRAP =
- AM_V_CONFIGURE =
- AM_V_REMAKE =
+# Allow the user (or more likely the developer) to ask for a bootstrap
+# of the package.
+#
+# Two issues that must be kept in mind in the implementation below:
+#
+# [1] "make bootstrap" can be invoked before 'configure' is run (and in
+# fact, even before it is created, if we are bootstrapping from a
+# freshly-cloned checkout).
+#
+# [2] When re-bootstrapping an already configured tree, we must ensure
+# that the automatic remake rules for Makefile and company do not
+# kick in, because the tree might be in an inconsistent state (e.g.,
+# we have just switched from 'maint' to 'master', and have the built
+# 'automake' script left from 'maint', but the files 'lib/am/*.am'
+# are from 'master': if 'automake' gets run and used those files --
+# boom!).
+
+ifdef config-status # Bootstrap from an already-configured tree.
+ # We need the definition of $(srcdir) in the 'bootstrap' rule
+ # below.
+ srcdir := $(shell echo @srcdir@ | $(config-status) --file=-)
+ ifndef srcdir
+ $(error Could not obtain $$(srcdir) from $(config-status))
+ endif
+ # Also, if we are re-bootstrapping an already-configured tree, we
+ # want to re-configure it with the same pre-existing configuration.
+ old-configure-flags := $(shell $(config-status) --config)
+else # Assume we are bootstrapping from an unconfigured srcdir.
+ srcdir := .
+ old-configure-flags :=
endif
-# Must be phony, not to be confused with the 'bootstrap' script.
+configure-flags := $(old-configure-flags) $(BOOTSTRAP_CONFIGURE_FLAGS)
+
.PHONY: bootstrap
bootstrap:
- $(AM_V_BOOTSTRAP)$(am__cd) $(srcdir) && ./bootstrap.sh
- $(AM_V_CONFIGURE)set -e; \
- am__bootstrap_configure () { \
- $(srcdir)/configure $${1+"$$@"} $(BOOTSTRAP_CONFIGURE_FLAGS); \
- }; \
- if test -f $(srcdir)/config.status; then \
- : config.status should return a string properly quoted for eval; \
- old_configure_flags=`$(srcdir)/config.status --config`; \
- else \
- old_configure_flags=""; \
- fi; \
- eval am__bootstrap_configure "$$old_configure_flags"
- # The "make check" below is to ensure all the testsuite-required
- # files are rebuilt.
- $(AM_V_REMAKE)$(MAKE) clean && $(MAKE) check TESTS=t/get-sysconf
+ cd $(srcdir) && $(SHELL) ./bootstrap.sh
+ $(srcdir)/configure $(configure-flags)
+ $(MAKE) clean
+ $(MAKE) check TESTS=t/get-sysconf
+
+# Ensure that all the specified targets but 'bootstrap' (if any) are
+# run with a properly re-bootstrapped tree.
+ifdef other-targets
+$(other-targets): restart
+.PHONY: $(other-targets) restart
+restart: bootstrap; $(MAKE) $(AM_MAKEFLAGS) $(other-targets)
+endif
+
+endif # ! bootstrap in $(MAKECMDGOALS)
AM_TAP_LOG_DRIVER_FLAGS = --merge
-EXTRA_DIST += t/README t/ax/is
+EXTRA_DIST += t/README t/ax/is t/ax/is_newest
TESTS = ## Will be updated later.
# Static dependencies valid for each test case.
check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION)
-dist_check_DATA = t/ax/plain-functions.sh t/ax/tap-functions.sh
-check_DATA = defs defs-static
+dist_check_DATA = \
+ t/ax/test-init.sh \
+ t/ax/plain-functions.sh \
+ t/ax/tap-functions.sh
+nodist_check_DATA = defs-static
# Few more static dependencies.
t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
- Autoconf 2.65 or greater is required.
+ - The rules to build PDF and DVI output from Texinfo input now
+ requires Texinfo 4.9 or later.
+
* Obsolete features removed:
- Use of the long-deprecated two- and three-arguments invocation forms
backward-compatibility only. In particular, its use does not disable
the warnings in the 'portability-recursive' category anymore.
+* Texinfo Support:
+
+ - The rules to build PDF and DVI files from Texinfo input now use the
+ ' --build-dir' option, to keep the auxiliary files used by texi2dvi
+ and texi2pdf around without cluttering the build directory, and to
+ make it possible to run the "dvi" and "pdf" recipes in parallel.
+
* Automatic remake rules and 'missing' script:
- The 'missing' script does not try anymore to update the timestamp
## Handling Texinfo files. ##
## ------------------------ ##
-# ($OUTFILE, $VFILE, @CLEAN_FILES)
+# ($OUTFILE, $VFILE)
# &scan_texinfo_file ($FILENAME)
# ------------------------------
# $OUTFILE - name of the info file produced by $FILENAME.
# $VFILE - name of the version.texi file used (undef if none).
-# @CLEAN_FILES - list of byproducts (indexes etc.)
sub scan_texinfo_file ($)
{
my ($filename) = @_;
- # Some of the following extensions are always created, no matter
- # whether indexes are used or not. Other (like cps, fns, ... pgs)
- # are only created when they are used. We used to scan $FILENAME
- # for their use, but that is not enough: they could be used in
- # included files. We can't scan included files because we don't
- # know the include path. Therefore we always erase these files, no
- # matter whether they are used or not.
- #
- # (tmp is only created if an @macro is used and a certain e-TeX
- # feature is not available.)
- my %clean_suffixes =
- map { $_ => 1 } (qw(aux log toc tmp
- cp cps
- fn fns
- ky kys
- vr vrs
- tp tps
- pg pgs)); # grep 'new.*index' texinfo.tex
-
my $texi = new Automake::XFile "< $filename";
verb "reading $filename";
{
$vfile = $1;
}
-
- # Try to find new or unused indexes.
-
- # Creating a new category of index.
- elsif (/^\@def(code)?index (\w+)/)
- {
- $clean_suffixes{$2} = 1;
- $clean_suffixes{"$2s"} = 1;
- }
-
- # Merging an index into an another.
- elsif (/^\@syn(code)?index (\w+) (\w+)/)
- {
- delete $clean_suffixes{"$2s"};
- $clean_suffixes{"$3s"} = 1;
- }
-
}
if (! $outfile)
my $infobase = basename ($filename);
$infobase =~ s/\.te?xi(nfo)?$//;
- return ($outfile, $vfile,
- map { "$infobase.$_" } (sort keys %clean_suffixes));
+ return ($outfile, $vfile);
}
# If 'version.texi' is referenced by input file, then include
# automatic versioning capability.
- my ($out_file, $vtexi, @clean_files) =
+ my ($out_file, $vtexi) =
scan_texinfo_file ("$relative_dir/$texi")
or next;
- push (@mostly_cleans, @clean_files);
+ # Directory of auxiliary files and build by-products used by texi2dvi
+ # and texi2pdf.
+ push @mostly_cleans, "$relative_dir/$infobase.t2d";
+ push @mostly_cleans, "$relative_dir/$infobase.t2p";
# If the Texinfo source is in a subdirectory, create the
# resulting info in this subdirectory. If it is in the current
# - replaces %KEY% with $VAL,
# - enables/disables ?KEY? and ?!KEY?,
# - replaces %?KEY% with TRUE or FALSE.
-# - replaces %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE% with
-# IFTRUE / IFFALSE, as appropriate.
sub transform ($$)
{
my ($token, $transform) = @_;
{
return transform_token ($token, $transform, $1);
}
- # %KEY?IFTRUE%, %KEY:IFFALSE%, and %KEY?IFTRUE:IFFALSE%.
- elsif ($token =~ /^%([\w\-]+)(?:\?([^?:%]+))?(?::([^?:%]+))?%$/)
- {
- return transform_token ($token, $transform, $1) ? ($2 || '') : ($3 || '');
- }
# %?KEY%.
elsif ($token =~ /^%\?([\w\-]+)%$/)
{
# Substitute Automake template tokens.
s/(?: % \?? [\w\-]+ %
- | % [\w\-]+ (?:\?[^?:%]+)? (?::[^?:%]+)? %
| \? !? [\w\-]+ \?
)/transform($&, \%transform)/gex;
# transform() may have added some ##%-comments to strip.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-########################################################
-### IMPORTANT NOTE: keep this file 'set -e' clean. ###
-########################################################
-
-# NOTE: This file should execute correctly with any system's /bin/sh
-# shell, and not only with configure-time detected $AM_TEST_RUNNER_SHELL,
-# *until differently and explicitly specified*.
-
-## -------------------------------------------------------- ##
-## Source static setup and definitions for the testsuite. ##
-## -------------------------------------------------------- ##
-
-# Ensure we are running from the right directory.
-test -f ./defs-static || {
- echo "$0: ./defs-static: not found in current directory" >&2
- exit 99
-}
-
-# Source the shell sanitization and variables' definitions.
-. ./defs-static || exit 99
-
-# Enable the errexit shell flag early.
-set -e
-
-# The name of the current test (without the '.sh' or '.tap' suffix).
-# Test scripts can override it if they need to (but this should
-# be done carefully, and *before* including ./defs).
-if test -z "$me"; then
- # Guard against failure to spawn sed (seen on MSYS), or empty $argv0.
- me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.sh$//;s/\.tap$//'` \
- && test -n "$me" \
- || { echo "$argv0: failed to define \$me" >&2; exit 99; }
-fi
-
-## ---------------------- ##
-## Early sanity checks. ##
-## ---------------------- ##
-
-# A single whitespace character.
-sp=' '
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
-
-# As autoconf-generated configure scripts do, ensure that IFS
-# is defined initially, so that saving and restoring $IFS works.
-IFS=$sp$tab$nl
-
-# Ensure $am_top_srcdir is set correctly.
-test -f "$am_top_srcdir/defs-static.in" || {
- echo "$me: $am_top_srcdir/defs-static.in not found," \
- "check \$am_top_srcdir" >&2
- exit 99
-}
-
-# Ensure $am_top_builddir is set correctly.
-test -f "$am_top_builddir/defs-static" || {
- echo "$me: $am_top_builddir/defs-static not found," \
- "check \$am_top_builddir" >&2
- exit 99
-}
-
-
-## ------------------------------------ ##
-## Ensure we run with a proper shell. ##
-## ------------------------------------ ##
-
-# Make sure we run with the shell detected at configure time (unless
-# the user forbids it).
+# *** IMPORTANT NOTE ***
+# This file should execute correctly with any system's /bin/sh (which
+# might be just a Bourne shell, non POSIX-conforming, like on Solaris
+# up to version 11 at least).
+
+# Source the shell static setup and variable definitions.
+. ./defs-static
+test $? -eq 0 || exit 99
+
+# Make sure we run with the shell detected at configure time or forced
+# by the user (unless the user forbids it). That is assumed to be a
+# proper POSIX shell.
case ${AM_TESTS_REEXEC-yes} in
n|no|false|0)
;;
*)
# Ensure we can find ourselves.
if test ! -f "$0"; then
- echo "$me: unable to find myself: $0" >&2
+ echo "$0: unable to find myself" >&2
exit 99
fi
AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
*x*) opts=-x;;
*) opts=;;
esac
- echo $me: exec $AM_TEST_RUNNER_SHELL $opts "$0" "$*"
- exec $AM_TEST_RUNNER_SHELL $opts "$0" ${1+"$@"} || {
- echo "$me: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
- exit 99
- }
+ echo exec $AM_TEST_RUNNER_SHELL $opts "$0" "$*"
+ exec $AM_TEST_RUNNER_SHELL $opts "$0" ${1+"$@"}
+ # This should be dead code, unless some strange error happened.
+ echo "$0: failed to re-execute with $AM_TEST_RUNNER_SHELL" >&2
+ exit 99
;;
esac
-# NOTE: From this point on, we can assume this file is being executed
-# by the configure-time detected $AM_TEST_RUNNER_SHELL.
-
-
-## ----------------------- ##
-## Early debugging info. ##
-## ----------------------- ##
-
-echo "Running from installcheck: $am_running_installcheck"
-echo "Using TAP: $am_using_tap"
-echo "PATH = $PATH"
-
-
-## ---------------------- ##
-## Environment cleanup. ##
-## ---------------------- ##
-
-# Temporarily disable this, since some shells (e.g., older version
-# of Bash) can return a non-zero exit status upon the when a non-set
-# variable is unset.
-set +e
-
-# Unset some make-related variables that may cause $MAKE to act like
-# a recursively invoked sub-make. Any $MAKE invocation in a test is
-# conceptually an independent invocation, not part of the main
-# 'automake' build.
-unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL
-unset __MKLVL__ MAKE_JOBS_FIFO # For BSD make.
-unset DMAKE_CHILD DMAKE_DEF_PRINTED DMAKE_MAX_JOBS # For Solaris dmake.
-# Unset verbosity flag.
-unset V
-# Also unset variables that will let "make -e install" divert
-# files into unwanted directories.
-unset DESTDIR
-unset prefix exec_prefix bindir datarootdir datadir docdir dvidir
-unset htmldir includedir infodir libdir libexecdir localedir mandir
-unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir
-# Unset variables that might change the "make distcheck" behaviour.
-unset DISTCHECK_CONFIGURE_FLAGS AM_DISTCHECK_CONFIGURE_FLAGS
-# Used by install rules for info files.
-unset AM_UPDATE_INFO_DIR
-# The tests call "make -e" but we do not want $srcdir from the environment
-# to override the definition from the Makefile.
-unset srcdir
-# Also unset variables that control our test driver. While not
-# conceptually independent, they cause some changed semantics we
-# need to control (and test for) in some of the tests to ensure
-# backward-compatible behavior.
-unset TESTS_ENVIRONMENT AM_TESTS_ENVIRONMENT
-unset DISABLE_HARD_ERRORS
-unset AM_COLOR_TESTS
-unset TESTS
-unset XFAIL_TESTS
-unset TEST_LOGS
-unset TEST_SUITE_LOG
-unset RECHECK_LOGS
-unset VERBOSE
-for pfx in TEST_ SH_ TAP_ ''; do
- unset ${pfx}LOG_COMPILER
- unset ${pfx}LOG_COMPILE # Not a typo!
- unset ${pfx}LOG_FLAGS
- unset AM_${pfx}LOG_FLAGS
- unset ${pfx}LOG_DRIVER
- unset ${pfx}LOG_DRIVER_FLAGS
- unset AM_${pfx}LOG_DRIVER_FLAGS
-done
-unset pfx
-
-# Re-enable, it had been temporarily disabled above.
-set -e
-
-## ---------------------------- ##
-## Auxiliary shell functions. ##
-## ---------------------------- ##
-
-# Tell whether we should keep the test directories around, even in
-# case of success. By default, we don't.
-am_keeping_testdirs ()
-{
- case $keep_testdirs in
- ""|n|no|NO) return 1;;
- *) return 0;;
- esac
-}
-
-# This is used in 'Exit' and in the exit trap. See comments in the latter
-# for more information,
-am__test_skipped=no
-
-# We use a trap below for cleanup. This requires us to go through
-# hoops to get the right exit status transported through the signal.
-# So use "Exit STATUS" instead of "exit STATUS" inside of the tests.
-# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
-# sh inside this function.
-Exit ()
-{
- set +e
- # See comments in the exit trap for the reason we do this.
- test 77 = $1 && am__test_skipped=yes
- (exit $1); exit $1
-}
-
-if test $am_using_tap = yes; then
- am_funcs_file=tap-functions.sh
-else
- am_funcs_file=plain-functions.sh
-fi
-
-if test -f "$am_testauxdir/$am_funcs_file"; then
- . "$am_testauxdir/$am_funcs_file" || {
- echo "$me: error sourcing $am_testauxdir/$am_funcs_file" >&2
- Exit 99
- }
-else
- echo "$me: $am_testauxdir/$am_funcs_file not found" >&2
- Exit 99
-fi
-unset am_funcs_file
-
-# cross_compiling
-# ---------------
-# Tell whether we are cross-compiling. This is especially useful to skip
-# tests (or portions of them) that requires a native compiler.
-cross_compiling ()
-{
- # Quoting from the autoconf manual:
- # ... [$host_alias and $build both] default to the result of running
- # config.guess, unless you specify either --build or --host. In
- # this case, the default becomes the system type you specified.
- # If you specify both, *and they're different*, configure enters
- # cross compilation mode (so it doesn't run any tests that require
- # execution).
- test x"$host_alias" != x && test x"$build_alias" != x"$host_alias"
-}
-
-# is_newest FILE FILES
-# --------------------
-# Return false if any file in FILES is newer than FILE.
-# Resolve ties in favor of FILE.
-is_newest ()
-{
- is_newest_files=`find "$@" -prune -newer "$1"`
- test -z "$is_newest_files"
-}
-
-# is_blocked_signal SIGNAL-NUMBER
-# --------------------------------
-# Return success if the given signal number is blocked in the shell,
-# return a non-zero exit status and print a proper diagnostic otherwise.
-is_blocked_signal ()
-{
- # Use perl, since trying to do this portably in the shell can be
- # very tricky, if not downright impossible. For reference, see:
- # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
- if $PERL -w -e '
- use strict;
- use warnings FATAL => "all";
- use POSIX;
- my %oldsigaction = ();
- sigaction('"$1"', 0, \%oldsigaction);
- exit ($oldsigaction{"HANDLER"} eq "IGNORE" ? 0 : 77);
- '; then
- return 0
- elif test $? -eq 77; then
- return 1
- else
- fatal_ "couldn't determine whether signal $1 is blocked"
- fi
-}
-
-# AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
-# -----------------------------------------------------------------
-# Run automake with AUTOMAKE-ARGS, and fail if it doesn't exit with
-# STATUS. Should be polymorphic for TAP and "plain" tests. The
-# DESCRIPTION, when provided, is used for console reporting, only if
-# the TAP protocol is in use in the current test script.
-AUTOMAKE_run ()
-{
- am__desc=
- am__exp_rc=0
- while test $# -gt 0; do
- case $1 in
- -d) am__desc=$2; shift;;
- -e) am__exp_rc=$2; shift;;
- --) shift; break;;
- # Don't fail on unknown option: assume they (and the rest of the
- # command line) are to be passed verbatim to automake (so stop our
- # own option parsing).
- *) break;;
- esac
- shift
- done
- am__got_rc=0
- $AUTOMAKE ${1+"$@"} >stdout 2>stderr || am__got_rc=$?
- cat stderr >&2
- cat stdout
- if test $am_using_tap != yes; then
- test $am__got_rc -eq $am__exp_rc || Exit 1
- return
- fi
- if test -z "$am__desc"; then
- if test $am__got_rc -eq $am__exp_rc; then
- am__desc="automake exited $am__got_rc"
- else
- am__desc="automake exited $am__got_rc, expecting $am__exp_rc"
- fi
- fi
- command_ok_ "$am__desc" test $am__got_rc -eq $am__exp_rc
-}
-
-# AUTOMAKE_fails [-d DESCRIPTION] [OPTIONS...]
-# --------------------------------------------
-# Run automake with OPTIONS, and fail if doesn't exit with status 1.
-# Should be polymorphic for TAP and "plain" tests. The DESCRIPTION,
-# when provided, is used for console reporting, only if the TAP
-# protocol is in use in the current test script.
-AUTOMAKE_fails ()
-{
- AUTOMAKE_run -e 1 ${1+"$@"}
-}
-
-# extract_configure_help { --OPTION | VARIABLE-NAME } [FILES]
-# -----------------------------------------------------------
-# Use this to extract from the output of "./configure --help" (or similar)
-# the description or help message associated to the given --OPTION or
-# VARIABLE-NAME.
-extract_configure_help ()
-{
- am__opt_re='' am__var_re=''
- case $1 in
- --*'=') am__opt_re="^ $1";;
- --*'[=]') am__opt_re='^ '`printf '%s\n' "$1" | sed 's/...$//'`'\[=';;
- --*) am__opt_re="^ $1( .*|$)";;
- *) am__var_re="^ $1( .*|$)";;
- esac
- shift
- if test x"$am__opt_re" != x; then
- LC_ALL=C awk '
- /'"$am__opt_re"'/ { print; do_print = 1; next; }
- /^$/ { do_print = 0; next }
- /^ --/ { do_print = 0; next }
- (do_print == 1) { print }
- ' ${1+"$@"}
- else
- LC_ALL=C awk '
- /'"$am__var_re"'/ { print; do_print = 1; next; }
- /^$/ { do_print = 0; next }
- /^ [A-Z][A-Z0-9_]* / { do_print = 0; next }
- /^ [A-Z][A-Z0-9_]*$/ { do_print = 0; next }
- (do_print == 1) { print }
- ' ${1+"$@"}
- fi
-}
-
-# grep_configure_help { --OPTION | VARIABLE-NAME } REGEXP
-# -------------------------------------------------------
-# Grep the section of "./configure --help" output associated with either
-# --OPTION or VARIABLE-NAME for the given *extended* regular expression.
-grep_configure_help ()
-{
- ./configure --help > am--all-help \
- || { cat am--all-help; Exit 1; }
- cat am--all-help
- extract_configure_help "$1" am--all-help > am--our-help \
- || { cat am--our-help; Exit 1; }
- cat am--our-help
- $EGREP "$2" am--our-help || Exit 1
-}
-
-# using_gmake
-# -----------
-# Return success if $MAKE is GNU make, return failure otherwise.
-# Caches the result for speed reasons.
-using_gmake ()
-{
- case $am__using_gmake in
- yes)
- return 0;;
- no)
- return 1;;
- '')
- # Use --version AND -v, because SGI Make doesn't fail on --version.
- # Also grep for GNU because newer versions of FreeBSD make do
- # not complain about --version (they seem to silently ignore it).
- if $MAKE --version -v | grep GNU; then
- am__using_gmake=yes
- return 0
- else
- am__using_gmake=no
- return 1
- fi;;
- *)
- fatal_ "invalid value for \$am__using_gmake: '$am__using_gmake'";;
- esac
-}
-am__using_gmake="" # Avoid interferences from the environment.
-
-# make_can_chain_suffix_rules
-# ---------------------------
-# Return 0 if $MAKE is a make implementation that can chain suffix rules
-# automatically, return 1 otherwise. Caches the result for speed reasons.
-make_can_chain_suffix_rules ()
-{
- if test -z "$am__can_chain_suffix_rules"; then
- if using_gmake; then
- am__can_chain_suffix_rules=yes
- return 0
- else
- mkdir am__chain.dir$$
- cd am__chain.dir$$
- unindent > Makefile << 'END'
- .SUFFIXES: .u .v .w
- .u.v: ; cp $< $@
- .v.w: ; cp $< $@
-END
- echo make can chain suffix rules > foo.u
- if $MAKE foo.w && diff foo.u foo.w; then
- am__can_chain_suffix_rules=yes
- else
- am__can_chain_suffix_rules=no
- fi
- cd ..
- rm -rf am__chain.dir$$
- fi
- fi
- case $am__can_chain_suffix_rules in
- yes) return 0;;
- no) return 1;;
- *) fatal_ "make_can_chain_suffix_rules: internal error";;
- esac
-}
-am__can_chain_suffix_rules="" # Avoid interferences from the environment.
-
-# useless_vpath_rebuild
-# ---------------------
-# Tell whether $MAKE suffers of the bug triggering automake bug#7884.
-# For example, this happens with FreeBSD make, since in a VPATH build
-# it tends to rebuilt files for which there is an explicit or even just
-# a suffix rule, even if said files are already available in the VPATH
-# directory.
-useless_vpath_rebuild ()
-{
- if test -z "$am__useless_vpath_rebuild"; then
- if using_gmake; then
- am__useless_vpath_rebuild=no
- return 1
- fi
- mkdir am__vpath.dir$$
- cd am__vpath.dir$$
- touch foo.a foo.b bar baz
- mkdir build
- cd build
- unindent > Makefile << 'END'
- .SUFFIXES: .a .b
- VPATH = ..
- all: foo.b baz
- .PHONY: all
- .a.b: ; cp $< $@
- baz: bar ; cp ../baz bar
-END
- if $MAKE all && test ! -f foo.b && test ! -f bar; then
- am__useless_vpath_rebuild=no
- else
- am__useless_vpath_rebuild=yes
- fi
- cd ../..
- rm -rf am__vpath.dir$$
- fi
- case $am__useless_vpath_rebuild in
- yes) return 0;;
- no) return 1;;
- "") ;;
- *) fatal_ "no_useless_builddir_remake: internal error";;
- esac
-}
-am__useless_vpath_rebuild=""
-
-yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
-
-# seq_ - print a sequence of numbers
-# ----------------------------------
-# This function simulates GNU seq(1) portably. Valid usages:
-# - seq LAST
-# - seq FIRST LAST
-# - seq FIRST INCREMENT LAST
-seq_ ()
-{
- case $# in
- 0) fatal_ "seq_: missing argument";;
- 1) seq_first=1 seq_incr=1 seq_last=$1;;
- 2) seq_first=$1 seq_incr=1 seq_last=$2;;
- 3) seq_first=$1 seq_incr=$2 seq_last=$3;;
- *) fatal_ "seq_: too many arguments";;
- esac
- # Try to avoid forks if possible.
- case "$BASH_VERSION" in
- ""|[12].*)
- : Not bash, or a too old bash version. ;;
- *)
- # Use eval to protect dumber shells from parsing errors.
- eval 'for ((i = seq_first; i <= seq_last; i += seq_incr)); do
- echo $i
- done'
- return 0;;
- esac
- # Else, use GNU seq if available.
- seq "$@" && return 0
- # Otherwise revert to a slower loop using expr(1).
- i=$seq_first
- while test $i -le $seq_last; do
- echo $i
- i=`expr $i + $seq_incr`
- done
-}
-
-# rm_rf_ [FILES OR DIRECTORIES ...]
-# ---------------------------------
-# Recursively remove the given files or directory, also handling the case
-# of non-writable subdirectories.
-rm_rf_ ()
-{
- test $# -gt 0 || return 0
- # Ignore failures in find, we are only interested in failures of the
- # final rm.
- find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || :
- rm -rf "$@"
-}
-
-# count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
-# -----------------------------------------------------------------------
-# Check that a testsuite run driven by the parallel-tests harness has
-# had the specified numbers of test results (specified by kind).
-# This function assumes that the output of "make check" or "make recheck"
-# has been saved in the 'stdout' file in the current directory, and its
-# log in the 'test-suite.log' file.
-count_test_results ()
-{
- # Use a subshell so that we won't pollute the script namespace.
- (
- # TODO: Do proper checks on the arguments?
- total=ERR pass=ERR fail=ERR xpass=ERR xfail=ERR skip=ERR error=ERR
- eval "$@"
- # For debugging.
- $EGREP -i '(total|x?pass|x?fail|skip|error)' stdout || :
- rc=0
- # Avoid spurious failures with shells with "overly sensible"
- # errexit shell flag, such as e.g., Solaris /bin/sh.
- set +e
- test `grep -c '^PASS:' stdout` -eq $pass || rc=1
- test `grep -c '^XFAIL:' stdout` -eq $xfail || rc=1
- test `grep -c '^SKIP:' stdout` -eq $skip || rc=1
- test `grep -c '^FAIL:' stdout` -eq $fail || rc=1
- test `grep -c '^XPASS:' stdout` -eq $xpass || rc=1
- test `grep -c '^ERROR:' stdout` -eq $error || rc=1
- grep "^# TOTAL: *$total$" stdout || rc=1
- grep "^# PASS: *$pass$" stdout || rc=1
- grep "^# XFAIL: *$xfail$" stdout || rc=1
- grep "^# SKIP: *$skip$" stdout || rc=1
- grep "^# FAIL: *$fail$" stdout || rc=1
- grep "^# XPASS: *$xpass$" stdout || rc=1
- grep "^# ERROR: *$error$" stdout || rc=1
- test $rc -eq 0
- )
-}
-
-commented_sed_unindent_prog='
- /^$/b # Nothing to do for empty lines.
- x # Get x<indent> into pattern space.
- /^$/{ # No prior x<indent>, go prepare it.
- g # Copy this 1st non-blank line into pattern space.
- s/^\(['"$tab"' ]*\).*/x\1/ # Prepare x<indent> in pattern space.
- } # Now: x<indent> in pattern and <line> in hold.
- G # Build x<indent>\n<line> in pattern space, and
- h # duplicate it into hold space.
- s/\n.*$// # Restore x<indent> in pattern space, and
- x # exchange with the above duplicate in hold space.
- s/^x\(.*\)\n\1// # Remove leading <indent> from <line>.
- s/^x.*\n// # Restore <line> when there is no leading <indent>.
-'
-
-# unindent [input files...]
-# -------------------------
-# Remove the "proper" amount of leading whitespace from the given files,
-# and output the result on stdout. That amount is determined by looking
-# at the leading whitespace of the first non-blank line in the input
-# files. If no input file is specified, standard input is implied.
-unindent ()
-{
- if test x"$sed_unindent_prog" = x; then
- sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"`
- fi
- sed "$sed_unindent_prog" ${1+"$@"}
-}
-sed_unindent_prog="" # Avoid interferences from the environment.
-
-# get_shell_script SCRIPT-NAME
-# -----------------------------
-# Fetch an Automake-provided shell script from the 'lib/' directory into
-# the current directory, and, if the '$am_test_prefer_config_shell'
-# variable is set to "yes", modify its shebang line to use $SHELL instead
-# of /bin/sh.
-get_shell_script ()
-{
- test ! -f "$1" || rm -f "$1" || return 99
- if test x"$am_test_prefer_config_shell" = x"yes"; then
- sed "1s|#!.*|#! $SHELL|" "$am_scriptdir/$1" > "$1" \
- && chmod a+x "$1" \
- || return 99
- else
- cp -f "$am_scriptdir/$1" . || return 99
- fi
- sed 10q "$1" # For debugging.
-}
-
-# require_xsi SHELL
-# -----------------
-# Skip the test if the given shell fails to support common XSI constructs.
-require_xsi ()
-{
- test $# -eq 1 || fatal_ "require_xsi needs exactly one argument"
- echo "$me: trying some XSI constructs with $1"
- $1 -c "$xsi_shell_code" || skip_all_ "$1 lacks XSI features"
-}
-# Shell code supposed to work only with XSI shells. Keep this in sync
-# with libtool.m4:_LT_CHECK_SHELL_FEATURES.
-xsi_shell_code='
- _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval '\''test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5'\'
-
-# fetch_tap_driver
-# ----------------
-# Fetch the Automake-provided TAP driver from the 'lib/' directory into
-# the current directory, and edit its shebang line so that it will be
-# run with the perl interpreter determined at configure time.
-fetch_tap_driver ()
-{
- # TODO: we should devise a way to make the shell TAP driver tested also
- # TODO: with /bin/sh, for better coverage.
- case $am_tap_implementation in
- perl)
- $PERL -MTAP::Parser -e 1 \
- || skip_all_ "cannot import TAP::Parser perl module"
- sed "1s|#!.*|#! $PERL -w|" "$am_scriptdir"/tap-driver.pl >tap-driver
- ;;
- shell)
- AM_TAP_AWK=$AWK; export AM_TAP_AWK
- sed "1s|#!.*|#! $SHELL|" "$am_scriptdir"/tap-driver.sh >tap-driver
- ;;
- *)
- fatal_ "invalid \$am_tap_implementation '$am_tap_implementation'" ;;
- esac \
- && chmod a+x tap-driver \
- || framework_failure_ "couldn't fetch $am_tap_implementation TAP driver"
- sed 10q tap-driver # For debugging.
-}
-# The shell/awk implementation of the TAP driver is still mostly dummy, so
-# use the perl implementation by default for the moment.
-am_tap_implementation=${am_tap_implementation-shell}
-
-# Usage: require_compiler_ {cc|c++|fortran|fortran77}
-require_compiler_ ()
-{
- case $# in
- 0) fatal_ "require_compiler_: missing argument";;
- 1) ;;
- *) fatal_ "require_compiler_: too many arguments";;
- esac
- case $1 in
- cc)
- am__comp_lang="C"
- am__comp_var=CC
- am__comp_flag_vars='CFLAGS CPPFLAGS'
- ;;
- c++)
- am__comp_lang="C++"
- am__comp_var=CXX
- am__comp_flag_vars='CXXFLAGS CPPFLAGS'
- ;;
- fortran)
- am__comp_lang="Fortran"
- am__comp_var=FC
- am__comp_flag_vars='FCFLAGS'
- ;;
- fortran77)
- am__comp_lang="Fortran 77"
- am__comp_var=F77
- am__comp_flag_vars='FFLAGS'
- ;;
- esac
- shift
- eval "am__comp_prog=\${$am__comp_var}" \
- || fatal_ "expanding \${$am__comp_var} in require_compiler_"
- case $am__comp_prog in
- "")
- fatal_ "botched configuration: \$$am__comp_var is empty";;
- false)
- skip_all_ "no $am__comp_lang compiler available";;
- autodetect|autodetected)
- # Let the ./configure commands in the test script try to determine
- # these automatically.
- unset $am__comp_var $am__comp_flag_vars;;
- *)
- # Pre-set these for the ./configure commands in the test script.
- export $am__comp_var $am__comp_flag_vars;;
- esac
- # Delete private variables.
- unset am__comp_lang am__comp_prog am__comp_var am__comp_flag_vars
-}
-
-## ----------------------------------------------------------- ##
-## Checks for required tools, and additional setups (if any) ##
-## required by them. ##
-## ----------------------------------------------------------- ##
-
-# Performance tests must be enabled explicitly.
-case $argv0 in
- */perf/*)
- case $AM_TESTSUITE_PERF in
- [yY]|[yY]es|1) ;;
- *) skip_ "performance tests not explicitly enabled" ;;
- esac
- ;;
-esac
-
-# Look for (and maybe set up) required tools and/or system features; skip
-# the current test if they are not found.
-for tool in : $required
-do
- # Check that each required tool is present.
- case $tool in
- :) ;;
- cc|c++|fortran|fortran77)
- require_compiler_ $tool;;
- xsi-lib-shell)
- if test x"$am_test_prefer_config_shell" = x"yes"; then
- require_xsi "$SHELL"
- else
- require_xsi "/bin/sh"
- fi
- ;;
- bzip2)
- # Do not use --version, older versions bzip2 still tries to compress
- # stdin.
- echo "$me: running bzip2 --help"
- bzip2 --help \
- || skip_all_ "required program 'bzip2' not available"
- ;;
- cl)
- CC=cl
- # Don't export CFLAGS, as that could have been initialized to only
- # work with the C compiler detected at configure time. If the user
- # wants CFLAGS to also influence 'cl', he can still export CFLAGS
- # in the environment "by hand" before calling the testsuite.
- export CC CPPFLAGS
- echo "$me: running $CC -?"
- $CC -? || skip_all_ "Microsoft C compiler '$CC' not available"
- ;;
- etags)
- # Exuberant Ctags will create a TAGS file even
- # when asked for --help or --version. (Emacs's etags
- # does not have such problem.) Use -o /dev/null
- # to make sure we do not pollute the build directory.
- echo "$me: running etags --version -o /dev/null"
- etags --version -o /dev/null \
- || skip_all_ "required program 'etags' not available"
- ;;
- GNUmake)
- for make_ in "$MAKE" gmake gnumake :; do
- MAKE=$make_ am__using_gmake=''
- test "$MAKE" = : && break
- echo "$me: determine whether $MAKE is GNU make"
- # Don't use "&&" here, or a bug of 'set -e' present in some
- # versions of the BSD shell will be triggered. We add the
- # dummy "else" branch for extra safety.
- if using_gmake; then break; else :; fi
- done
- test "$MAKE" = : && skip_all_ "this test requires GNU make"
- export MAKE
- unset make_
- ;;
- gcj)
- GCJ=$GNU_GCJ GCJFLAGS=$GNU_GCJFLAGS; export GCJ GCJFLAGS
- test "$GCJ" = false && skip_all_ "GNU Java compiler unavailable"
- : For shells with busted 'set -e'.
- ;;
- gcc)
- CC=$GNU_CC CFLAGS=$GNU_CFLAGS; export CC CFLAGS CPPFLAGS
- test "$CC" = false && skip_all_ "GNU C compiler unavailable"
- : For shells with busted 'set -e'.
- ;;
- g++)
- CXX=$GNU_CXX CXXFLAGS=$GNU_CXXFLAGS; export CXX CXXFLAGS CPPFLAGS
- test "$CXX" = false && skip_all_ "GNU C++ compiler unavailable"
- : For shells with busted 'set -e'.
- ;;
- gfortran)
- FC=$GNU_FC FCFLAGS=$GNU_FCFLAGS; export FC FCFLAGS
- test "$FC" = false && skip_all_ "GNU Fortran compiler unavailable"
- case " $required " in
- *\ g77\ *) ;;
- *) F77=$FC FFLAGS=$FCFLAGS; export F77 FFLAGS;;
- esac
- ;;
- g77)
- F77=$GNU_F77 FFLAGS=$GNU_FFLAGS; export F77 FFLAGS
- test "$F77" = false && skip_all_ "GNU Fortran 77 compiler unavailable"
- case " $required " in
- *\ gfortran\ *) ;;
- *) FC=$F77 FCFLAGS=$FFLAGS; export FC FCFLAGS;;
- esac
- ;;
- javac)
- # The Java compiler from JDK 1.5 (and presumably earlier versions)
- # cannot handle the '-version' option by itself: it bails out
- # telling that source files are missing. Adding also the '-help'
- # option seems to solve the problem.
- echo "$me: running javac -version -help"
- javac -version -help || skip_all_ "Sun Java compiler not available"
- ;;
- java)
- # See the comments above about 'javac' for why we use also '-help'.
- echo "$me: running java -version -help"
- java -version -help || skip_all_ "Sun Java interpreter not found"
- ;;
- lib)
- AR=lib
- export AR
- # Attempting to create an empty archive will actually not
- # create the archive, but lib will output its version.
- echo "$me: running $AR -out:defstest.lib"
- $AR -out:defstest.lib \
- || skip_all_ "Microsoft 'lib' utility not available"
- ;;
- makedepend)
- echo "$me: running makedepend -f-"
- makedepend -f- \
- || skip_all_ "required program 'makedepend' not available"
- ;;
- makeinfo-html)
- # Make sure we have makeinfo, and it understands '--html'.
- echo "$me: running makeinfo --html --version"
- makeinfo --html --version \
- || skip_all_ "cannot find a makeinfo program that groks" \
- "the '--html' option"
- ;;
- mingw)
- uname_s=`uname -s || echo UNKNOWN`
- echo "$me: system name: $uname_s"
- case $uname_s in
- MINGW*) ;;
- *) skip_all_ "this test requires MSYS in MinGW mode" ;;
- esac
- ;;
- non-root)
- # Skip this test case if the user is root.
- # We try to append to a read-only file to detect this.
- priv_check_temp=priv-check.$$
- touch $priv_check_temp && chmod a-w $priv_check_temp \
- || framework_failure_ "creating unwritable file $priv_check_temp"
- # Not a useless use of subshell: lesser shells like Solaris /bin/sh
- # can exit if a builtin fails.
- overwrite_status=0
- (echo foo >> $priv_check_temp) || overwrite_status=$?
- rm -f $priv_check_temp
- if test $overwrite_status -eq 0; then
- skip_all_ "cannot drop file write permissions"
- fi
- unset priv_check_temp overwrite_status
- ;;
- perl-threads)
- if test "$WANT_NO_THREADS" = "yes"; then
- skip_all_ "Devel::Cover cannot cope with threads"
- fi
- ;;
- native)
- # Don't use "&&" here, to avoid a bug of 'set -e' present in
- # some (even relatively recent) versions of the BSD shell.
- # We add the dummy "else" branch for extra safety.
- if cross_compiling; then
- skip_all_ "doesn't work in cross-compile mode"
- else :; fi
- ;;
- python)
- # Python doesn't support --version, it has -V
- echo "$me: running python -V"
- python -V || skip_all_ "python interpreter not available"
- ;;
- ro-dir)
- # Skip this test case if read-only directories aren't supported
- # (e.g., under DOS.)
- ro_dir_temp=ro_dir.$$
- mkdir $ro_dir_temp && chmod a-w $ro_dir_temp \
- || framework_failure_ "creating unwritable directory $ro_dir_temp"
- # Not a useless use of subshell: lesser shells like Solaris /bin/sh
- # can exit if a builtin fails.
- create_status=0
- (: > $ro_dir_temp/probe) || create_status=$?
- rm -rf $ro_dir_temp
- if test $create_status -eq 0; then
- skip_all_ "cannot drop directory write permissions"
- fi
- unset ro_dir_temp create_status
- ;;
- runtest)
- # DejaGnu's runtest program. We rely on being able to specify
- # the program on the runtest command-line. This requires
- # DejaGnu 1.4.3 or later.
- echo "$me: running runtest SOMEPROGRAM=someprogram --version"
- runtest SOMEPROGRAM=someprogram --version \
- || skip_all_ "DejaGnu is not available"
- ;;
- tex)
- # No all versions of Tex support '--version', so we use
- # a configure check.
- if test -z "$TEX"; then
- skip_all_ "TeX is required, but it wasn't found by configure"
- fi
- ;;
- texi2dvi-o)
- # Texi2dvi supports '-o' since Texinfo 4.1.
- echo "$me: running texi2dvi -o /dev/null --version"
- texi2dvi -o /dev/null --version \
- || skip_all_ "required program 'texi2dvi' not available"
- ;;
- lex)
- test x"$LEX" = x"false" && skip_all_ "lex not found or disabled"
- export LEX
- ;;
- yacc)
- test x"$YACC" = x"false" && skip_all_ "yacc not found or disabled"
- export YACC
- ;;
- flex)
- LEX=flex; export LEX
- echo "$me: running flex --version"
- flex --version || skip_all_ "required program 'flex' not available"
- ;;
- bison)
- YACC='bison -y'; export YACC
- echo "$me: running bison --version"
- bison --version || skip_all_ "required program 'bison' not available"
- ;;
- *)
- # Generic case: the tool must support --version.
- echo "$me: running $tool --version"
- # It is not likely but possible that $tool is a special builtin,
- # in which case the shell is allowed to exit after an error. So
- # we need the subshell here. Also, some tools, like Sun cscope,
- # can be interactive without redirection.
- ($tool --version) </dev/null \
- || skip_all_ "required program '$tool' not available"
- ;;
- esac
-done
-
-# Using just $am_top_builddir for the check here is ok, since the
-# further temporary subdirectory where the test will be run is
-# ensured not to contain any whitespace character.
-case $am_top_builddir in
- *\ *|*\ *)
- case " $required " in
- *' libtool '* | *' libtoolize '* )
- skip_all_ "libtool has problems with spaces in builddir name";;
- esac
- ;;
-esac
-
-# This test is necessary, although Automake's configure script bails out
-# when $srcdir contains spaces. This is because $am_top_srcdir is in not
-# configure-time $srcdir, but is instead configure-time $abs_srcdir, and
-# that is allowed to contain spaces.
-case $am_top_srcdir in
- *\ * |*\ *)
- case " $required " in
- *' libtool '* | *' libtoolize '* | *' gettext '* )
- skip_all_ "spaces in srcdir name: libtool/gettext tests won't work";;
- esac
- ;;
-esac
-
-# We might need extra macros, e.g., from Libtool or Gettext.
-case " $required " in *\ libtool*) . ./t/libtool-macros.dir/get.sh;; esac
-case " $required " in *\ gettext*) . ./t/gettext-macros.dir/get.sh;; esac
-
-
-## ---------------------------------------------------------------- ##
-## Create and set up of the temporary directory used by the test. ##
-## Set up of the exit trap for cleanup of said directory. ##
-## ---------------------------------------------------------------- ##
-
-# This might be used in testcases checking distribution-related features.
-# Test scripts are free to override this if they need to.
-distdir=$me-1.0
-
-# Set up the exit trap.
-trap 'exit_status=$?
- set +e
- cd "$am_top_builddir"
- if test $am_using_tap = yes; then
- if test "$planned_" = later && test $exit_status -eq 0; then
- plan_ "now"
- fi
- test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
- || keep_testdirs=yes
- else
- # This is to ensure that a test script does give a SKIP outcome just
- # because a command in it happens to exit with status 77. This
- # behaviour, while from time to time useful to developers, is not
- # meant to be enabled by default, as it could cause spurious failures
- # in the wild. Thus it will be enabled only when the variable
- # "am_explicit_skips" is set to a "true" value.
- case $am_explicit_skips in
- [yY]|[yY]es|1)
- if test $exit_status -eq 77 && test $am__test_skipped != yes; then
- echo "$me: implicit skip turned into failure"
- exit_status=78
- fi;;
- esac
- test $exit_status -eq 0 || keep_testdirs=yes
- fi
- am_keeping_testdirs || rm_rf_ $testSubDir
- set +x
- echo "$me: exit $exit_status"
- exit $exit_status
-' 0
-trap "fatal_ 'caught signal SIGHUP'" 1
-trap "fatal_ 'caught signal SIGINT'" 2
-trap "fatal_ 'caught signal SIGTERM'" 15
-# Various shells seems to just ignore SIGQUIT under some circumstances,
-# even if the signal is not blocked; however, if the signal it trapped,
-# the trap gets correctly executed. So we also trap SIGQUIT.
-# Here is a list of some shells that have been verified to exhibit the
-# problematic behavior with SIGQUIT:
-# - zsh 4.3.12 on Debian GNU/Linux
-# - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
-# - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
-# - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
-# OTOH, at least these shells that do *not* exhibit that behaviour:
-# - modern version of the Almquist Shell (at least 0.5.5.1), on
-# both Solaris and GNU/Linux
-# - Solaris 10 /bin/sh
-# - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
-trap "fatal_ 'caught signal SIGQUIT'" 3
-# Ignore further SIGPIPE in the trap code. This is required to avoid
-# a very weird issue with some shells, at least when the execution of
-# the automake testsuite is driven by the 'prove' utility: if prove
-# (or the make process that has spawned it) gets interrupted with
-# Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
-# sometimes finally dumping core, other times hanging indefinitely.
-# See also Test::Harness bug [rt.cpan.org #70855], archived at
-# <https://rt.cpan.org/Ticket/Display.html?id=70855>
-trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
-
-# Create and populate the temporary directory, if and as required.
-if test x"$am_create_testdir" = x"no"; then
- testSubDir=
-else
- # The subdirectory where the current test script will run and write its
- # temporary/data files. This will be created shortly, and will be removed
- # by the cleanup trap below if the test passes. If the test doesn't pass,
- # this directory will be kept, to facilitate debugging.
- testSubDir=t/$me.dir
- test ! -d $testSubDir || rm_rf_ $testSubDir \
- || framework_failure_ "removing old test subdirectory"
- test -d t || mkdir t
- mkdir $testSubDir \
- || framework_failure_ "creating test subdirectory"
- # The trailing './'ris to avoid CDPATH issues.
- cd ./$testSubDir \
- || framework_failure_ "cannot chdir into test subdirectory"
- if test x"$am_create_testdir" != x"empty"; then
- cp "$am_scriptdir"/install-sh "$am_scriptdir"/missing \
- "$am_scriptdir"/depcomp . \
- || framework_failure_ "fetching common files from $am_scriptdir"
- # Build appropriate environment in test directory. E.g., create
- # configure.ac, touch all necessary files, etc. Don't use AC_OUTPUT,
- # but AC_CONFIG_FILES so that appending still produces a valid
- # configure.ac. But then, tests running config.status really need
- # to append AC_OUTPUT.
- {
- echo "AC_INIT([$me], [1.0])"
- if test x"$am_serial_tests" = x"yes"; then
- echo "AM_INIT_AUTOMAKE([serial-tests])"
- else
- echo "AM_INIT_AUTOMAKE"
- fi
- echo "AC_CONFIG_FILES([Makefile])"
- } >configure.ac || framework_failure_ "creating configure.ac skeleton"
- fi
-fi
-
-
-## ---------------- ##
-## Ready to go... ##
-## ---------------- ##
-
-set -x
-pwd
+# Source the actual test initialization and setup code, and return
+# control to the test script that is sourcing us.
+. "$am_testauxdir/test-init.sh"
Options: these items on which Automake works have been rewritten as
separate Perl modules, and documented.
-@itemx 2004-01-11 Automake 1.8.1
+@item 2004-01-11 Automake 1.8.1
@itemx 2004-01-12 Automake 1.8.2
@itemx 2004-03-07 Automake 1.8.3
@itemx 2004-04-25 Automake 1.8.4
Aside from this it contains mainly minor changes and bug-fixes.
-@itemx 2004-08-11 Automake 1.9.1
+@item 2004-08-11 Automake 1.9.1
@itemx 2004-09-19 Automake 1.9.2
Automake has ten years. This chapter of the manual was initially
written for this occasion.
-@itemx 2007-10-29 Automake repository moves to @code{savannah.gnu.org}
+@item 2007-10-29 Automake repository moves to @code{savannah.gnu.org}
and uses git as primary repository.
@end table
@example
~/amhello % @kbd{cat README}
This is a demonstration package for GNU Automake.
-Type `info Automake' to read the Automake manual.
+Type 'info Automake' to read the Automake manual.
@end example
@item
@example
~/amhello % @kbd{autoreconf --install}
-configure.ac: installing `./install-sh'
-configure.ac: installing `./missing'
-src/Makefile.am: installing `./depcomp'
+configure.ac: installing './install-sh'
+configure.ac: installing './missing'
+src/Makefile.am: installing './depcomp'
@end example
At this point the build system is complete.
% @kbd{cat Makefile.am}
$(FOO:=x): bar
% @kbd{automake}
-Makefile.am:1: bad characters in variable name `$(FOO'
-Makefile.am:1: `:='-style assignments are not portable
+Makefile.am:1: bad characters in variable name '$(FOO'
+Makefile.am:1: ':='-style assignments are not portable
@end example
@cindex Make targets, overriding
Therefore, when Automake detects this situation it will complain
with a message such as
@example
-object `foo.$(OBJEXT)' created both with libtool and without
+object 'foo.$(OBJEXT)' created both with libtool and without
@end example
A workaround for this issue is to ensure that these two objects get
@example
AM_TESTS_ENVIRONMENT = \
## Some environment initializations are kept in a separate shell
-## file `tests-env.sh', which can make it easier to also run tests
+## file 'tests-env.sh', which can make it easier to also run tests
## from the command line.
. $(srcdir)/tests-env.sh; \
## On Solaris, prefer more POSIX-compliant versions of the standard
such script, save its output in a corresponding @file{.log} file and
its results (and other ``metadata'', @pxref{API for Custom Test Drivers})
in a corresponding @file{.trs} (as in @b{T}est @b{R}e@b{S}ults) file.
-@c We choose the `.trs' extension also because, at the time of writing,
+@c We choose the '.trs' extension also because, at the time of writing,
@c it isn't already used for other significant purposes; see e.g.:
@c - http://filext.com/file-extension/trs
@c - http://www.file-extensions.org/search/?searchstring=trs
@code{MAKEFLAGS} is passed to sub-@command{make}s implicitly by
@command{make} itself.
-However you should not think that all variables ending with
-@code{FLAGS} follow this convention. For instance,
-@code{DISTCHECK_CONFIGURE_FLAGS} (@pxref{Checking the Distribution}) and
-@code{ACLOCAL_AMFLAGS} (see @ref{Rebuilding} and @ref{Local Macros}),
-are two variables that are only useful to the maintainer and have no
-user counterpart.
+However you should not think that all variables ending with @code{FLAGS}
+follow this convention. For instance, @code{ACLOCAL_AMFLAGS} (see
+@ref{Rebuilding} and @ref{Local Macros}) is a variable that is only
+useful to the maintainer and has no user counterpart.
@code{ARFLAGS} (@pxref{A Library}) is usually defined by Automake and
has neither @code{AM_} nor per-target cousin.
## originally written at EPITA/LRDE, further developed at Gostai, then made
## its way from GNU coreutils to end up, largely rewritten, in Automake.
## The current version is an heavy rewrite of that, to allow for support
-## of more test metadata, and the use of custom test derivers and protocols
+## of more test metadata, and the use of custom test drivers and protocols
## (among them, TAP).
am__recheck_rx = ^[ ]*:recheck:[ ]*
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%%PRIMARY%
+?EXEC?.PHONY install-exec-am: install-%DIR%%PRIMARY%
+?!EXEC?.PHONY install-data-am: install-%DIR%%PRIMARY%
install-%DIR%%PRIMARY%: $(%DIR%_%PRIMARY%)
@$(NORMAL_INSTALL)
if %?BASE%
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LIBRARIES
+?EXEC?.PHONY install-exec-am: install-%DIR%LIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LIBRARIES
install-%DIR%LIBRARIES: $(%DIR%_LIBRARIES)
@$(NORMAL_INSTALL)
if %?BASE%
@list='$(%DIR%_LIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
for p in $$list; do \
if test -f $$p; then \
- %BASE?$(am__strip_dir):f=$$p;% \
+?BASE? $(am__strip_dir) \
+?!BASE? f=$$p; \
## Must ranlib after installing because mod time changes.
## cd to target directory because AIX ranlib messes up with whitespace
## in the argument.
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-%DIR%LISP_INSTALL = %BASE?$(INSTALL_DATA):$(install_sh_DATA)%
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LISP
+
+?BASE?%DIR%LISP_INSTALL = $(INSTALL_DATA)
+?!BASE?%DIR%LISP_INSTALL = $(install_sh_DATA)
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LISP
+?!EXEC?.PHONY install-data-am: install-%DIR%LISP
+
install-%DIR%LISP: $(%DIR%_LISP) $(ELCFILES)
@$(NORMAL_INSTALL)
## Do not install anything if EMACS was not found.
for p in $$list; do \
## A lisp file can be in the source directory or the build directory.
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- %BASE?$(am__strip_dir):$(am__vpath_adj)% \
+?BASE? $(am__strip_dir) \
+?!BASE? $(am__vpath_adj) \
echo " $(%DIR%LISP_INSTALL) '$$d$$p' '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
$(%DIR%LISP_INSTALL) "$$d$$p" "$(DESTDIR)$(%NDIR%dir)/$$f" || exit $$?; \
## Only install .elc file if it exists.
## ------------ ##
if %?INSTALL%
+
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%LTLIBRARIES
+
+?EXEC?.PHONY install-exec-am: install-%DIR%LTLIBRARIES
+?!EXEC?.PHONY install-data-am: install-%DIR%LTLIBRARIES
+
install-%DIR%LTLIBRARIES: $(%DIR%_LTLIBRARIES)
@$(NORMAL_INSTALL)
if %?BASE%
@$(NORMAL_UNINSTALL)
@list='$(%DIR%_LTLIBRARIES)'; test -n "$(%NDIR%dir)" || list=; \
for p in $$list; do \
- %BASE?$(am__strip_dir):f=$$p;% \
+?BASE? $(am__strip_dir) \
+?!BASE? f=$$p; \
?LIBTOOL? echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
?LIBTOOL? $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(%NDIR%dir)/$$f"; \
?!LIBTOOL? echo " rm -f '$(DESTDIR)$(%NDIR%dir)/$$f'"; \
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PROGRAMS
+?EXEC?.PHONY install-exec-am: install-%DIR%PROGRAMS
+?!EXEC?.PHONY install-data-am: install-%DIR%PROGRAMS
install-%DIR%PROGRAMS: $(%DIR%_PROGRAMS)
@$(NORMAL_INSTALL)
## Funny invocation because Makefile variable can be empty, leading to
## On Cygwin with libtool test won't see 'foo.exe' but instead 'foo'.
## So we check for both.
sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p%LIBTOOL? || test -f $$p1%; \
- then echo "$$p"; echo "$$p"; else :; fi; \
+ while read p p1; do if test -f $$p \
+?LIBTOOL? || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
## We now have a list of sourcefile pairs, separated by newline.
## Turn that into "sourcefile source_base target_dir xformed_target_base",
## with newlines being turned into spaces in a second step.
- sed -e 'p;s,.*/,,;n;h' -e '%BASE?s|.*|.|:s|[^/]*$$||; s|^$$|.|%' \
+ sed -e 'p;s,.*/,,;n;h' \
+?BASE? -e 's|.*|.|' \
+?!BASE? -e 's|[^/]*$$||; s|^$$|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
## The following awk script turns that into one line containing directories
## but keep the directory part in the hold buffer, in order to
## reapply it again afterwards in the nobase case. Append $(EXEEXT).
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/'%BASE? : -e 'x;s,[^/]*$$,,;G;s,\n,,'%`; \
+ -e 's/$$/$(EXEEXT)/' \
+?!BASE? -e 'x;s,[^/]*$$,,;G;s,\n,,' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(%NDIR%dir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(%NDIR%dir)" && rm -f $$files
if %?INSTALL%
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%PYTHON
+?EXEC?.PHONY install-exec-am: install-%DIR%PYTHON
+?!EXEC?.PHONY install-data-am: install-%DIR%PYTHON
install-%DIR%PYTHON: $(%DIR%_PYTHON)
@$(NORMAL_INSTALL)
if %?BASE%
if %?INSTALL%
## if doesn't work properly for Automake variables yet.
am__installdirs += "$(DESTDIR)$(%NDIR%dir)"
-.PHONY install-%EXEC?exec:data%-am: install-%DIR%SCRIPTS
+?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
+?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
@$(NORMAL_INSTALL)
## Funny invocation because Makefile variable can be empty, leading to
## Must set MAKEINFO like this so that version.texi will be found even
## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
-## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1.
## texi2dvi doesn't silence everything with -q, redirect to /dev/null instead.
## We still want -q (%TEXIQUIET%) because it turns on batch mode.
-## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
-## directory (see automake bug#11146). We should start using '--tidy' when we
-## can assume Texinf 4.9 or later.
-?GENERIC? $(TEXI2DVI) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC? $(TEXI2DVI) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
+## by-products are left in there, instead of cluttering the current
+## directory (see automake bug#11146). Use a different build-dir for
+## each file (and distinct from that of the corresponding PDF file) to
+## avoid hitting a Texinfop bug that could cause low-probability racy
+## failure when doing parallel builds; see:
+## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
+ $(TEXI2DVI) %TEXIQUIET% --build-dir=$(@:.dvi=.t2d) -o $@ %TEXIDEVNULL% \
+?GENERIC? %SOURCE%
+?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?GENERIC?%SOURCE_SUFFIX%.pdf:
?!GENERIC?%DEST_PREFIX%.pdf: %SOURCE% %DEPS% %DIRSTAMP%
## Must set MAKEINFO like this so that version.texi will be found even
## if it is in srcdir (-I $(srcdir) is set in %MAKEINFOFLAGS%).
MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) %MAKEINFOFLAGS%' \
-## Do not use '-o' unless necessary: it is only supported since Texinfo 4.1.
## texi2pdf doesn't silence everything with -q, redirect to /dev/null instead.
## We still want -q (%TEXIQUIET%) because it turns on batch mode.
-## Use '--clean' to avoid leaving auxiliary files behind cluttering the build
-## directory (see automake bug#11146). We should start using '--tidy' when we
-## can assume Texinf 4.9 or later.
-?GENERIC? $(TEXI2PDF) %TEXIQUIET% --clean %SOURCE% %TEXIDEVNULL%
-?!GENERIC? $(TEXI2PDF) %TEXIQUIET% --clean -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE% %TEXIDEVNULL%
+## Use '--build-dir' so that TeX and Texinfo auxiliary files and build
+## by-products are left in there, instead of cluttering the current
+## directory (see automake bug#11146). Use a different build-dir for
+## each file (and distinct from that of the corresponding DVI file) to
+## avoid hitting a Texinfop bug that could cause low-probability racy
+## failure when doing parallel builds; see:
+## http://lists.gnu.org/archive/html/automake-patches/2012-06/msg00073.html
+ $(TEXI2PDF) %TEXIQUIET% --build-dir=$(@:.pdf=.t2p) -o $@ %TEXIDEVNULL% \
+?GENERIC? %SOURCE%
+?!GENERIC? `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
?GENERIC?%SOURCE_SUFFIX%.html:
?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
.PHONY: mostlyclean-aminfo
mostlyclean-aminfo:
## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## contain any directory created by "makeinfo --html", as well as the
+## '*.t2d' and '*.t2p' directories used by texi2dvi and texi2pdf.
-rm -rf %MOSTLYCLEAN%
.PHONY clean-am: clean-aminfo
clean-aminfo:
-## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
+## above for details.
?TEXICLEAN? -test -z "%TEXICLEAN%" \
?TEXICLEAN? || rm -rf %TEXICLEAN%
echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
-## Use '-rf', not just '-f', because the %*CLEAN% substitutions can also
-## contain any directory created by "makeinfo --html".
+## Use '-rf', not just '-f'; see comments in 'mostlyclean-aminfo'
+## above for details.
?MAINTCLEAN? -test -z "%MAINTCLEAN%" \
?MAINTCLEAN? || rm -rf %MAINTCLEAN%
done; \
done | sort)
-xdefs = $(srcdir)/defs $(srcdir)/defs-static.in
+xdefs = $(srcdir)/t/ax/test-init.sh $(srcdir)/defs $(srcdir)/defs-static.in
ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
sc_perl_local \
sc_AMDEP_TRUE_in_automake_in \
sc_tests_make_without_am_makeflags \
+$(sc_obsolete_requirements_rules) \
sc_tests_obsolete_variables \
sc_tests_here_document_format \
+sc_tests_command_subst \
sc_tests_Exit_not_exit \
sc_tests_automake_fails \
sc_tests_required_after_defs \
sc_tests_overriding_macros_on_cmdline \
sc_tests_plain_sleep \
+sc_tests_ls_t \
sc_m4_am_plain_egrep_fgrep \
sc_tests_no_configure_in \
sc_tests_PATH_SEPARATOR \
exit 1; \
else :; fi
+## Look out for obsolete requirements specified in the test cases.
+sc_obsolete_requirements_rules = sc_no_texi2dvi-o sc_no_makeinfo-html
+modern-requirement.texi2dvi-o = texi2dvi
+modern-requirement.makeinfo-html = makeinfo
+
+$(sc_obsolete_requirements_rules): sc_no_% :
+ @if grep -E 'required=.*\b$*\b' $(xtests); then \
+ echo "Requirement '$*' is obsolete and shouldn't" \
+ "be used anymore." >&2; \
+ echo "You should use '$(modern-requirement.$*)' instead." >&2; \
+ exit 1; \
+ fi
+
## Tests should never call some programs directly, but only through the
## corresponding variable (e.g., '$MAKE', not 'make'). This will allow
## the programs to be overridden at configure time (for less brittleness)
exit 1; \
fi
+## Our test case should use the $(...) POSIX form for command substitution,
+## rather than the older `...` form.
+## The point of ignoring text on here-documents is that we want to exempt
+## Makefile.am rules, configure.ac code and helper shell script created and
+## used by out shell scripts, because Autoconf (as of version 2.69) does not
+## yet ensure that $CONFIG_SHELL will be set to a proper POSIX shell.
+sc_tests_command_subst:
+ @found=false; \
+ scan () { \
+ sed -n -e '/^#/d' \
+ -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
+ -e 's/\\`/\\{backtick}/' \
+ -e "s/[^\\]'\([^']*\`[^']*\)*'/'{quoted-text}'/g" \
+ -e '/`/p' $$*; \
+ }; \
+ for file in $(xtests); do \
+ res=`scan $$file`; \
+ if test -n "$$res"; then \
+ echo "$$file:$$res"; \
+ found=true; \
+ fi; \
+ done; \
+ if $$found; then \
+ echo 'Use $$(...), not `...`, for command substitutions.' >&2; \
+ exit 1; \
+ fi
+
## Tests should never call exit directly, but use Exit.
## This is so that the exit status is transported correctly across the 0 trap.
## Ignore comments and our testsuite's own self tests.
exit 1; \
fi
+## Prefer use of our 'is_newest' auxiliary script over the more hacky
+## idiom "test $(ls -1t new old | sed 1q) = new", which is both more
+## cumbersome and more fragile.
+sc_tests_ls_t:
+ @if LC_ALL=C grep -E '\bls(\s+-[a-zA-Z0-9]+)*\s+-[a-zA-Z0-9]*t' \
+ $(xtests); then \
+ echo "Use 'is_newest' rather than hacks based on 'ls -t'" 1>&2; \
+ exit 1; \
+ fi
+
## Never use 'sleep 1' to create files with different timestamps.
## Use '$sleep' instead. Some filesystems (e.g., Windows) have only
## a 2sec resolution.
Writing test cases
==================
-
-Do
---
-
- If you plan to fix a bug, write the test case first. This way you'll
+* If you plan to fix a bug, write the test case first. This way you'll
make sure the test catches the bug, and that it succeeds once you have
fixed the bug.
- Add a copyright/license paragraph.
+* Add a copyright/license paragraph.
- Explain what the test does.
+* Explain what the test does, i.e., which features it checks, which
+ invariants it verifies, or what bugs/issues it guard against.
- Cite the PR number (if any), and the original reporter (if any), so
+* Cite the PR number (if any), and the original reporter (if any), so
we can find or ask for information if needed.
- If a test checks examples or idioms given in the documentation, make
- sure the documentation reference them appropriately in comments, as in:
+* If a test checks examples or idioms given in the documentation, make
+ sure the documentation reference them appropriately in comments, as
+ with:
+
@c Keep in sync with autodist-config-headers.sh
@example
...
@end example
- Use "required=..." for required tools. Do not explicitly require
+* Use "required=..." for required tools. Do not explicitly require
tools which can be taken for granted because they're listed in the
GNU Coding Standards (for example, 'gzip').
- Include ./defs in every test script (see existing tests for examples
+* Include ./defs in every test script (see existing tests for examples
of how to do this).
- Use the 'skip_' function to skip tests, with a meaningful message if
+* Use the 'skip_' function to skip tests, with a meaningful message if
possible. Where convenient, use the 'warn_' function to print generic
warnings, the 'fail_' function for test failures, and the 'fatal_'
function for hard errors. In case a hard error is due to a failed
set-up of a test scenario, you can use the 'framework_fail_' function
instead.
- For those tests checking the Automake-provided test harnesses that are
- expected to work also when the 'serial-tests' Automake option is used
- (thus causing the serial testsuite harness to be used in the generated
- Makefile), place a line containing "try-with-serial-tests" somewhere
- in the file. That will ensure that the 'gen-testsuite-part' script
- generates a sibling of that test which uses the serial harness instead
- of the parallel one. For those tests that are *not* meant to work with
- the parallel testsuite harness at all (these should be very very few),
+* For those tests checking the Automake-provided test harnesses that
+ are expected to work also when the 'serial-tests' Automake option
+ is used (thus causing the serial testsuite harness to be used in the
+ generated Makefile), place a line containing "try-with-serial-tests"
+ somewhere in the file (usually in a comment).
+ That will ensure that the 'gen-testsuite-part' script generates a
+ sibling of that test which uses the serial harness instead of the
+ parallel one. For those tests that are *not* meant to work with the
+ parallel testsuite harness at all (these should be very very few),
set the shell variable 'am_serial_tests' to "yes" before including
./defs.
- Some tests in the Automake testsuite are auto-generated; those tests
+* Some tests in the Automake testsuite are auto-generated; those tests
might have custom extensions, but their basename (that is, with such
extension stripped) is expected to end with "-w" string, optionally
followed by decimal digits. For example, the name of a valid
to be confused with auto-generated tests; for example, 'u-v-w.sh'
or 'option-w0.tap' are *not* valid name for hand-written tests.
- ./defs brings in some commonly required files, and sets a skeleton
+* ./defs brings in some commonly required files, and sets a skeleton
configure.ac. If possible, append to this file. In some cases
you'll have to overwrite it, but this should be the exception. Note
that configure.ac registers Makefile.in but do not output anything by
test directory (which is a rare occurrence), set the 'am_create_testdir'
shell variable to "empty" before sourcing ./defs.
- By default, the testcases are run with the errexit shell flag on,
+* By default, the testcases are run with the errexit shell flag on,
to make it easier to catch failures you might not have thought of.
If this is undesirable in some testcase, you can use "set +e" to
disable the errexit flag (but please do so only if you have a very
good reason).
- End the test script with a ":" or "Exit 0". Otherwise, when somebody
+* End the test script with a ':' command. Otherwise, when somebody
changes the test by adding a failing command after the last command,
- the test will spuriously fail because $? is nonzero at the end. Note
- that this is relevant even if the errexit shell flag is on, in case
- the test contains commands like "grep ... Makefile.in && Exit 1" (and
- there are indeed a lot of such tests).
+ the test will spuriously fail because '$?' is nonzero at the end.
+ Note that this is relevant even if the errexit shell flag is on, in
+ case the test contains commands like "grep ... Makefile.in && Exit 1"
+ (and there are indeed a lot of such tests).
- Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER,
+* Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER,
$PERL, $MAKE, $EGREP, and $FGREP, instead of the corresponding
commands.
- Use $sleep when you have to make sure that some file is newer
+* Use '$sleep' when you have to make sure that some file is newer
than another.
- Use cat or grep or similar commands to display (part of) files that
+* Use cat or grep or similar commands to display (part of) files that
may be interesting for debugging, so that when a user send a verbose
output we don't have to ask him for more details. Display stderr
output on the stderr file descriptor. If some redirected command is
likely to fail, display its output even in the failure case, before
exiting.
- Use 'Exit' rather than 'exit' to abort for leave early from a test
+* Use 'Exit' rather than 'exit' to abort for leave early from a test
case.
- Use '$PATH_SEPARATOR', not hard-coded ':', as the separator of
+* Use '$PATH_SEPARATOR', not hard-coded ':', as the separator of
PATH's entries.
- It's more important to make sure that a feature works, than make
+* It's more important to make sure that a feature works, than make
sure that Automake's output looks correct. It might look correct
and still fail to work. In other words, prefer running 'make' over
grepping Makefile.in (or do both).
- If you run $ACLOCAL, $AUTOMAKE or $AUTOCONF several times in the
+* If you run $ACLOCAL, $AUTOMAKE or $AUTOCONF several times in the
same test and change configure.ac by the meantime, do
+
rm -rf autom4te*.cache
+
before the following runs. On fast machines the new configure.ac
could otherwise have the same timestamp as the old autom4te.cache.
- Use filenames with two consecutive spaces when testing that some
+* Use filenames with two consecutive spaces when testing that some
code preserves filenames with spaces. This will catch errors like
`echo $filename | ...`.
- Make sure your test script can be used to faithfully check an
+* Make sure your test script can be used to faithfully check an
installed version of automake (as with "make installcheck"). For
example, if you need to copy or grep an automake-provided script,
do not assume that they can be found in the '$top_srcdir/lib'
such "$am_...dir" variables can be found in the 'defs-static.in'
file.
- When writing input for lex, include the following in the definitions
+* When writing input for lex, include the following in the definitions
section:
+
%{
#define YY_NO_UNISTD_H 1
%}
+
to accommodate non-ANSI systems, since GNU flex generates code that
includes unistd.h otherwise. Also add:
+
int isatty (int fd) { return 0; }
+
to the definitions section if the generated code is to be compiled
by a C++ compiler, for similar reasons (i.e., the isatty(3) function
from that same unistd.h header would be required otherwise).
- Before commit: make sure the test is executable, add the tests to
+* Before commit: make sure the test is executable, add the tests to
TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
write a ChangeLog entry, send the diff to <automake-patches@gnu.org>.
+* In test scripts, prefer using POSIX constructs over their old
+ Bourne-only equivalents:
+
+ - use $(...), not `...`, for command substitution;
+ - use $((...), not `expr ...`, for arithmetic processing;
+ - liberally use '!' to invert the exit status of a command, e.g.,
+ in idioms like "if ! CMD; then ...", instead of relying on clumsy
+ paraphrases like "if CMD; then :; else ...".
+ - prefer use of ${param%pattern} and ${param#pattern} parameter
+ expansions over processing by 'sed' or 'expr'.
-Do not
-------
+* Note however that, when writing Makefile recipes or shell code in a
+ configure.ac, you should still use `...` instead, because the Autoconf
+ generated configure scripts do not ensure they will find a truly POSIX
+ shell (even though they will prefer and use it *if* it's found).
- Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
+* Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
years we'll discover that this test failed for some other bogus reason.
This happened many times. Better use something like
+
AUTOMAKE_fails
grep 'expected diagnostic' stderr
- (Note this doesn't prevent the test from failing for another reason,
- but at least it makes sure the original error is still here).
- Do not override Makefile variables using make arguments, as in e.g.:
+ Note this doesn't prevent the test from failing for another reason,
+ but at least it makes sure the original error is still here.
+
+* Do not override Makefile variables using make arguments, as in e.g.:
+
$MAKE prefix=/opt install
+
This is not portable for recursive targets (targets that call a
sub-make may not pass "prefix=/opt" along). Use the following
instead:
+
prefix=/opt $MAKE -e install
command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
- test `$FGREP foo.in Makefile.in | wc -l` -eq 2
+ test $($FGREP -c 'foo.in' Makefile.in) -eq 2
# This ought to work as well.
command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
$sleep
# aclocal.m4 should change if we touch otherfile.m4
touch m4/otherfile.m4
-$sleep
$ACLOCAL -I m4
-test `ls -1t aclocal.m4 m4/otherfile.m4 | sed 1q` = aclocal.m4
+is_newest aclocal.m4 m4/otherfile.m4
$AUTOCONF
$AUTOMAKE
./configure
$MAKE distcheck
+
+:
./configure
$MAKE testdist1
-cp aclocal.m4 stamp
+cp aclocal.m4 aclocal.old
$sleep
-
-cat >>c.m4 <<\EOF
-AC_DEFUN([FOO], [ANOTHER_MACRO])
-EOF
-
+echo 'AC_DEFUN([FOO], [ANOTHER_MACRO])' >> c.m4
$MAKE
-
# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
-test `ls -1t aclocal.m4 stamp | sed 1q` = aclocal.m4
+is_newest aclocal.m4 aclocal.old
# However, since FOO is not used, f.m4 should not be included
# and the contents of aclocal.m4 should remain the same
-diff aclocal.m4 stamp
+diff aclocal.m4 aclocal.old
-# If FOO where to be used, that would be another story, of course.
-cat >>configure.ac <<EOF
-FOO
-EOF
-
-cp aclocal.m4 stamp
+# If FOO where to be used, that would be another story, of course:
+# f.m4 should be included
$sleep
-
+echo FOO >> configure.ac
$MAKE
-
$FGREP defs/f.m4 aclocal.m4
$MAKE testdist2
$FGREP AM_SOME_MACRO aclocal.m4 && Exit 1
$FGREP AM_MORE_MACRO aclocal.m4 && Exit 1
$FGREP 'm4_include([m4/more.m4])' aclocal.m4
-test 1 = `grep m4_include aclocal.m4 | wc -l`
+test 1 = $(grep m4_include aclocal.m4 | wc -l)
:
$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
-test `grep -c 'ill-formed serial' stderr` -eq 3
+test $(grep -c 'ill-formed serial' stderr) -eq 3
$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
echo 'AM_DUMMY_MACRO' >> configure.ac
echo 'AC_DEFUN([AM_DUMMY_MACRO], [:])' >> sys/foo.m4
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
env ACLOCAL_PATH="$cwd/sys" $ACLOCAL --verbose --install -I "$cwd/loc"
diff sys/foo.m4 loc/foo.m4
$ACLOCAL -I foo --install
test -f foo/my-defs.m4
-$ACLOCAL --install -I "`pwd`/bar"
+$ACLOCAL --install -I "$(pwd)/bar"
test -f bar/my-defs.m4
$ACLOCAL --install -I baz/sub/sub2
# Directories in ACLOCAL_PATH should never be created if they don't
# exist.
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install && Exit 1
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install && Exit 1
test ! -d none
test ! -d none2
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install -I x
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install -I x
test -f x/my-defs.m4
test ! -d none
test ! -d none2
mkdir sdir pdir m4
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/sdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/sdir"
ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
cat > sdir/foo.m4 << 'END'
mkdir acdir pdir ldir
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/acdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/acdir"
ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
cat > acdir/foo.m4 << 'END'
mkdir mdir
echo 'AC_DEFUN([AM_FOO], [am--foo])' > mdir/foo.m4
-ACLOCAL_PATH=./nonesuch:./mdir:`pwd`/nonesuch2:nonesuch3 $ACLOCAL
+ACLOCAL_PATH=./nonesuch:./mdir:$(pwd)/nonesuch2:nonesuch3 $ACLOCAL
$AUTOCONF
$FGREP 'am--foo' configure
AC_DEFUN([AM_BAZ_MACRO], [am--baz])
END
-ACLOCAL_PATH=mdir1:./mdir2:`pwd`/mdir3 $ACLOCAL
+ACLOCAL_PATH=mdir1:./mdir2:$(pwd)/mdir3 $ACLOCAL
$AUTOCONF
# there should be no m4_include in aclocal.m4, even though ACLOCAL_PATH
. ./defs || Exit 1
$ACLOCAL --print-ac-dir
-test "`$ACLOCAL --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --print-ac-dir)" = "$am_system_acdir"
$ACLOCAL --system-acdir /bar --print-ac-dir
-test "`$ACLOCAL --system-acdir /bar --print-ac-dir`" = /bar
+test "$($ACLOCAL --system-acdir /bar --print-ac-dir)" = /bar
$ACLOCAL --automake-acdir /bar --print-ac-dir
-test "`$ACLOCAL --automake-acdir /bar --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --automake-acdir /bar --print-ac-dir)" = "$am_system_acdir"
:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check verbose messages by `aclocal --install'.
+# Check verbose messages by 'aclocal --install'.
am_create_testdir=empty
. ./defs || Exit 1
mkdir m4
echo 'AC_DEFUN([SOME_DEFS], [])' > m4/somedefs.m4
-$sleep
-
-$ACLOCAL -I m4
-
# Automake will take aclocal.m4 to be newer if it has the same timestamp
# as Makefile.in. Avoid the confusing by sleeping.
-$sleep
-
-$AUTOMAKE --no-force
+AUTOMAKE_after_aclocal ()
+{
+ $sleep
+ $AUTOMAKE --no-force
+}
-$sleep
+$ACLOCAL -I m4
+AUTOMAKE_after_aclocal
touch foo
+$sleep
$ACLOCAL -I m4
-$AUTOMAKE --no-force
-
+AUTOMAKE_after_aclocal
# aclocal.m4 and Makefile.in should not have been updated, so 'foo'
# should be younger
-test `ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q` = foo
+is_newest foo aclocal.m4 Makefile.in sub/Makefile.in
$sleep
$ACLOCAL -I m4 --force
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
+is_newest aclocal.m4 foo
# We still use --no-force for automake, but since aclocal.m4 has
# changed all Makefile.ins should be updated.
-$sleep
-$AUTOMAKE --no-force
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+AUTOMAKE_after_aclocal
+is_newest Makefile.in aclocal.m4 foo
+is_newest sub/Makefile.in aclocal.m4 foo
-touch m4/somedefs.m4
$sleep
-touch foo
+touch m4/somedefs.m4
$sleep
$ACLOCAL -I m4
-$sleep
-$AUTOMAKE --no-force
-
-# aclocal.m4 should have been updated, although its contents haven't changed.
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+AUTOMAKE_after_aclocal
+# aclocal.m4 should have been updated, although its contents haven't
+# changed.
+is_newest aclocal.m4 m4/somedefs.m4
+is_newest Makefile.in m4/somedefs.m4
+is_newest sub/Makefile.in m4/somedefs.m4
-touch fragment.inc
$sleep
-touch foo
+touch fragment.inc
$sleep
$ACLOCAL -I m4
-$AUTOMAKE --no-force
+AUTOMAKE_after_aclocal
# Only ./Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+is_newest Makefile.in fragment.inc
+is_newest fragment.inc aclocal.m4
+is_newest fragment.inc sub/Makefile.in
grep README Makefile.in && Exit 1
-: > README
$sleep
-touch foo
+: > README
$sleep
$AUTOMAKE --no-force
# Even if no dependency change, the content changed.
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+is_newest Makefile.in README
+is_newest README sub/Makefile.in
grep README Makefile.in
$ACLOCAL -I m4
$AUTOMAKE --no-force
# Only sub/Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = foo
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+is_newest foo aclocal.m4
+is_newest foo Makefile.in
+is_newest sub/Makefile.in foo
+
+:
echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
$ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; }
-test 0 = `wc -l <output`
+test 0 -eq $(wc -l <output)
grep macro1.m4 aclocal.m4
grep macro2.m4 aclocal.m4 && Exit 1
plan_ "later"
build_aux=build-aux
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Try to improve readability of displayed diffs.
if diff -u /dev/null /dev/null; then
check_ ()
{
set +x # Temporary disable shell traces to remove noise from log files.
- incr_ check_count
+ check_count=$(($check_count + 1))
echo check count: $check_count
override=no
run_aclocal=no
for f in $files; do
command_ok_ \
"$pfx warn about missing file $f" \
- grep "required file ['\`]$build_aux/$f' not found" stderr
+ $FGREP "required file '$build_aux/$f' not found" stderr
# Suggest the user to use '--add-missing'.
command_ok_ \
"$pfx suggest --add-missing for $f" \
- grep ".*--add-missing.* install .*$f" stderr
+ grep ".*--add-missing.* install .*'$f'" stderr
done
# No files should be automatically installed by automake if it
# is not told to.
for f in $files; do
command_ok_ \
"$pfx report installation of $f" \
- grep ": installing ['\`]$build_aux/$f'$" stderr
+ $FGREP ": installing '$build_aux/$f'" stderr
done
# Only the expected files should be installed. But automake always
# require 'missing' and 'install-sh', so account for them.
# For config.guess and config.sub.
for mach in build host target system; do
- MACH=`echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ MACH=$(echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]')
check_ <<END
== Name ==
cfg-$mach
./configure --prefix /usr
$MAKE
-$MAKE DESTDIR="`pwd`/inst" install
+$MAKE DESTDIR="$(pwd)/inst" install
cd inst
find . -type f -print > ../files.lst
-tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > tar.got 2>&1
+tar cvf amhello-1.0-i686.tar.gz $(cat ../files.lst) > tar.got 2>&1
-EXEEXT=`sed -n -e 's/^EXEEXT *= *//p' < ../Makefile`
+EXEEXT=$(sed -n -e 's/^EXEEXT *= *//p' < ../Makefile)
if tar --version </dev/null | grep GNU; then
LC_ALL=C sort tar.got > t
|| fatal_ "cannot get amhello tarball"
host=i586-mingw32msvc
-build=`"$am_scriptdir"/config.guess` && test -n "$build" \
+build=$("$am_scriptdir"/config.guess) && test -n "$build" \
|| fatal_ "cannot guess build platform"
case $build in *mingw*) skip_ "build system is MinGW too";; esac
AUTOMAKE_fails -Wnone
grep "^Makefile\.am:1:.*$warn_rx" stderr
# ansi2knr option in configure.ac
- echo > Makefile.am # `echo', not `:', for Solaris /bin/sh.
+ echo > Makefile.am # 'echo', not ':', for Solaris /bin/sh.
sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.ac
cat configure.ac # For debugging.
rm -rf autom4te*.cache
chmod +x ./lib
# Check if ar-lib can create an archive with "cr".
-opts=`./ar-lib ./lib cr foo.lib foo.obj`
+opts=$(./ar-lib ./lib cr foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
# Check if ar-lib can update an existing archive with "r".
touch foo.lib
-opts=`./ar-lib ./lib r foo.lib foo.obj`
+opts=$(./ar-lib ./lib r foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib can update an existing archive with "q".
-opts=`./ar-lib ./lib q foo.lib foo.obj`
+opts=$(./ar-lib ./lib q foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "u" as a modifier.
# NOTE: "u" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib ru foo.lib foo.obj`
+opts=$(./ar-lib ./lib ru foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "s" as a modifier.
-opts=`./ar-lib ./lib rs foo.lib foo.obj`
+opts=$(./ar-lib ./lib rs foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "S" as a modifier.
-opts=`./ar-lib ./lib rS foo.lib foo.obj`
+opts=$(./ar-lib ./lib rS foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib passes on @FILE with "r"
-opts=`./ar-lib ./lib r foo.lib @list`
+opts=$(./ar-lib ./lib r foo.lib @list)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
# Check if ar-lib can delete a member from an archive with "d".
-opts=`./ar-lib ./lib d foo.lib foo.obj`
+opts=$(./ar-lib ./lib d foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
# Check if ar-lib can delete members in an @FILE.
echo foo.obj > foolist
-opts=`./ar-lib ./lib d foo.lib @foolist`
+opts=$(./ar-lib ./lib d foo.lib @foolist)
test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
# Check if ar-lib can list archive members with "t".
-opts=`./ar-lib ./lib t foo.lib`
+opts=$(./ar-lib ./lib t foo.lib)
test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
# Check if ar-lib accepts "v" as a modifier.
# NOTE: "v" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib tv foo.lib`
+opts=$(./ar-lib ./lib tv foo.lib)
test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
# Check if ar-lib can extract archive members with "x".
touch fake.lib
-opts=`./ar-lib ./lib x fake.lib`
+opts=$(./ar-lib ./lib x fake.lib)
test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
# Check if ar-lib can extract specified archive members with "x".
-opts=`./ar-lib ./lib x foo.lib foo.obj`
+opts=$(./ar-lib ./lib x foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib can extract members in an @FILE.
-opts=`./ar-lib ./lib x foo.lib @foolist`
+opts=$(./ar-lib ./lib x foo.lib @foolist)
test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib passes -lib and -LTCG through to the wrappee.
-opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+opts=$(./ar-lib ./lib -lib -LTCG x foo.lib foo.obj)
test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib can extract backslashed members.
touch fake2.lib
-opts=`./ar-lib ./lib x fake2.lib`
+opts=$(./ar-lib ./lib x fake2.lib)
test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
# Check if ar-lib accepts "s" as an action.
-opts=`./ar-lib ./lib s foo.lib`
+opts=$(./ar-lib ./lib s foo.lib)
test x"$opts" = x
:
esac
END
chmod +x bin/lib
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
$ACLOCAL
$AUTOCONF
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list1=`$AUTOMAKE --help \
- | sed -n "/^$re.*always/,/^ *$/p" \
- | sed 1d`
-list1=`echo $list1`
-
-list2=`$AUTOMAKE --help \
- | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
- | sed 1d`
-list2=`echo $list2`
+list1=$($AUTOMAKE --help \
+ | sed -n "/^$re.*always/,/^ *$/p" \
+ | sed 1d)
+list1=$(echo $list1)
+
+list2=$($AUTOMAKE --help \
+ | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
+ | sed 1d)
+list2=$(echo $list2)
test -n "$list1"
test -n "$list2"
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list=`$AUTOMAKE --help \
- | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
- | sed 1d`
+list=$($AUTOMAKE --help \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
+ | sed 1d)
# Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
test -n "$list"
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list=`$AUTOMAKE --help \
- | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
- | sed 1d`
+list=$($AUTOMAKE --help \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
+ | sed 1d)
# Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
test -n "$list"
SUBDIRS = sub3
.PHONY: test-prog-updated
test-prog-updated:
- stat older sub3/run$(EXEEXT) || : For debugging.
- test `ls -t older sub3/run$(EXEEXT) | sed 1q` = sub3/run$(EXEEXT)
+ is_newest sub3/run$(EXEEXT) sub2/config.bot
END
cat > sub3/Makefile.am <<'END'
./configure --enable-dependency-tracking
$MAKE
# Sanity check.
-cross_compiling || { sub3/run | grep grepme1; }
+cross_compiling || sub3/run | grep grepme1 || Exit 1
-: > older
$sleep
echo '#define NAME "grepme2"' > sub2/config.bot
$MAKE
-cross_compiling || { sub3/run | grep grepme2; }
+cross_compiling || sub3/run | grep grepme2 || Exit 1
$MAKE test-prog-updated
$MAKE distcheck
# This expects ./defs has already been included has already been included..
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
longpath=this-is/a-path/which-has/quite-a/definitely/truly/long_long_name
cachevar=am_cv_CC_dependencies_compiler_type
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AR
-`if test $depcomp_with_libtool = yes; then
- echo AC_PROG_LIBTOOL
-else
- echo AC_PROG_RANLIB
-fi`
+$(if test $depcomp_with_libtool = yes; then
+ echo AC_PROG_LIBTOOL
+ else
+ echo AC_PROG_RANLIB
+ fi)
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
END
absolute)
mkdir -p vpath-abs/build
cd vpath-abs/build
- absdir="`(cd .. && pwd)`" || fatal_ "getting absolute directory"
+ absdir=$(cd .. && pwd) || fatal_ "getting absolute directory"
setup_srcdir "$absdir/vpath-abs"
unset absdir
;;
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
+
+# Usage: is_newest FILE FILES
+# Fail if any file in FILES is newer than FILE, and print the list of
+# such files on the standard error.
+# Resolve ties in favor of FILE.
+
+set -u
+
+me=is_newest
+
+if test $# -lt 2; then
+ echo "$me: too few arguments" >&2
+ exit 2
+fi
+
+file=$1; shift
+newer_files=$(find "$@" -prune -newer "$file") || exit $?
+
+if test -n "$newer_files"; then
+ echo "$me: these files are newer than '$file':" >&2
+ for f in $newer_files; do echo "* $f" >&2; done
+ exit 1
+fi
+
+exit 0
tap_xfail_count_=0
tap_xpass_count_=0
-# The first "test -n" tries to avoid extra forks when possible.
-if test -n "${ZSH_VERSION}${BASH_VERSION}" \
- || (eval 'test $((1 + 1)) = 2') >/dev/null 2>&1
-then
- # Outer use of 'eval' needed to protect dumber shells from parsing
- # errors.
- eval 'incr_ () { eval "$1=\$((\${$1} + 1))"; }'
-else
- incr_ () { eval "$1=\`expr \${$1} + 1\`"; }
-fi
-
# not COMMAND [ARGS...]
# ---------------------
# Run the given command and invert its exit status.
-not ()
-{
- if "$@"; then return 1; else return 0; fi
-}
+not () { ! "$@"; }
# plan_ [unknown|later|lazy|now|NUMBER-OF-PLANNED-TESTS]
# ------------------------------------------------------
""|TODO|SKIP) ;;
*) bailout_ "result_: invalid directive '$directive_'" ;;
esac
- incr_ tap_count_
+ tap_count_=$(($tap_count_ + 1))
case $tap_result_,$tap_directive_ in
- ok,) incr_ tap_pass_count_;; # Passed.
- not\ ok,TODO) incr_ tap_xfail_count_;; # Expected failure.
- not\ ok,*) incr_ tap_fail_count_ ;; # Failed.
- ok,TODO) incr_ tap_xpass_count_ ;; # Unexpected pass.
- ok,SKIP) incr_ tap_skip_count_ ;; # Skipped.
- *) bailout_ "internal error in 'result_'";; # Can't happen.
+ ok,) # Passed.
+ tap_pass_count_=$(($tap_pass_count_ + 1)) ;;
+ not\ ok,TODO) # Expected failure.
+ tap_xfail_count_=$(($tap_xfail_count_ + 1)) ;;
+ not\ ok,*) # Failed.
+ tap_fail_count_=$(($tap_fail_count_ + 1)) ;;
+ ok,TODO) # Unexpected pass.
+ tap_xpass_count_=$(($tap_xpass_count_ + 1)) ;;
+ ok,SKIP) # Skipped.
+ tap_skip_count_=$(($tap_skip_count_ + 1)) ;;
+ *) # Can't happen.
+ bailout_ "internal error in 'result_'" ;;
esac
tap_text_="$tap_result_ $tap_count_"
if test x"$*" != x; then
skip_row_ ()
{
skip_count_=$1; shift
- for i_ in `seq_ $skip_count_`; do skip_ ${1+"$@"}; done
+ for i_ in $(seq_ $skip_count_); do skip_ ${1+"$@"}; done
}
# skip_all_ [REASON ...]
}
if test $use_colors = yes; then
- red='\e[0;31m'
- grn='\e[0;32m'
- lgn='\e[1;32m'
- blu='\e[1;34m'
- mgn='\e[0;35m'
- brg='\e[1m'
- std='\e[m'
+ red="$esc[0;31m"
+ grn="$esc[0;32m"
+ lgn="$esc[1;32m"
+ blu="$esc[1;34m"
+ mgn="$esc[0;35m"
+ brg="$esc[1m"
+ std="$esc[m"
echo AUTOMAKE_OPTIONS = color-tests >> Makefile.am
else
red= grn= lgn= blu= mgn= brg= std=
# Lots of non-failures (300 per kind).
(cat tap && cat tap && cat tap) > all.test
-test `wc -l <all.test` -eq 900 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 900 || Exit 99 # Sanity check.
echo 1..900 >> all.test # Test plan.
do_check --pass <<END
$success_header
# 1 failure and lots of non-failures means failure.
(cat tap && echo "not ok" && cat tap) > all.test
-test `wc -l <all.test` -eq 601 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 601 || Exit 99 # Sanity check.
echo 1..601 >> all.test # Test plan.
do_check --fail <<END
$failure_header
# 1 error and lots of non-failures means failure.
(cat tap && sed 30q tap && echo 'Bail out!') > all.test
-test `wc -l <all.test` -eq 331 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 331 || Exit 99 # Sanity check.
echo 1..331 >> all.test # Test plan.
do_check --fail <<END
$failure_header
--- /dev/null
+# -*- shell-script -*-
+#
+# Copyright (C) 1996-2012 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 <http://www.gnu.org/licenses/>.
+
+########################################################
+### IMPORTANT NOTE: keep this file 'set -e' clean. ###
+########################################################
+
+# Enable the errexit shell flag early.
+set -e
+
+# The name of the current test (without the '.sh' or '.tap' suffix).
+# Test scripts can override it if they need to (but this should
+# be done carefully).
+if test -z "$me"; then
+ # Strip all directory components.
+ me=${argv0##*/}
+ # Strip test suffix.
+ case $me in
+ *.tap) me=${me%.tap};;
+ *.sh) me=${me%.sh} ;;
+ esac
+fi
+
+
+## --------------------- ##
+## Early sanity checks. ##
+## --------------------- ##
+
+# Ensure $am_top_srcdir is set correctly.
+test -f "$am_top_srcdir/defs-static.in" || {
+ echo "$me: $am_top_srcdir/defs-static.in not found," \
+ "check \$am_top_srcdir" >&2
+ exit 99
+}
+
+# Ensure $am_top_builddir is set correctly.
+test -f "$am_top_builddir/defs-static" || {
+ echo "$me: $am_top_builddir/defs-static not found," \
+ "check \$am_top_builddir" >&2
+ exit 99
+}
+
+
+## ------------------ ##
+## Early variables. ##
+## ------------------ ##
+
+# A single whitespace character.
+sp=' '
+# A tabulation character.
+tab=' '
+# A newline character.
+nl='
+'
+# A literal escape character. Used by test checking colored output.
+esc='\e'
+
+# As autoconf-generated configure scripts do, ensure that IFS
+# is defined initially, so that saving and restoring $IFS works.
+IFS=$sp$tab$nl
+
+
+## ----------------------- ##
+## Early debugging info. ##
+## ----------------------- ##
+
+echo "Running from installcheck: $am_running_installcheck"
+echo "Using TAP: $am_using_tap"
+echo "PATH = $PATH"
+
+
+## ---------------------- ##
+## Environment cleanup. ##
+## ---------------------- ##
+
+# Temporarily disable this, since some shells (e.g., older version
+# of Bash) can return a non-zero exit status upon the when a non-set
+# variable is unset.
+set +e
+
+# Unset some make-related variables that may cause $MAKE to act like
+# a recursively invoked sub-make. Any $MAKE invocation in a test is
+# conceptually an independent invocation, not part of the main
+# 'automake' build.
+unset MFLAGS MAKEFLAGS AM_MAKEFLAGS MAKELEVEL
+unset __MKLVL__ MAKE_JOBS_FIFO # For BSD make.
+unset DMAKE_CHILD DMAKE_DEF_PRINTED DMAKE_MAX_JOBS # For Solaris dmake.
+# Unset verbosity flag.
+unset V
+# Also unset variables that will let "make -e install" divert
+# files into unwanted directories.
+unset DESTDIR
+unset prefix exec_prefix bindir datarootdir datadir docdir dvidir
+unset htmldir includedir infodir libdir libexecdir localedir mandir
+unset oldincludedir pdfdir psdir sbindir sharedstatedir sysconfdir
+# Unset variables that might change the "make distcheck" behaviour.
+unset DISTCHECK_CONFIGURE_FLAGS AM_DISTCHECK_CONFIGURE_FLAGS
+# Used by install rules for info files.
+unset AM_UPDATE_INFO_DIR
+# The tests call "make -e" but we do not want $srcdir from the environment
+# to override the definition from the Makefile.
+unset srcdir
+# Also unset variables that control our test driver. While not
+# conceptually independent, they cause some changed semantics we
+# need to control (and test for) in some of the tests to ensure
+# backward-compatible behavior.
+unset TESTS_ENVIRONMENT AM_TESTS_ENVIRONMENT
+unset DISABLE_HARD_ERRORS
+unset AM_COLOR_TESTS
+unset TESTS
+unset XFAIL_TESTS
+unset TEST_LOGS
+unset TEST_SUITE_LOG
+unset RECHECK_LOGS
+unset VERBOSE
+for pfx in TEST_ SH_ TAP_ ''; do
+ unset ${pfx}LOG_COMPILER
+ unset ${pfx}LOG_COMPILE # Not a typo!
+ unset ${pfx}LOG_FLAGS
+ unset AM_${pfx}LOG_FLAGS
+ unset ${pfx}LOG_DRIVER
+ unset ${pfx}LOG_DRIVER_FLAGS
+ unset AM_${pfx}LOG_DRIVER_FLAGS
+done
+unset pfx
+
+# Re-enable, it had been temporarily disabled above.
+set -e
+
+## ---------------------------- ##
+## Auxiliary shell functions. ##
+## ---------------------------- ##
+
+# Tell whether we should keep the test directories around, even in
+# case of success. By default, we don't.
+am_keeping_testdirs ()
+{
+ case $keep_testdirs in
+ ""|n|no|NO) return 1;;
+ *) return 0;;
+ esac
+}
+
+# This is used in 'Exit' and in the exit trap. See comments in the latter
+# for more information,
+am__test_skipped=no
+
+# We use a trap below for cleanup. This requires us to go through
+# hoops to get the right exit status transported through the signal.
+# So use "Exit STATUS" instead of "exit STATUS" inside of the tests.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function.
+Exit ()
+{
+ set +e
+ # See comments in the exit trap for the reason we do this.
+ test 77 = $1 && am__test_skipped=yes
+ (exit $1); exit $1
+}
+
+if test $am_using_tap = yes; then
+ am_funcs_file=tap-functions.sh
+else
+ am_funcs_file=plain-functions.sh
+fi
+
+if test -f "$am_testauxdir/$am_funcs_file"; then
+ . "$am_testauxdir/$am_funcs_file" || {
+ echo "$me: error sourcing $am_testauxdir/$am_funcs_file" >&2
+ Exit 99
+ }
+else
+ echo "$me: $am_testauxdir/$am_funcs_file not found" >&2
+ Exit 99
+fi
+unset am_funcs_file
+
+# cross_compiling
+# ---------------
+# Tell whether we are cross-compiling. This is especially useful to skip
+# tests (or portions of them) that requires a native compiler.
+cross_compiling ()
+{
+ # Quoting from the autoconf manual:
+ # ... [$host_alias and $build both] default to the result of running
+ # config.guess, unless you specify either --build or --host. In
+ # this case, the default becomes the system type you specified.
+ # If you specify both, *and they're different*, configure enters
+ # cross compilation mode (so it doesn't run any tests that require
+ # execution).
+ test x"$host_alias" != x && test x"$build_alias" != x"$host_alias"
+}
+
+# is_blocked_signal SIGNAL-NUMBER
+# --------------------------------
+# Return success if the given signal number is blocked in the shell,
+# return a non-zero exit status and print a proper diagnostic otherwise.
+is_blocked_signal ()
+{
+ # Use perl, since trying to do this portably in the shell can be
+ # very tricky, if not downright impossible. For reference, see:
+ # <http://lists.gnu.org/archive/html/bug-autoconf/2011-09/msg00004.html>
+ if $PERL -w -e '
+ use strict;
+ use warnings FATAL => "all";
+ use POSIX;
+ my %oldsigaction = ();
+ sigaction('"$1"', 0, \%oldsigaction);
+ exit ($oldsigaction{"HANDLER"} eq "IGNORE" ? 0 : 77);
+ '; then
+ return 0
+ elif test $? -eq 77; then
+ return 1
+ else
+ fatal_ "couldn't determine whether signal $1 is blocked"
+ fi
+}
+
+# AUTOMAKE_run [-e STATUS] [-d DESCRIPTION] [--] [AUTOMAKE-ARGS...]
+# -----------------------------------------------------------------
+# Run automake with AUTOMAKE-ARGS, and fail if it doesn't exit with
+# STATUS. Should be polymorphic for TAP and "plain" tests. The
+# DESCRIPTION, when provided, is used for console reporting, only if
+# the TAP protocol is in use in the current test script.
+AUTOMAKE_run ()
+{
+ am__desc=
+ am__exp_rc=0
+ while test $# -gt 0; do
+ case $1 in
+ -d) am__desc=$2; shift;;
+ -e) am__exp_rc=$2; shift;;
+ --) shift; break;;
+ # Don't fail on unknown option: assume they (and the rest of the
+ # command line) are to be passed verbatim to automake (so stop our
+ # own option parsing).
+ *) break;;
+ esac
+ shift
+ done
+ am__got_rc=0
+ $AUTOMAKE ${1+"$@"} >stdout 2>stderr || am__got_rc=$?
+ cat stderr >&2
+ cat stdout
+ if test $am_using_tap != yes; then
+ test $am__got_rc -eq $am__exp_rc || Exit 1
+ return
+ fi
+ if test -z "$am__desc"; then
+ if test $am__got_rc -eq $am__exp_rc; then
+ am__desc="automake exited $am__got_rc"
+ else
+ am__desc="automake exited $am__got_rc, expecting $am__exp_rc"
+ fi
+ fi
+ command_ok_ "$am__desc" test $am__got_rc -eq $am__exp_rc
+}
+
+# AUTOMAKE_fails [-d DESCRIPTION] [OPTIONS...]
+# --------------------------------------------
+# Run automake with OPTIONS, and fail if doesn't exit with status 1.
+# Should be polymorphic for TAP and "plain" tests. The DESCRIPTION,
+# when provided, is used for console reporting, only if the TAP
+# protocol is in use in the current test script.
+AUTOMAKE_fails ()
+{
+ AUTOMAKE_run -e 1 ${1+"$@"}
+}
+
+# extract_configure_help { --OPTION | VARIABLE-NAME } [FILES]
+# -----------------------------------------------------------
+# Use this to extract from the output of "./configure --help" (or similar)
+# the description or help message associated to the given --OPTION or
+# VARIABLE-NAME.
+extract_configure_help ()
+{
+ am__opt_re='' am__var_re=''
+ case $1 in
+ --*'=') am__opt_re="^ $1";;
+ --*'[=]') am__opt_re='^ '$(printf '%s\n' "$1" | sed 's/...$//')'\[=';;
+ --*) am__opt_re="^ $1( .*|$)";;
+ *) am__var_re="^ $1( .*|$)";;
+ esac
+ shift
+ if test x"$am__opt_re" != x; then
+ LC_ALL=C awk '
+ /'"$am__opt_re"'/ { print; do_print = 1; next; }
+ /^$/ { do_print = 0; next }
+ /^ --/ { do_print = 0; next }
+ (do_print == 1) { print }
+ ' ${1+"$@"}
+ else
+ LC_ALL=C awk '
+ /'"$am__var_re"'/ { print; do_print = 1; next; }
+ /^$/ { do_print = 0; next }
+ /^ [A-Z][A-Z0-9_]* / { do_print = 0; next }
+ /^ [A-Z][A-Z0-9_]*$/ { do_print = 0; next }
+ (do_print == 1) { print }
+ ' ${1+"$@"}
+ fi
+}
+
+# grep_configure_help { --OPTION | VARIABLE-NAME } REGEXP
+# -------------------------------------------------------
+# Grep the section of "./configure --help" output associated with either
+# --OPTION or VARIABLE-NAME for the given *extended* regular expression.
+grep_configure_help ()
+{
+ ./configure --help > am--all-help \
+ || { cat am--all-help; Exit 1; }
+ cat am--all-help
+ extract_configure_help "$1" am--all-help > am--our-help \
+ || { cat am--our-help; Exit 1; }
+ cat am--our-help
+ $EGREP "$2" am--our-help || Exit 1
+}
+
+# using_gmake
+# -----------
+# Return success if $MAKE is GNU make, return failure otherwise.
+# Caches the result for speed reasons.
+using_gmake ()
+{
+ case $am__using_gmake in
+ yes)
+ return 0;;
+ no)
+ return 1;;
+ '')
+ # Use --version AND -v, because SGI Make doesn't fail on --version.
+ # Also grep for GNU because newer versions of FreeBSD make do
+ # not complain about --version (they seem to silently ignore it).
+ if $MAKE --version -v | grep GNU; then
+ am__using_gmake=yes
+ return 0
+ else
+ am__using_gmake=no
+ return 1
+ fi;;
+ *)
+ fatal_ "invalid value for \$am__using_gmake: '$am__using_gmake'";;
+ esac
+}
+am__using_gmake="" # Avoid interferences from the environment.
+
+# make_can_chain_suffix_rules
+# ---------------------------
+# Return 0 if $MAKE is a make implementation that can chain suffix rules
+# automatically, return 1 otherwise. Caches the result for speed reasons.
+make_can_chain_suffix_rules ()
+{
+ if test -z "$am__can_chain_suffix_rules"; then
+ if using_gmake; then
+ am__can_chain_suffix_rules=yes
+ return 0
+ else
+ mkdir am__chain.dir$$
+ cd am__chain.dir$$
+ unindent > Makefile << 'END'
+ .SUFFIXES: .u .v .w
+ .u.v: ; cp $< $@
+ .v.w: ; cp $< $@
+END
+ echo make can chain suffix rules > foo.u
+ if $MAKE foo.w && diff foo.u foo.w; then
+ am__can_chain_suffix_rules=yes
+ else
+ am__can_chain_suffix_rules=no
+ fi
+ cd ..
+ rm -rf am__chain.dir$$
+ fi
+ fi
+ case $am__can_chain_suffix_rules in
+ yes) return 0;;
+ no) return 1;;
+ *) fatal_ "make_can_chain_suffix_rules: internal error";;
+ esac
+}
+am__can_chain_suffix_rules="" # Avoid interferences from the environment.
+
+# useless_vpath_rebuild
+# ---------------------
+# Tell whether $MAKE suffers of the bug triggering automake bug#7884.
+# For example, this happens with FreeBSD make, since in a VPATH build
+# it tends to rebuilt files for which there is an explicit or even just
+# a suffix rule, even if said files are already available in the VPATH
+# directory.
+useless_vpath_rebuild ()
+{
+ if test -z "$am__useless_vpath_rebuild"; then
+ if using_gmake; then
+ am__useless_vpath_rebuild=no
+ return 1
+ fi
+ mkdir am__vpath.dir$$
+ cd am__vpath.dir$$
+ touch foo.a foo.b bar baz
+ mkdir build
+ cd build
+ unindent > Makefile << 'END'
+ .SUFFIXES: .a .b
+ VPATH = ..
+ all: foo.b baz
+ .PHONY: all
+ .a.b: ; cp $< $@
+ baz: bar ; cp ../baz bar
+END
+ if $MAKE all && test ! -f foo.b && test ! -f bar; then
+ am__useless_vpath_rebuild=no
+ else
+ am__useless_vpath_rebuild=yes
+ fi
+ cd ../..
+ rm -rf am__vpath.dir$$
+ fi
+ case $am__useless_vpath_rebuild in
+ yes) return 0;;
+ no) return 1;;
+ "") ;;
+ *) fatal_ "no_useless_builddir_remake: internal error";;
+ esac
+}
+am__useless_vpath_rebuild=""
+
+yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
+
+# seq_ - print a sequence of numbers
+# ----------------------------------
+# This function simulates GNU seq(1) portably. Valid usages:
+# - seq LAST
+# - seq FIRST LAST
+# - seq FIRST INCREMENT LAST
+seq_ ()
+{
+ case $# in
+ 0) fatal_ "seq_: missing argument";;
+ 1) seq_first=1 seq_incr=1 seq_last=$1;;
+ 2) seq_first=$1 seq_incr=1 seq_last=$2;;
+ 3) seq_first=$1 seq_incr=$2 seq_last=$3;;
+ *) fatal_ "seq_: too many arguments";;
+ esac
+ i=$seq_first
+ while test $i -le $seq_last; do
+ echo $i
+ i=$(($i + $seq_incr))
+ done
+}
+
+# rm_rf_ [FILES OR DIRECTORIES ...]
+# ---------------------------------
+# Recursively remove the given files or directory, also handling the case
+# of non-writable subdirectories.
+rm_rf_ ()
+{
+ test $# -gt 0 || return 0
+ # Ignore failures in find, we are only interested in failures of the
+ # final rm.
+ find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || :
+ rm -rf "$@"
+}
+
+# count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
+# -----------------------------------------------------------------------
+# Check that a testsuite run driven by the parallel-tests harness has
+# had the specified numbers of test results (specified by kind).
+# This function assumes that the output of "make check" or "make recheck"
+# has been saved in the 'stdout' file in the current directory, and its
+# log in the 'test-suite.log' file.
+count_test_results ()
+{
+ # Use a subshell so that we won't pollute the script namespace.
+ (
+ # TODO: Do proper checks on the arguments?
+ total=ERR pass=ERR fail=ERR xpass=ERR xfail=ERR skip=ERR error=ERR
+ eval "$@"
+ # For debugging.
+ $EGREP -i '(total|x?pass|x?fail|skip|error)' stdout || :
+ rc=0
+ # Avoid spurious failures with shells with "overly sensible"
+ # errexit shell flag, such as e.g., Solaris /bin/sh.
+ set +e
+ test $(grep -c '^PASS:' stdout) -eq $pass || rc=1
+ test $(grep -c '^XFAIL:' stdout) -eq $xfail || rc=1
+ test $(grep -c '^SKIP:' stdout) -eq $skip || rc=1
+ test $(grep -c '^FAIL:' stdout) -eq $fail || rc=1
+ test $(grep -c '^XPASS:' stdout) -eq $xpass || rc=1
+ test $(grep -c '^ERROR:' stdout) -eq $error || rc=1
+ grep "^# TOTAL: *$total$" stdout || rc=1
+ grep "^# PASS: *$pass$" stdout || rc=1
+ grep "^# XFAIL: *$xfail$" stdout || rc=1
+ grep "^# SKIP: *$skip$" stdout || rc=1
+ grep "^# FAIL: *$fail$" stdout || rc=1
+ grep "^# XPASS: *$xpass$" stdout || rc=1
+ grep "^# ERROR: *$error$" stdout || rc=1
+ test $rc -eq 0
+ )
+}
+
+commented_sed_unindent_prog='
+ /^$/b # Nothing to do for empty lines.
+ x # Get x<indent> into pattern space.
+ /^$/{ # No prior x<indent>, go prepare it.
+ g # Copy this 1st non-blank line into pattern space.
+ s/^\(['"$tab"' ]*\).*/x\1/ # Prepare x<indent> in pattern space.
+ } # Now: x<indent> in pattern and <line> in hold.
+ G # Build x<indent>\n<line> in pattern space, and
+ h # duplicate it into hold space.
+ s/\n.*$// # Restore x<indent> in pattern space, and
+ x # exchange with the above duplicate in hold space.
+ s/^x\(.*\)\n\1// # Remove leading <indent> from <line>.
+ s/^x.*\n// # Restore <line> when there is no leading <indent>.
+'
+
+# unindent [input files...]
+# -------------------------
+# Remove the "proper" amount of leading whitespace from the given files,
+# and output the result on stdout. That amount is determined by looking
+# at the leading whitespace of the first non-blank line in the input
+# files. If no input file is specified, standard input is implied.
+unindent ()
+{
+ if test x"$sed_unindent_prog" = x; then
+ sed_unindent_prog=$(printf '%s\n' "$commented_sed_unindent_prog" \
+ | sed -e "s/ *# .*//")
+ fi
+ sed "$sed_unindent_prog" ${1+"$@"}
+}
+sed_unindent_prog="" # Avoid interferences from the environment.
+
+# get_shell_script SCRIPT-NAME
+# -----------------------------
+# Fetch an Automake-provided shell script from the 'lib/' directory into
+# the current directory, and, if the '$am_test_prefer_config_shell'
+# variable is set to "yes", modify its shebang line to use $SHELL instead
+# of /bin/sh.
+get_shell_script ()
+{
+ test ! -f "$1" || rm -f "$1" || return 99
+ if test x"$am_test_prefer_config_shell" = x"yes"; then
+ sed "1s|#!.*|#! $SHELL|" "$am_scriptdir/$1" > "$1" \
+ && chmod a+x "$1" \
+ || return 99
+ else
+ cp -f "$am_scriptdir/$1" . || return 99
+ fi
+ sed 10q "$1" # For debugging.
+}
+
+# require_xsi SHELL
+# -----------------
+# Skip the test if the given shell fails to support common XSI constructs.
+require_xsi ()
+{
+ test $# -eq 1 || fatal_ "require_xsi needs exactly one argument"
+ echo "$me: trying some XSI constructs with $1"
+ $1 -c "$xsi_shell_code" || skip_all_ "$1 lacks XSI features"
+}
+# Shell code supposed to work only with XSI shells. Keep this in sync
+# with libtool.m4:_LT_CHECK_SHELL_FEATURES.
+xsi_shell_code='
+ _lt_dummy="a/b/c"
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
+ && eval '\''test $(( 1 + 1 )) -eq 2 \
+ && test "${#_lt_dummy}" -eq 5'\'
+
+# fetch_tap_driver
+# ----------------
+# Fetch the Automake-provided TAP driver from the 'lib/' directory into
+# the current directory, and edit its shebang line so that it will be
+# run with the perl interpreter determined at configure time.
+fetch_tap_driver ()
+{
+ # TODO: we should devise a way to make the shell TAP driver tested also
+ # TODO: with /bin/sh, for better coverage.
+ case $am_tap_implementation in
+ perl)
+ $PERL -MTAP::Parser -e 1 \
+ || skip_all_ "cannot import TAP::Parser perl module"
+ sed "1s|#!.*|#! $PERL -w|" "$am_scriptdir"/tap-driver.pl >tap-driver
+ ;;
+ shell)
+ AM_TAP_AWK=$AWK; export AM_TAP_AWK
+ sed "1s|#!.*|#! $SHELL|" "$am_scriptdir"/tap-driver.sh >tap-driver
+ ;;
+ *)
+ fatal_ "invalid \$am_tap_implementation '$am_tap_implementation'" ;;
+ esac \
+ && chmod a+x tap-driver \
+ || framework_failure_ "couldn't fetch $am_tap_implementation TAP driver"
+ sed 10q tap-driver # For debugging.
+}
+# The shell/awk implementation of the TAP driver is still mostly dummy, so
+# use the perl implementation by default for the moment.
+am_tap_implementation=${am_tap_implementation-shell}
+
+# Usage: require_compiler_ {cc|c++|fortran|fortran77}
+require_compiler_ ()
+{
+ case $# in
+ 0) fatal_ "require_compiler_: missing argument";;
+ 1) ;;
+ *) fatal_ "require_compiler_: too many arguments";;
+ esac
+ case $1 in
+ cc)
+ am__comp_lang="C"
+ am__comp_var=CC
+ am__comp_flag_vars='CFLAGS CPPFLAGS'
+ ;;
+ c++)
+ am__comp_lang="C++"
+ am__comp_var=CXX
+ am__comp_flag_vars='CXXFLAGS CPPFLAGS'
+ ;;
+ fortran)
+ am__comp_lang="Fortran"
+ am__comp_var=FC
+ am__comp_flag_vars='FCFLAGS'
+ ;;
+ fortran77)
+ am__comp_lang="Fortran 77"
+ am__comp_var=F77
+ am__comp_flag_vars='FFLAGS'
+ ;;
+ esac
+ shift
+ eval "am__comp_prog=\${$am__comp_var}" \
+ || fatal_ "expanding \${$am__comp_var} in require_compiler_"
+ case $am__comp_prog in
+ "")
+ fatal_ "botched configuration: \$$am__comp_var is empty";;
+ false)
+ skip_all_ "no $am__comp_lang compiler available";;
+ autodetect|autodetected)
+ # Let the ./configure commands in the test script try to determine
+ # these automatically.
+ unset $am__comp_var $am__comp_flag_vars;;
+ *)
+ # Pre-set these for the ./configure commands in the test script.
+ export $am__comp_var $am__comp_flag_vars;;
+ esac
+ # Delete private variables.
+ unset am__comp_lang am__comp_prog am__comp_var am__comp_flag_vars
+}
+
+## ----------------------------------------------------------- ##
+## Checks for required tools, and additional setups (if any) ##
+## required by them. ##
+## ----------------------------------------------------------- ##
+
+# Performance tests must be enabled explicitly.
+case $argv0 in
+ */perf/*)
+ case $AM_TESTSUITE_PERF in
+ [yY]|[yY]es|1) ;;
+ *) skip_ "performance tests not explicitly enabled" ;;
+ esac
+ ;;
+esac
+
+# Look for (and maybe set up) required tools and/or system features; skip
+# the current test if they are not found.
+for tool in : $required
+do
+ # Check that each required tool is present.
+ case $tool in
+ :) ;;
+ cc|c++|fortran|fortran77)
+ require_compiler_ $tool;;
+ xsi-lib-shell)
+ if test x"$am_test_prefer_config_shell" = x"yes"; then
+ require_xsi "$SHELL"
+ else
+ require_xsi "/bin/sh"
+ fi
+ ;;
+ bzip2)
+ # Do not use --version, older versions bzip2 still tries to compress
+ # stdin.
+ echo "$me: running bzip2 --help"
+ bzip2 --help \
+ || skip_all_ "required program 'bzip2' not available"
+ ;;
+ cl)
+ CC=cl
+ # Don't export CFLAGS, as that could have been initialized to only
+ # work with the C compiler detected at configure time. If the user
+ # wants CFLAGS to also influence 'cl', he can still export CFLAGS
+ # in the environment "by hand" before calling the testsuite.
+ export CC CPPFLAGS
+ echo "$me: running $CC -?"
+ $CC -? || skip_all_ "Microsoft C compiler '$CC' not available"
+ ;;
+ etags)
+ # Exuberant Ctags will create a TAGS file even
+ # when asked for --help or --version. (Emacs's etags
+ # does not have such problem.) Use -o /dev/null
+ # to make sure we do not pollute the build directory.
+ echo "$me: running etags --version -o /dev/null"
+ etags --version -o /dev/null \
+ || skip_all_ "required program 'etags' not available"
+ ;;
+ GNUmake)
+ for make_ in "$MAKE" gmake gnumake :; do
+ MAKE=$make_ am__using_gmake=''
+ test "$MAKE" = : && break
+ echo "$me: determine whether $MAKE is GNU make"
+ using_gmake && break
+ : For shells with busted 'set -e'.
+ done
+ test "$MAKE" = : && skip_all_ "this test requires GNU make"
+ export MAKE
+ unset make_
+ ;;
+ gcj)
+ GCJ=$GNU_GCJ GCJFLAGS=$GNU_GCJFLAGS; export GCJ GCJFLAGS
+ test "$GCJ" = false && skip_all_ "GNU Java compiler unavailable"
+ : For shells with busted 'set -e'.
+ ;;
+ gcc)
+ CC=$GNU_CC CFLAGS=$GNU_CFLAGS; export CC CFLAGS CPPFLAGS
+ test "$CC" = false && skip_all_ "GNU C compiler unavailable"
+ : For shells with busted 'set -e'.
+ ;;
+ g++)
+ CXX=$GNU_CXX CXXFLAGS=$GNU_CXXFLAGS; export CXX CXXFLAGS CPPFLAGS
+ test "$CXX" = false && skip_all_ "GNU C++ compiler unavailable"
+ : For shells with busted 'set -e'.
+ ;;
+ gfortran)
+ FC=$GNU_FC FCFLAGS=$GNU_FCFLAGS; export FC FCFLAGS
+ test "$FC" = false && skip_all_ "GNU Fortran compiler unavailable"
+ case " $required " in
+ *\ g77\ *) ;;
+ *) F77=$FC FFLAGS=$FCFLAGS; export F77 FFLAGS;;
+ esac
+ ;;
+ g77)
+ F77=$GNU_F77 FFLAGS=$GNU_FFLAGS; export F77 FFLAGS
+ test "$F77" = false && skip_all_ "GNU Fortran 77 compiler unavailable"
+ case " $required " in
+ *\ gfortran\ *) ;;
+ *) FC=$F77 FCFLAGS=$FFLAGS; export FC FCFLAGS;;
+ esac
+ ;;
+ grep-nonprint)
+ # Check that grep can parse nonprinting characters correctly.
+ # BSD 'grep' works from a pipe, but not a seekable file.
+ # GNU or BSD 'grep -a' works on files, but is not portable.
+ case $(echo "$esc" | grep .)$(echo "$esc" | grep "$esc") in
+ "$esc$esc") ;;
+ *) skip_ "grep can't handle nonprinting characters correctly";;
+ esac
+ ;;
+ javac)
+ # The Java compiler from JDK 1.5 (and presumably earlier versions)
+ # cannot handle the '-version' option by itself: it bails out
+ # telling that source files are missing. Adding also the '-help'
+ # option seems to solve the problem.
+ echo "$me: running javac -version -help"
+ javac -version -help || skip_all_ "Sun Java compiler not available"
+ ;;
+ java)
+ # See the comments above about 'javac' for why we use also '-help'.
+ echo "$me: running java -version -help"
+ java -version -help || skip_all_ "Sun Java interpreter not found"
+ ;;
+ lib)
+ AR=lib
+ export AR
+ # Attempting to create an empty archive will actually not
+ # create the archive, but lib will output its version.
+ echo "$me: running $AR -out:defstest.lib"
+ $AR -out:defstest.lib \
+ || skip_all_ "Microsoft 'lib' utility not available"
+ ;;
+ makedepend)
+ echo "$me: running makedepend -f-"
+ makedepend -f- \
+ || skip_all_ "required program 'makedepend' not available"
+ ;;
+ mingw)
+ uname_s=$(uname -s || echo UNKNOWN)
+ echo "$me: system name: $uname_s"
+ case $uname_s in
+ MINGW*) ;;
+ *) skip_all_ "this test requires MSYS in MinGW mode" ;;
+ esac
+ unset uname_s
+ ;;
+ non-root)
+ # Skip this test case if the user is root.
+ # We try to append to a read-only file to detect this.
+ priv_check_temp=priv-check.$$
+ touch $priv_check_temp && chmod a-w $priv_check_temp \
+ || framework_failure_ "creating unwritable file $priv_check_temp"
+ # Not a useless use of subshell: lesser shells like Solaris /bin/sh
+ # can exit if a builtin fails.
+ overwrite_status=0
+ (echo foo >> $priv_check_temp) || overwrite_status=$?
+ rm -f $priv_check_temp
+ if test $overwrite_status -eq 0; then
+ skip_all_ "cannot drop file write permissions"
+ fi
+ unset priv_check_temp overwrite_status
+ ;;
+ perl-threads)
+ if test "$WANT_NO_THREADS" = "yes"; then
+ skip_all_ "Devel::Cover cannot cope with threads"
+ fi
+ ;;
+ native)
+ # Don't use "&&" here, to avoid a bug of 'set -e' present in
+ # some (even relatively recent) versions of the BSD shell.
+ # We add the dummy "else" branch for extra safety.
+ ! cross_compiling || skip_all_ "doesn't work in cross-compile mode"
+ ;;
+ python)
+ # Python doesn't support --version, it has -V
+ echo "$me: running python -V"
+ python -V || skip_all_ "python interpreter not available"
+ ;;
+ ro-dir)
+ # Skip this test case if read-only directories aren't supported
+ # (e.g., under DOS.)
+ ro_dir_temp=ro_dir.$$
+ mkdir $ro_dir_temp && chmod a-w $ro_dir_temp \
+ || framework_failure_ "creating unwritable directory $ro_dir_temp"
+ # Not a useless use of subshell: lesser shells like Solaris /bin/sh
+ # can exit if a builtin fails.
+ create_status=0
+ (: > $ro_dir_temp/probe) || create_status=$?
+ rm -rf $ro_dir_temp
+ if test $create_status -eq 0; then
+ skip_all_ "cannot drop directory write permissions"
+ fi
+ unset ro_dir_temp create_status
+ ;;
+ runtest)
+ # DejaGnu's runtest program. We rely on being able to specify
+ # the program on the runtest command-line. This requires
+ # DejaGnu 1.4.3 or later.
+ echo "$me: running runtest SOMEPROGRAM=someprogram --version"
+ runtest SOMEPROGRAM=someprogram --version \
+ || skip_all_ "DejaGnu is not available"
+ ;;
+ tex)
+ # No all versions of Tex support '--version', so we use
+ # a configure check.
+ if test -z "$TEX"; then
+ skip_all_ "TeX is required, but it wasn't found by configure"
+ fi
+ ;;
+ lex)
+ test x"$LEX" = x"false" && skip_all_ "lex not found or disabled"
+ export LEX
+ ;;
+ yacc)
+ test x"$YACC" = x"false" && skip_all_ "yacc not found or disabled"
+ export YACC
+ ;;
+ flex)
+ LEX=flex; export LEX
+ echo "$me: running flex --version"
+ flex --version || skip_all_ "required program 'flex' not available"
+ ;;
+ bison)
+ YACC='bison -y'; export YACC
+ echo "$me: running bison --version"
+ bison --version || skip_all_ "required program 'bison' not available"
+ ;;
+ *)
+ # Generic case: the tool must support --version.
+ echo "$me: running $tool --version"
+ # It is not likely but possible that $tool is a special builtin,
+ # in which case the shell is allowed to exit after an error. So
+ # we need the subshell here. Also, some tools, like Sun cscope,
+ # can be interactive without redirection.
+ ($tool --version) </dev/null \
+ || skip_all_ "required program '$tool' not available"
+ ;;
+ esac
+done
+
+# Using just $am_top_builddir for the check here is ok, since the
+# further temporary subdirectory where the test will be run is
+# ensured not to contain any whitespace character.
+case $am_top_builddir in
+ *\ *|*\ *)
+ case " $required " in
+ *' libtool '* | *' libtoolize '* )
+ skip_all_ "libtool has problems with spaces in builddir name";;
+ esac
+ ;;
+esac
+
+# This test is necessary, although Automake's configure script bails out
+# when $srcdir contains spaces. This is because $am_top_srcdir is in not
+# configure-time $srcdir, but is instead configure-time $abs_srcdir, and
+# that is allowed to contain spaces.
+case $am_top_srcdir in
+ *\ * |*\ *)
+ case " $required " in
+ *' libtool '* | *' libtoolize '* | *' gettext '* )
+ skip_all_ "spaces in srcdir name: libtool/gettext tests won't work";;
+ esac
+ ;;
+esac
+
+# We might need extra macros, e.g., from Libtool or Gettext.
+case " $required " in *\ libtool*) . ./t/libtool-macros.dir/get.sh;; esac
+case " $required " in *\ gettext*) . ./t/gettext-macros.dir/get.sh;; esac
+
+
+## ---------------------------------------------------------------- ##
+## Create and set up of the temporary directory used by the test. ##
+## Set up of the exit trap for cleanup of said directory. ##
+## ---------------------------------------------------------------- ##
+
+# This might be used in testcases checking distribution-related features.
+# Test scripts are free to override this if they need to.
+distdir=$me-1.0
+
+# Set up the exit trap.
+trap 'exit_status=$?
+ set +e
+ cd "$am_top_builddir"
+ if test $am_using_tap = yes; then
+ if test "$planned_" = later && test $exit_status -eq 0; then
+ plan_ "now"
+ fi
+ test $exit_status -eq 0 && test $tap_pass_count_ -eq $tap_count_ \
+ || keep_testdirs=yes
+ else
+ # This is to ensure that a test script does give a SKIP outcome just
+ # because a command in it happens to exit with status 77. This
+ # behaviour, while from time to time useful to developers, is not
+ # meant to be enabled by default, as it could cause spurious failures
+ # in the wild. Thus it will be enabled only when the variable
+ # "am_explicit_skips" is set to a "true" value.
+ case $am_explicit_skips in
+ [yY]|[yY]es|1)
+ if test $exit_status -eq 77 && test $am__test_skipped != yes; then
+ echo "$me: implicit skip turned into failure"
+ exit_status=78
+ fi;;
+ esac
+ test $exit_status -eq 0 || keep_testdirs=yes
+ fi
+ am_keeping_testdirs || rm_rf_ $testSubDir
+ set +x
+ echo "$me: exit $exit_status"
+ exit $exit_status
+' 0
+trap "fatal_ 'caught signal SIGHUP'" 1
+trap "fatal_ 'caught signal SIGINT'" 2
+trap "fatal_ 'caught signal SIGTERM'" 15
+# Various shells seems to just ignore SIGQUIT under some circumstances,
+# even if the signal is not blocked; however, if the signal it trapped,
+# the trap gets correctly executed. So we also trap SIGQUIT.
+# Here is a list of some shells that have been verified to exhibit the
+# problematic behavior with SIGQUIT:
+# - zsh 4.3.12 on Debian GNU/Linux
+# - /bin/ksh and /usr/xpg4/bin/sh on Solaris 10
+# - Bash 3.2.51 on Solaris 10 and bash 4.1.5 on Debian GNU/Linux
+# - AT&T ksh on Debian Gnu/Linux (deb package ksh, version 93u-1)
+# OTOH, at least these shells that do *not* exhibit that behaviour:
+# - modern version of the Almquist Shell (at least 0.5.5.1), on
+# both Solaris and GNU/Linux
+# - Solaris 10 /bin/sh
+# - public domain Korn Shell, version 5.2.14, on Debian GNU/Linux
+trap "fatal_ 'caught signal SIGQUIT'" 3
+# Ignore further SIGPIPE in the trap code. This is required to avoid
+# a very weird issue with some shells, at least when the execution of
+# the automake testsuite is driven by the 'prove' utility: if prove
+# (or the make process that has spawned it) gets interrupted with
+# Ctrl-C, the shell might go in a loop, continually getting a SIGPIPE,
+# sometimes finally dumping core, other times hanging indefinitely.
+# See also Test::Harness bug [rt.cpan.org #70855], archived at
+# <https://rt.cpan.org/Ticket/Display.html?id=70855>
+trap "trap '' 13; fatal_ 'caught signal SIGPIPE'" 13
+
+# Create and populate the temporary directory, if and as required.
+if test x"$am_create_testdir" = x"no"; then
+ testSubDir=
+else
+ # The subdirectory where the current test script will run and write its
+ # temporary/data files. This will be created shortly, and will be removed
+ # by the cleanup trap below if the test passes. If the test doesn't pass,
+ # this directory will be kept, to facilitate debugging.
+ testSubDir=t/$me.dir
+ test ! -d $testSubDir || rm_rf_ $testSubDir \
+ || framework_failure_ "removing old test subdirectory"
+ test -d t || mkdir t
+ mkdir $testSubDir \
+ || framework_failure_ "creating test subdirectory"
+ # The trailing './'ris to avoid CDPATH issues.
+ cd ./$testSubDir \
+ || framework_failure_ "cannot chdir into test subdirectory"
+ if test x"$am_create_testdir" != x"empty"; then
+ cp "$am_scriptdir"/install-sh "$am_scriptdir"/missing \
+ "$am_scriptdir"/depcomp . \
+ || framework_failure_ "fetching common files from $am_scriptdir"
+ # Build appropriate environment in test directory. E.g., create
+ # configure.ac, touch all necessary files, etc. Don't use AC_OUTPUT,
+ # but AC_CONFIG_FILES so that appending still produces a valid
+ # configure.ac. But then, tests running config.status really need
+ # to append AC_OUTPUT.
+ {
+ echo "AC_INIT([$me], [1.0])"
+ if test x"$am_serial_tests" = x"yes"; then
+ echo "AM_INIT_AUTOMAKE([serial-tests])"
+ else
+ echo "AM_INIT_AUTOMAKE"
+ fi
+ echo "AC_CONFIG_FILES([Makefile])"
+ } >configure.ac || framework_failure_ "creating configure.ac skeleton"
+ fi
+fi
+
+
+## ---------------- ##
+## Ready to go... ##
+## ---------------- ##
+
+set -x
+pwd
mv -f t lib/bar.h
$MAKE
./src/zardoz
- test "`./src/zardoz`" = 'Foo, Zap!'
+ test "$(./src/zardoz)" = 'Foo, Zap!'
fi
$MAKE clean
$ACLOCAL
AUTOMAKE_fails
-test 2 -eq `grep -c 'dist.*forbidden' stderr`
+test 2 -eq $(grep -c 'dist.*forbidden' stderr)
Exit 0
chmod +x Mycomp
# Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/Mycomp
+CC=$(pwd)/Mycomp
export CC
$ACLOCAL
chmod +x Mycomp
+# Make sure the compiler doesn't understand '-c -o'
+CC=$(pwd)/Mycomp
+export CC
+
$ACLOCAL
$AUTOCONF
$AUTOMAKE --copy --add-missing
mkdir build
cd build
-# Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/../Mycomp
-export CC
-
../configure
$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
test -f hammer.sum
test -f spanner.log
test -f spanner.sum
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
test -f test-suite.log
test -f a.log
test -f b.log
- else :; fi
+ fi
grep 'check-local succeeded :-)' local.log
cp -f config.status config-status.sav
grep 'FAIL:' spanner.sum && Exit 1
B_EXIT_STATUS=1 $MAKE check && Exit 1
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
cat test-suite.log
cat a.log
grep '^b\.test: exit status: 1$' test-suite.log
grep '^a\.test' test-suite.log && Exit 1
: For shells with busted 'set -e'.
- else :; fi
+ fi
CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
grep 'check-local failed :-(' local.log
test -f spanner.sum
grep 'FAIL: test_hammer' hammer.sum
grep 'FAIL:' spanner.sum && Exit 1
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
cat test-suite.log
cat a.log
grep '^b\.test: exit status: 23$' test-suite.log
grep '^a\.test' test-suite.log && Exit 1
: For shells with busted 'set -e'.
- else :; fi
+ fi
grep 'check-local failed :-(' local.log
cd $srcdir
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
# Test Automake TESTS color output, by forcing it.
# Keep this in sync with the sister test 'color2.test'.
+required='grep-nonprint'
# For gen-testsuite-part: ==> try-with-serial-tests <==
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
- "$std") ;;
- *) skip_ "grep can't parse nonprinting characters";;
-esac
-
cat >>configure.ac <<END
AC_OUTPUT
END
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: .*pass"
cat stdout | grep "^${red}FAIL${std}: .*fail"
cat stdout | grep "^${blu}SKIP${std}: .*skip"
# not unduly colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
# Test Automake TESTS color output, using the expect(1) program.
# Keep this in sync with the sister test 'color.test'.
+required='grep-nonprint'
# For gen-testsuite-part: ==> try-with-serial-tests <==
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
- "$std") ;;
- *) skip_ "grep can't parse nonprinting characters";;
-esac
-
# This test requires a working a working 'expect' program.
# Creative quoting required to avoid spurious maintainer-check failure.
(set +e; expect -c 'exit ''77'; test $? -eq 77) \
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: .*pass"
cat stdout | grep "^${red}FAIL${std}: .*fail"
cat stdout | grep "^${blu}SKIP${std}: .*skip"
# not unduly colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
$ACLOCAL
$AUTOMAKE
-# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file
-test `sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' Makefile.in \
- | wc -l` -le 30
+# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file.
+test $(sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' \
+ Makefile.in | wc -l) -le 30
# UnIqUe_MUMBLE_COMMENT should appear right before the mumble declaration.
-test `sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' Makefile.in \
- | wc -l` -eq 2
+test $(sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' \
+ Makefile.in | wc -l) -eq 2
+
+:
$ACLOCAL
$AUTOMAKE
+$FGREP '@COND' Makefile.in # For debugging, mostly.
+
# The VAR definition appears once for each condition.
-test `grep '@COND_TRUE@VAR' Makefile.in | wc -l` = 1
-test `grep '@COND_FALSE@VAR' Makefile.in | wc -l` = 1
+test $(grep -c '@COND_TRUE@VAR' Makefile.in) = 1
+test $(grep -c '@COND_FALSE@VAR' Makefile.in) = 1
# Make sure the right definition follows each comment.
sed -n '/^#.*VAR.*COND_TRUE/ {
p
}' Makefile.in |
grep '@COND_FALSE@VAR = bar'
+
+:
# -l and -L options and their respective arguments. Traditionally,
# this should work also without a space. Try both usages.
for sp in '' ' '; do
+
# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
- opts=`LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk -I${sp}baz -Xlinker foobar -Wl,-foo,bar`
- test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+ opts=$(LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk \
+ -I${sp}baz -Xlinker foobar -Wl,-foo,bar)
+ test x"$opts" = \
+ x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
# Check if compile handles "-o foo.obj"
- opts=`./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ opts=$(./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
# Check if compile handles "-o foo.o"
- opts=`./compile ./cl -c foo.c -o foo.o -I${sp}baz`
+ opts=$(./compile ./cl -c foo.c -o foo.o -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
# Check if compile handles "foo.cc" as C++.
- opts=`./compile ./cl -c foo.cc -o foo.o -I${sp}baz`
+ opts=$(./compile ./cl -c foo.cc -o foo.o -I${sp}baz)
test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
# Check if compile clears the "eat" variable properly.
- opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ opts=$(eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
done
:
mkdir sub
cat >sub/foo.c <<'EOF'
-int
-foo ()
+int foo (void)
{
return 0;
}
EOF
cat >main.c <<'EOF'
-extern int foo ();
-int
-main ()
+extern int foo (void);
+int main (void)
{
return foo ();
}
EOF
-absfoodir=`pwd`/sub
-absmainc=`pwd`/main.c
-absmainobj=`pwd`/main.obj
+cwd=$(pwd) || fatal_ "cannot get current directory"
+absfoodir=$cwd/sub
+absmainc=$cwd/main.c
+absmainobj=$cwd/main.obj
cat >> configure.ac << 'END'
AC_PROG_CC
# this should work also without a space. Try both usages.
for sp in '' ' '; do
rm -f main
-
- ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" -o main -l${sp}foo
-
+ ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" \
+ -o main -l${sp}foo
./main
done
./configure
. ./check_host
-pwd=`pwd`
+cwd=$(pwd) || fatal_ "cannot get current directory"
# POSIX mandates that the compiler accepts a space between the -I,
# -l and -L options and their respective arguments. Traditionally,
for sp in '' ' '; do
# Check if "compile cl" transforms absolute file names to
# host format (e.g /somewhere -> c:/msys/1.0/somewhere).
-
- res=`./compile ./cl -L${sp}"$pwd" | sed -e 's/-link -LIBPATH://'`
-
+ res=$(./compile ./cl -L${sp}"$cwd" | sed -e 's/-link -LIBPATH://')
case $res in
- ?:[\\/]*)
- ;;
- *)
- Exit 1
- ;;
+ ?:[\\/]*) ;;
+ *) Exit 1 ;;
esac
done
# -l and -L options and their respective arguments. Traditionally,
# this should work also without a space. Try both usages.
for sp in '' ' '; do
+
rm -rf lib lib2 syslib "sys lib2"
mkdir syslib
- :> syslib/foo.lib
+ : > syslib/foo.lib
- syslib=`pwd`/syslib
+ syslib=$(pwd)/syslib
LIB=$syslib
export LIB
mkdir lib
- :> lib/bar.lib
- :> lib/bar.dll.lib
+ : > lib/bar.lib
+ : > lib/bar.dll.lib
# Check if compile library search correctly
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
# Check if -static makes compile avoid bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
- :> syslib/bar.lib
- :> syslib/bar.dll.lib
+ : > syslib/bar.lib
+ : > syslib/bar.dll.lib
# Check if compile finds bar.dll.lib in syslib
- opts=`./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
# Check if compile prefers -L over $LIB
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
mkdir lib2
- :> lib2/bar.dll.lib
+ : > lib2/bar.dll.lib
# Check if compile avoids bar.dll.lib in lib2 when -static
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
# Check if compile gets two different bar libraries when -static
# is added in the middle
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar)
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
# Check if compile gets the correct bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
# Check if compile gets the correct bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
mkdir "sys lib2"
- :> "sys lib2/foo.dll.lib"
+ : > "sys lib2/foo.dll.lib"
- syslib2="`pwd`/sys lib2"
+ syslib2="$(pwd)/sys lib2"
LIB="$syslib2;$LIB"
# Check if compile handles spaces in $LIB and that it prefers the order
# in a multi-component $LIB.
- opts=`./compile ./cl foo.c -o foo -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
# Check if compile handles the 2nd directory in a multi-component $LIB.
- opts=`./compile ./cl foo.c -o foo -static -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -static -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+
done
:
$AUTOMAKE
$FGREP helldl Makefile.in # For debugging.
-test `$FGREP -c 'helldl$(EXEEXT):' Makefile.in` -eq 2
+test $($FGREP -c 'helldl$(EXEEXT):' Makefile.in) -eq 2
:
$AUTOMAKE
$FGREP helldl Makefile.in # For debugging.
-num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
-num2=`$FGREP '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
+num1=$($FGREP -c 'helldl$(EXEEXT):' Makefile.in)
+num2=$($FGREP -c '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in)
test $num1 -eq 4
test $num2 -eq 1
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || fatal_ "cannot get current directory"
+cwd=$(pwd) || fatal_ "cannot get current directory"
mkdir nowhere
chmod a-w nowhere
$AUTOMAKE --add-missing
$FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 1
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 1
cat > tscan.l << 'END'
%{
# Still and all, it should generate two rules.
$FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 2
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 2
$FGREP '@CASE_A_TRUE@tparse.h:' Makefile.in
$FGREP '@CASE_A_FALSE@tparse.h:' Makefile.in
AUTOMAKE_fails
grep '^configure\.ac:7:.* not enough arguments.* _AM_COND_IF' stderr
grep '^configure\.ac:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
-test 2 = `grep -c 'not enough arguments' stderr`
+test 2 -eq $($FGREP -c 'not enough arguments' stderr)
:
$AUTOMAKE 2>stderr &
pid=$!
-# MSYS bash seems to have a bug in kill, so don't try to kill too soon;
-# and avoid maintainer-check test.
+# MSYS bash seems to have a bug in kill, so don't try to kill too soon.
+# The extra quoting avoids a maintainer-check failure.
sleep '2'
# Make at most 30 tries, one every 10 seconds (= 300 seconds = 5 min).
if kill -0 $pid; then
: process $pid is still alive, wait and retry
sleep '10'
- try=`expr $try + 1`
+ try=$(($try + 1))
else
cat stderr >&2
# Automake must fail with a proper error message.
$AUTOCONF
$AUTOMAKE Makefile
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE test
cp x.c y.c
-instdir=`pwd`/_inst || fatal_ "cannot get current directory"
+instdir=$(pwd)/_inst || fatal_ "cannot get current directory"
# Skip the rest of the test in case of e.g. missing C compiler.
./configure --prefix="$instdir" x=yes || Exit $?
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f inst/etc/mumble
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f inst/etc/mumble
mkdir build
cd build
-../configure FOO=true --prefix="`pwd`/_inst"
+../configure FOO=true --prefix="$(pwd)/_inst"
$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
touch foo.1 6.man
$MAKE install
$MAKE test1
cd ..
-./configure FOO=false --prefix="`pwd`/_inst"
+./configure FOO=false --prefix="$(pwd)/_inst"
$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
touch bar.2 baz.1 zap.5
$MAKE install
is_symlink auxdir/install-sh
test -f auxdir/depcomp
is_not_symlink auxdir/depcomp
-test FAKE-DEPCOMP = `cat auxdir/depcomp`
+test FAKE-DEPCOMP = "$(cat auxdir/depcomp)"
# 'automake -a -c' should not create symlinks, even when there are
# already symlinked required auxiliary files.
plan_ 18
-ocwd=`pwd` || fatal_ "getting top-level directory"
+ocwd=$(pwd) || fatal_ "getting top-level directory"
cat >> configure.ac << 'END'
AC_CONFIG_FILES([sub/Makefile])
cat site.exp
is_newest site.exp Makefile # Sanity check.
grep '|objdir|' site.exp
-test `grep -c '|objdir|' site.exp` -eq 1
+test $($FGREP -c '|objdir|' site.exp) -eq 1
# We can do a "more semantic" check if DejaGnu is available.
if runtest SOMEPROGRAM=someprogram --version; then
$AUTOMAKE -Wno-override
grep 'site\.exp' Makefile.in
-test `grep -c '^site\.exp:' Makefile.in` -eq 1
+test $(grep -c '^site\.exp:' Makefile.in) -eq 1
./configure
$MAKE site.exp
# Check that the DejaGnu rules work for a simple program and test case.
# Also check PR 488: Failure of the first of several tools tested.
# From the original bug report:
-# ``If you use dejagnu for testing and have multiple tools (i.e.,
+# If you use dejagnu for testing and have multiple tools (i.e.,
# multiple entries in the DEJATOOL variable) then the success/failure
# of "make check" is only dependent on the success/failure of the
# tests on the final tool. Thus there may be failures in the tests on
-# previous tools, but at first glance "make check" has passed.''
+# previous tools, but at first glance "make check" has passed.
required=runtest
. ./defs || Exit 1
$ACLOCAL
$AUTOMAKE
-test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
+
+:
fred_SOURCES = fred1.c $headers
END
$AUTOMAKE
- test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+ test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
done
:
. ./defs || Exit 1
mkdir acdir-more sub sub/acdir
-echo "`pwd`/acdir-more" > sub/acdir/dirlist
+echo "$(pwd)/acdir-more" > sub/acdir/dirlist
echo 'AC_DEFUN([AM_FOO], [foo-foo--foo])' > acdir-more/foo.m4
. ./defs || Exit 1
count=0
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Usage: do_check [--add-missing] [CONFIG-AUXDIR-PATH=.]
do_check ()
esac
auxdir=${1-.}
- count=`expr $count + 1`
+ count=$(($count + 1))
mkdir T$count.d
cd T$count.d
echo "*** Testing with auxdir '$auxdir' ***"
- i=`expr $i + 1`
+ i=$(($i + 1))
mkdir T$i.d
cd T$i.d
# Common and/or auxiliary subroutines and variables. #
# ---------------------------------------------------- #
-ocwd=`pwd` || fatal_ "obtaining current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
TAR='' && unset TAR
esac
}
+have_compressor ()
+{
+ test $# -eq 1 || fatal_ "have_compressor(): bad usage"
+ case $1 in
+ # Assume gzip(1) is available on every reasonable portability target.
+ gzip)
+ return 0;;
+ # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
+ # and is just a dummy script that is not able to actually compress
+ # (it can only decompress). So, check that the 'compress' program
+ # is actually able to compress input.
+ # Note that, at least on GNU/Linux, 'compress' does (and is
+ # documented to) exit with status 2 if the output is larger than
+ # the input after (attempted) compression; so we need to pass it
+ # an input that it can actually reduce in size when compressing.
+ compress)
+ for x in 1 2 3 4 5 6 7 8; do
+ echo aaaaaaaaaaaaaaaaaaaaa
+ done | compress -c >/dev/null && return 0
+ return 1
+ ;;
+ *)
+ # Redirect to stderr to avoid polluting the output, in case this
+ # function is used in a command substitution (as it is, below).
+ if $1 --version </dev/null >&2; then
+ return 0
+ else
+ return 1
+ fi
+ ;;
+ esac
+ fatal_ "have_compressor(): dead code reached"
+}
+
all_compression_formats='gzip tarZ lzip xz bzip2 zip shar'
-all_compressors=`
+all_compressors=$(
for x in $all_compression_formats; do
setup_vars_for_compression_format $x
echo $compressor
- done | tr "$nl" ' '`
+ done | tr "$nl" ' ')
echo All compressors: $all_compressors
-missing_compressors=`
+missing_compressors=$(
for c in $all_compressors; do
- case $c in
- # Assume gzip(1) is available on every reasonable portability target.
- gzip)
- continue
- ;;
- # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
- # and is just a dummy script that is not able to actually compress
- # (it can only decompress). So, check that the 'compress' program
- # is actually able to compress input.
- # Note that, at least on GNU/Linux, 'compress' does (and is
- # documented to) exit with status 2 if the output is larger than
- # the input after (attempted) compression; so we need to pass it
- # an input that it can actually reduce in size when compressing.
- compress)
- for x in 1 2 3 4 5 6 7 8; do
- echo aaaaaaaaaaaaaaa
- done | $c -c >/dev/null && continue
- : For shells with busted 'set -e'.
- ;;
- *)
- $c --version </dev/null >&2 && continue
- : For shells with busted 'set -e'.
- ;;
- esac
- echo $c
- done | tr "$nl" ' '`
+ have_compressor $c || echo $c
+ done | tr "$nl" ' ')
echo Missing compressors: $missing_compressors
+# Redefine to avoid re-running the already executed checks.
have_compressor ()
{
case " $missing_compressors " in *\ $1\ *) false;; *) : ;; esac
if test $# -gt 0; then
eval "$@" || fatal_ "start_subtest: evaluating assignments"
fi
- ac_opts=`echo $ac_opts | tr ',' ' '`
- am_opts=`echo $am_opts | tr ',' ' '`
+ ac_opts=$(echo $ac_opts | tr ',' ' ')
+ am_opts=$(echo $am_opts | tr ',' ' ')
mkdir "$name"
cd "$name"
unindent > configure.ac <<END
&& $MAKE dist-$format \
&& test -f $tarname-1.0.$suffix \
&& ls -l *$tarname* \
- && test "`ls *$tarname*`" = $tarname-1.0.$suffix'
+ && test "$(echo *$tarname*)" = $tarname-1.0.$suffix'
unset suffix compressor format tarname
}
command_ok_ "default [make distcheck]" $MAKE distcheck
command_ok_ "'make dist' only builds *.tar.gz by default" \
- test "`ls *defaults*`" = defaults-1.0.tar.gz
+ test "$(ls *defaults*)" = defaults-1.0.tar.gz
rm -rf *defaults*
cd ..
oPATH=$PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
command_ok_ \
"$desc ['make dist-all', stubbed]" \
$AUTOMAKE
# Use --srcdir with an absolute path because it's harder
# to support in 'distdir'.
-./configure --srcdir "`pwd`"
+./configure --srcdir "$(pwd)"
$MAKE test
+
+:
# A faulty distribution tarball, with a required '.am' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/zardoz.am # Sanity check.
# A faulty distribution tarball, with a required '.m4' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/zardoz.m4 # Sanity check.
# A faulty distribution tarball, with a required '.m4' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/m4/zardoz.m4 # Sanity check.
PYTHON = false
END
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Help to ensure cp won't see the same file twice.
mkdir bin
exec cp "\$@"
END
chmod a+x bin/cp
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH;
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH;
: > foo.c
: > bar.py
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
cp "$am_testauxdir"/distcheck-hook-m4.am . \
|| fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
cp "$am_testauxdir"/distcheck-hook-m4.am . \
|| fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
$MAKE
$MAKE distcheck
-infodir="`pwd`"/_info $MAKE -e distcheck
+infodir="$(pwd)/_info" $MAKE -e distcheck
test -f _info/dir || Exit 99 # Sanity check.
:
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
# Sanity checks.
$MAKE install
cat dc.txt # For debugging.
-test 1 = `grep tests dc.txt | wc -l`
+test 1 -eq $(grep -c tests dc.txt)
grep configure dc.txt
:
cat top.txt
cat inner.txt
-test 0 = `grep tests top.txt | wc -l`
-test 1 = `grep wrapper inner.txt | wc -l`
+test 0 -eq $(grep -c tests top.txt)
+test 1 -eq $(grep -c wrapper inner.txt)
:
grep 'MKDIR_P.*\.' stdout && Exit 1
cd ..
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
$MAKE distcheck
:
$MAKE distdir
ls -l $distdir $distdir/doc
cd $distdir
-test "`cat write`" = "all is ok"
+test "$(cat write)" = "all is ok"
test ! -f removed
test ! -r removed
test -f doc/README
./execute | grep 'I run successfully'
cd ..
-
$MAKE distcheck
test -f distcheck-run
ln -s bar1 bar2
ln -s bar2 bar3
-ln -s "`pwd`/foo" quux
+ln -s "$(pwd)/foo" quux
cat >> configure.ac << 'END'
AC_OUTPUT
ln -s nonesuch $lnk1 || skip_ "cannot create broken symlinks"
-ln -s "`pwd`/nonesuch" $lnk2
+ln -s "$(pwd)/nonesuch" $lnk2
ln -s $lnk1 $lnka
ln -s $lnka $lnkb
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f 'inst/my/hello$world'
$MAKE check-dist
+
+:
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
+
+:
grep '^maude3$(EXEEXT):' Makefile.in
grep '^mt$(EXEEXT):' Makefile.in
grep '^rmt$(EXEEXT):' Makefile.in
-test `grep '^bin_PROGRAMS =' Makefile.in | wc -l` = 1
+test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
# Make sure $(EXEEXT) gets stripped before canonicalization.
grep 'maude3__EXEEXT__OBJECTS' Makefile.in && Exit 1
grep '2BEG: maude.static.foo :END2' stdout
grep '3BEG: maude3.foo :END3' stdout
grep '4BEG: :END4' stdout
+
+:
$AUTOMAKE -Wno-override
$FGREP 'maude$(EXEEXT):' Makefile.in
-test 1 = `grep 'maude.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c 'maude.*:' Makefile.in)
$FGREP '3dldf$(EXEEXT):' Makefile.in
-test 1 = `grep '3dldf.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c '3dldf.*:' Makefile.in)
+
+:
# Only two am__EXEEXT_* variables are needed here: one for BAR, and one
# BAZ. The latter must use the former.
-test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
+test 2 -eq $(grep -c '__EXEEXT_. =' Makefile.in)
grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
:
$ACLOCAL
$AUTOMAKE
-for ext in f for f90 f95 F F90 F95 r m mm upc
-do
- # Some versions of the BSD shell wrongly exit when 'set -e' is active
- # if the last command within a compound statement fails and is guarded
- # by an && only. So we play safe and use the following idiom, instead
- # of the apparently simpler 'grep ... && Exit 1'.
- if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+for ext in f for f90 f95 F F90 F95 r m mm upc; do
grep "^\.$ext\.o:" Makefile.in
+ grep "^$ext\.o:" Makefile.in && Exit 1
+ : For shells with busted 'set -e'.
done
-Exit 0
+
+:
.PHONY: bar-has-been-updated
bar-has-been-updated:
- stat older bar$(EXEEXT) libfoo.a || : For debugging.
- test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
+ is_newest bar$(EXEEXT) libfoo.a
END
cat >libfoo.c <<'END'
: >bardep
$MAKE
-: > older
$sleep
touch libfoo.a
$MAKE
.PHONY: bar-has-been-updated
bar-has-been-updated:
- stat older bar$(EXEEXT) libfoo.la || : For debugging.
- test `ls -t bar$(EXEEXT) older | sed q` = bar$(EXEEXT)
+ is_newest bar$(EXEEXT) libfoo.la
END
cat >libfoo.c <<'END'
: >bardep
$MAKE
-: > older
$sleep
touch libfoo.la
$MAKE
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
-test 2 = `grep 12345678 stderr | wc -l`
+test 2 -eq $(grep -c 12345678 stderr)
:
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
-test 1 = `grep 12345678 stderr | wc -l`
+test 1 -eq $(grep -c 12345678 stderr)
:
# or if the compiler cannot compile Fortran 90 files).
./configure
$MAKE
-subobjs=`echo sub/*.o sub/*.obj`
+subobjs=$(echo sub/*.o sub/*.obj)
test "$subobjs" = 'sub/*.o sub/*.obj'
$MAKE distcheck
test ! -f goodbye-baz.o
test ! -f goodbye-baz.obj
$MAKE distcheck
+
+:
# or if the compiler cannot compile Fortran 90 files).
./configure
$MAKE
-subobjs=`echo sub/*.lo`
+subobjs=$(echo sub/*.lo)
test "$subobjs" = 'sub/*.lo'
$MAKE distcheck
test ! -f baz.lo
test ! -f libgoodbye_la-baz.lo
$MAKE distcheck
+
+:
$ACLOCAL
$AUTOMAKE
-num=`grep depcomp Makefile.in | wc -l`
-test $num -gt 1
+test $($FGREP -c depcomp Makefile.in) -gt 1
:
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure >stdout
+./configure >stdout || { cat stdout; Exit 1; }
cat stdout
# Configure must be checking the dependency style of gcj ...
cat filt
# ... only once.
-test `wc -l < filt` = 1
+test $(wc -l < filt) = 1
# Accept any outcome but 'none'
# (at the time of writing it should be gcc or gcc3).
# in the AM_GNU_GETTEXT_VERSION call in configure.ac if we want autopoint
# (or gettextize) to setup the correct infrastructure -- in particular,
# for what concerns us, to bring in all the required .m4 files.
-autopoint_version=`extract_program_version $am_gettextize_command` \
+autopoint_version=$(extract_program_version $am_gettextize_command) \
&& test -n "$autopoint_version" \
|| autopoint_version=0.10.35
AM_GNU_GETTEXT_VERSION([$autopoint_version])
END
-if $am_gettextize_command --force && test -f m4/gettext.m4; then :; else
+if ! ($am_gettextize_command --force && test -f m4/gettext.m4); then
# Older versions of gettext might not have a gettextize program
# available, but this doesn't mean the user hasn't made the gettext
# macros available, e.g., by properly setting ACLOCAL_PATH.
fi
fi
-echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
echo "export ACLOCAL_PATH" >> get.sh
# Even recent versions of gettext used the now-obsolete 'AM_PROG_MKDIR_P'
# Remove any Makefile.in possibly created by gettextize/autopoint, to
# avoid spurious maintainer-check failures.
-rm -f `find . -name Makefile.in`
+rm -f $(find . -name Makefile.in)
# The file gettextize or autopoint might have copied in the 'm4'
# subdirectory of the test directory are going to be needed by
cd build
# Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
$MAKE all
$MAKE test-install
$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
cd build
# Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
$MAKE
$MAKE install
$MAKE installcheck && Exit 1
$ACLOCAL
$AUTOMAKE
-len=`grep '^srcdir' Makefile.in | wc -l`
-test $len -eq 1
+test $(grep -c '^srcdir' Makefile.in) -eq 1
# Also make sure include file is distributed.
sed -n -e '/^DIST_COMMON =.*\\$/ {
cp configure.ac configure.tmpl
-q="[\`'\"]"
-
for args in '' 'yes' 'no'; do
cp -f configure.tmpl configure.ac
test x"$args" = x || echo "AM_SILENT_RULES([$args])/" >> configure.ac
cat configure.ac # For debugging.
$AUTOCONF --force
grep_configure_help --enable-silent-rules \
- " less verbose build.*\\(undo.*${q}make V=1${q}"
+ ' less verbose build.*\(undo.*"make V=1".*\)'
grep_configure_help --disable-silent-rules \
- " verbose build.*\\(undo.*${q}make V=0${q}"
+ ' verbose build.*\(undo.*"make V=0".*\)'
done
:
AUTOMAKE=$am_original_AUTOMAKE
escape_dots () { sed 's/\./\\./g'; } # Avoid issues with "\" in backquotes.
-apiversion_rx=`echo "$APIVERSION" | escape_dots`
+apiversion_rx=$(echo "$APIVERSION" | escape_dots)
$ACLOCAL --version --help >stdout || { cat stdout; Exit 1; }
cat stdout
$ACLOCAL
$AUTOMAKE
-for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
+for i in $(grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'); do
echo $i
case "$i" in
foo*)
required=makeinfo
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir bin
saved_PATH=$PATH; export saved_PATH
$ACLOCAL
$AUTOMAKE
-test `grep installdirs-local Makefile.in | wc -l` -eq 4
+test $(grep -c installdirs-local Makefile.in) -eq 4
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
$AUTOCONF
./configure --prefix="$cwd/inst"
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE install
test ! -d inst/share/instdir-cond
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE installdirs
test ! -d inst || { find inst; Exit 1; }
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir" PYTHON="echo" \
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
doinst ()
{
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir" PYTHON="echo" \
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
# If $(infodir) is the empty string, then nothing should be installed there.
# Likewise for the other install-* targets used for texinfo files.
-required='makeinfo-html tex texi2dvi'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
dvips --help \
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$MAKE install-exec && Exit 1
$MAKE readable-progn
-if grep "^EMACS = no" Makefile; then :; else
- for file in lisp1.el lisp1.elc
- do
+if ! grep "^EMACS = no" Makefile; then
+ for file in lisp1.el lisp1.elc; do
chmod a-r $file
$MAKE install-data && Exit 1
chmod u+r $file
# second version will overwrite 'foo'. Hopefully 'install' and 'install-sh'
# are smart enough to erase the 'foo' symlink before installing the new
# version.)
-./configure "--bindir=`pwd`/bin"
+./configure "--bindir=$(pwd)/bin"
$MAKE install
echo 2 > foo
VERSION=2.0 $MAKE -e install
$ACLOCAL
$AUTOMAKE
-grep '[^(/]MKDIR_P' Makefile.in > out
-test `wc -l < out` -eq 1
+grep 'MKDIR_P' Makefile.in # For debugging.
+test $(grep -c '[^(/]MKDIR_P' Makefile.in) -eq 1
+
+:
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
esac
done
# We need to determine the TAP plan adaptively.
- n=`for t in $test_names_list; do echo $t; done | wc -l`
- plan_ `expr $n '*' 2` # Two tests per "problematic string".
+ n=$(for t in $test_names_list; do echo $t; done | wc -l)
+ plan_ $(($n * 2)) # Two tests per "problematic string".
unset n
else
test_names_list=$all_test_names_list
plan_ 94
fi
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
create_input_data
# the test directory not to be removed when the script terminates.
if not am_keeping_testdirs && test "$r" = ok; then
rm_rf_ "$build" "$dest" || fatal_ "removing temporary subdirectory"
- else
- : For lesser shells with broken 'set -e'.
fi
+ : For shells with busted 'set -e'.
+
done # $instspc_action
done # $test_name
$AUTOCONF
$AUTOMAKE
-inst=`pwd`/_inst
+inst=$(pwd)/_inst
./configure --prefix="$inst"
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
$MAKE
$MAKE test
$MAKE install
# To have the parallel testsuite more verbose.
VERBOSE=yes; export VERBOSE
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
cat PkgLocation.java # For debugging.
$MAKE check
$MAKE install
# To have the parallel testsuite more verbose.
VERBOSE=yes; export VERBOSE
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
cat jprog/PkgLocation.java # For debugging.
$MAKE check
$MAKE install
for var in JAVAC JAVAROOT CLASSPATH_ENV am__java_sources; do
grep "^$var =" Makefile.in
- test `grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in` = 1
+ test $(grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in) -eq 1
done
grep '^classjava\.stamp:' Makefile.in
-test `grep -c "class.*java.*\.stamp.*:" Makefile.in` = 1
+test $(grep -c "class.*java.*\.stamp.*:" Makefile.in) -eq 1
:
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
$MAKE check
$MAKE install
$MAKE test-install
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
ls -l
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
javadir=_inst/java
check_uninstallation()
$EGREP '\.stamp|class' Makefile.in # For debugging.
grep '^all[-a-z]*:.*classjava\.stamp' Makefile.in
-test `grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in` -eq 1
+test $(grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in) -eq 1
-cat >a.java <<EOF
-class a
-{
-}
-EOF
-
-cat >b.java <<EOF
-class b
-{
-}
-EOF
+echo 'class a { }' > a.java
+echo 'class b { }' > b.java
-./configure --prefix "`pwd`"
+./configure
$MAKE distcheck
+
+:
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
-./configure --prefix="$cwd/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
$MAKE install
ls -l .
.PHONY: test-obj-updated
test-obj-updated: joe.$(OBJEXT) moe.$(OBJEXT)
- stat older my-hdr.hxx joe.$(OBJEXT) moe.$(OBJEXT) || :
- test `ls -t older joe.$(OBJEXT) | sed 1q` = joe.$(OBJEXT)
- test `ls -t older moe.$(OBJEXT) | sed 1q` = moe.$(OBJEXT)
+ is_newest joe.$(OBJEXT) my-hdr.hxx
+ is_newest moe.$(OBJEXT) my-hdr.hxx
END
cat > joe.ll << 'END'
$MAKE test-deps-exist
$MAKE
-: > older
$sleep
touch my-hdr.hxx
$MAKE test-obj-updated
.PHONY: test-obj-updated
test-obj-updated: joe.$(OBJEXT)
- stat older my-hdr.h joe.$(OBJEXT) || : For debugging.
- test `ls -t older joe.$(OBJEXT) | sed 1q` = joe.$(OBJEXT)
+ is_newest joe.$(OBJEXT) my-hdr.h
END
cat > joe.l << 'END'
$MAKE test-deps-exist
$MAKE
+cross_compiling || test "$(./zoo)" = 'Hello, World!' || Exit 1
-: > older
$sleep
-touch my-hdr.h
+cat >> my-hdr.h << 'END'
+#undef MESSAGE
+#define MESSAGE "Howdy, Earth!"
+END
$MAKE test-obj-updated
+$MAKE
+cross_compiling || test "$(./zoo)" = 'Howdy, Earth!' || Exit 1
:
# Program should build and run and distribute.
$MAKE all
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./lexer
echo BAD | ./lexer && Exit 1
: For shells with busted 'set -e'.
# Program should build and run.
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./foo
echo BAD | ./foo && Exit 1
: For shells with busted 'set -e'.
touch lexer.l lexer2.l
$sleep
$MAKE lexer.c lexer2.c
-stat lexer.c lexer.l lexer2.c lexer2.l || : # For debugging.
-test `ls -t lexer.c lexer.l | sed 1q` = lexer.c
-test `ls -t lexer2.c lexer2.l | sed 1q` = lexer2.c
+is_newest lexer.c lexer.l
+is_newest lexer2.c lexer2.l
:
# Program should build and run.
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./foo
echo BAD | ./foo && Exit 1
: For shells with busted 'set -e'.
AUTOMAKE_fails
grep '^Makefile.am:.*: !A and !C and !D$' stderr
# Is there only one missing condition?
-test `grep ': !' stderr | wc -l` = 1 || Exit 1
+test $(grep -c ': !' stderr) -eq 1
+
+:
echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
if libtoolize --copy --install && test -f m4/libtool.m4; then
- echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+ echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
echo "export ACLOCAL_PATH" >> get.sh
else
# Libtoolize from libtool < 2.0 didn't support the '--install' option,
$ACLOCAL
$AUTOMAKE --add-missing
# am_liba_la_rpath is defined twice, and used once
-test 3 = `grep 'am_liba_la_rpath' Makefile.in | wc -l`
+test 3 -eq $(grep -c 'am_liba_la_rpath' Makefile.in)
+
+:
$AUTOCONF
$AUTOMAKE --add-missing --copy
-./configure "--prefix=`pwd`/_inst"
+./configure "--prefix=$(pwd)/_inst"
env LIBTOOLFLAGS=--silent $MAKE print >output 2>&1 || {
cat output
Exit 1
grep '1BEG: libmod1.la mod2.la :END1' output
grep '2BEG: mod2.la :END2' output
grep '3BEG: .*silent.*silent.* :END3' output
-test 2 -le `grep mod2_la_LIBTOOLFLAGS Makefile | wc -l`
+test 2 -le $(grep mod2_la_LIBTOOLFLAGS Makefile | wc -l)
$MAKE
env LIBTOOLFLAGS=--silent $MAKE install >output 2>&1 || {
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
# Fake the absence of emacs.
# *.el files should not be installed, but "make install" and
# "make uninstall" should continue to work.
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
# Fake the absence of emacs.
# *.el files SHOULD be installed by "make install" (and uninstalled
# by "make uninstall").
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
AC_OUTPUT
EOF
+# Avoid possible spurious influences from the environment.
+want_two=; unset want_two
+
echo "(provide 'am-one)" > am-one.el
echo "(require 'am-one)" > am-two.el
echo "(require 'am-one)" > am-three.el
$AUTOCONF
$AUTOMAKE --add-missing
-./configure "--with-lispdir=`pwd`/lisp"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --with-lispdir="$cwd/lisp"
$MAKE
test -f am-one.elc
test ! -f am-three.elc
test ! -f elc-stamp
-./configure "--with-lispdir=`pwd`/lisp" want_two=1
+./configure --with-lispdir="$cwd/lisp" want_two=1
$MAKE
test -f am-one.elc
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test ! -f am-one.elc
test ! -f am-two.elc
$MAKE -j >>stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test -f am-one.elc
test -f am-two.elc
$MAKE -j >>stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test -f am-one.elc
test -f am-two.elc
test -f am-three.elc
t/self-check-me.tap \
t/self-check-reexec.tap \
t/self-check-report.sh \
-t/self-check-sanity.sh \
t/self-check-seq.tap \
t/self-check-is-blocked-signal.tap \
t/self-check-tap.sh \
. ./defs || Exit 1
-n=1
-files=
-match=
+n=1 files= match=
while test $n -le 100
do
files="$files filename$n"
match="..........$match"
- n=`expr $n + 1`
+ n=$(($n + 1))
done
-files2=`echo "$files" | sed s/filename/filenameb/g`
+files2=$(echo "$files" | sed s/filename/filenameb/g)
cat >Makefile.am <<EOF
FOO = $files $files2 \
grep $match Makefile.in && Exit 1
grep 'filenameb100 grepme' Makefile.in
+
+:
$ACLOCAL
$AUTOMAKE
-test 80 -ge `grep DUMMY Makefile.in | wc -c`
+test 80 -ge $(grep DUMMY Makefile.in | wc -c)
+
+:
$AUTOCONF
$AUTOMAKE --add-missing
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Install libraries in lib/, and the rest in empty/.
# (in fact there is no "rest", so as the name imply empty/ is
# expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib"
$MAKE
test -f lib1foo.la
test -f lib/lib2foo.la
test ! -f lib/lib3foo.la
find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
$MAKE uninstall
find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
+test -s lib.lst && { cat lib.lst; Exit 1; }
test -f lib1foo.la
test -f lib1bar.la
test -f lib2foo.la
$AUTOCONF
$AUTOMAKE --add-missing
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Install libraries in lib/, programs in bin/, and the rest in empty/.
# (in fact there is no "rest", so as the name imply empty/ is
# expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib" "--bindir=`pwd`/bin"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib" --bindir="$cwd/bin"
$MAKE
test -f libtop.la
rm -f installcheck-ok
find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
$MAKE clean
test ! -f libtop.la
rm -f installcheck-ok
$MAKE uninstall
-find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
-find bin -type f -print > bin.lst
-test 0 = `wc -l < bin.lst`
+for d in lib bin; do
+ find $d -type f -print > $d.lst
+ test -s $d.lst && { cat $d.lst; Exit 1; }
+ : For shells with busted 'set -e'.
+done
:
$EGREP 'LT_(INIT|PREREQ)' configure && Exit 1 # Sanity check.
$AUTOMAKE -a
-cwd=`pwd`
-./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
+./configure --prefix="$(pwd)/inst" >stdout || { cat stdout; Exit 1; }
cat stdout
grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout
$AUTOCONF
$AUTOMAKE --add-missing
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE
$MAKE install 2>stderr || { cat stderr >&2; Exit 1; }
grep 'has not been installed' stderr && Exit 1
$MAKE uninstall
-test `find inst -type f -print | wc -l` -eq 0
+test $(find inst -type f -print | wc -l) -eq 0
:
./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; }
cat stdout
grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
- test `grep -c 'checking.*maint' stdout` -eq 1
- :
+ test $(grep -c 'checking.*maint' stdout) -eq 1
}
set_maintmode "DEFAULT"
check_no_dryrun ()
{
command_ok_ "dry-run ($cnt)" $MAKE notdry ${1+"$@"}
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
fi
result_ "$r" -D "$directive" -r "$reason" "not dry-run ($cnt)"
unset r directive reason
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
fi
result_ "$r" "dry-run, with shell metachars ($cnt)"
unset r
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
mkdir build
cd build
-../configure "--prefix=`pwd`/inst"
+../configure --prefix="$(pwd)/inst"
$MAKE -j2 || skip_ "$MAKE failed to run with two parallel jobs"
$MAKE -j2 distcheck
$MAKE test-distdir-removed
-Exit 0
+:
$AUTOMAKE
./configure
-$sleep
echo stamp > stampfile
$sleep
for target in dist distcheck; do
$MAKE -n $target | grep stamp-sub-dist-hook || Exit 1
fi
$MAKE test-no-distdir
- test `ls -1t | sed 1q` = stampfile
+ # No file has been actually touched or created.
+ is_newest stampfile $(find .)
done
-Exit 0
+:
$AUTOCONF
$AUTOMAKE
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Let's play with $DESTDIR too, it shouldn't hurt.
./configure --prefix='' --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
test -f ./_inst/man/man2/foo.2
test -f ./_inst/man/man4/foo.4
test -f ./_inst/man/man4/bar.4
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
test ! -f ./_inst/man/man2/foo.2
test ! -f ./_inst/man/man4/foo.4
$AUTOCONF
$AUTOMAKE
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Let's play with $DESTDIR too, it shouldn't hurt.
./configure --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
-test -f ./_inst/man/man2/foo.2
-test -f ./_inst/man/man2/nfoo.2
-test -f ./_inst/man/man2/baz-1.4.2
-test -f ./_inst/man/man2/nbaz-1.4.2
-test -f ./_inst/man/man3/bar.3
-test -f ./_inst/man/man3/nbar.3
+test -f _inst/man/man2/foo.2
+test -f _inst/man/man2/nfoo.2
+test -f _inst/man/man2/baz-1.4.2
+test -f _inst/man/man2/nbaz-1.4.2
+test -f _inst/man/man3/bar.3
+test -f _inst/man/man3/nbar.3
-test ! -d ./_inst/man/man1
-test ! -d ./_inst/man/man4
-test ! -d ./_inst/man/man5
+test ! -d _inst/man/man1
+test ! -d _inst/man/man4
+test ! -d _inst/man/man5
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
-test ! -f ./_inst/man/man2/foo.2
-test ! -f ./_inst/man/man2/nfoo.2
-test ! -f ./_inst/man/man2/baz-1.4.2
-test ! -f ./_inst/man/man2/nbaz-1.4.2
-test ! -f ./_inst/man/man3/bar.3
-test ! -f ./_inst/man/man3/nbar.3
+test ! -f _inst/man/man2/foo.2
+test ! -f _inst/man/man2/nfoo.2
+test ! -f _inst/man/man2/baz-1.4.2
+test ! -f _inst/man/man2/nbaz-1.4.2
+test ! -f _inst/man/man3/bar.3
+test ! -f _inst/man/man3/nbar.3
:
get_shell_script mdate-sh
-set x `./mdate-sh mdate-sh`
+set x $(./mdate-sh mdate-sh)
shift
echo "$*" # For debugging.
esac
# Stricter checks on the year required a POSIX date(1) command.
-if year=`date +%Y` && test $year -gt 2010; then
+if year=$(date +%Y) && test $year -gt 2010; then
test $year = $3 || Exit 1
fi
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/sub"
+./configure --prefix "$(pwd)/sub"
$MAKE installdirs
test ! -d sub/man
+$MAKE install
+test ! -d sub/man
+
+:
am_create_testdir=empty
. ./defs || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Make sure the directory we will create can be created...
mkdir '~a b' && mkdir '~a b/-x y' \
|| skip_ "directory names with spaces and metacharacters not accepted"
EOF
chmod +x bin/mkdir
-AM_PATH=$PATH
-export AM_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
-export PATH
+
+AM_PATH=$PATH; export AM_PATH
+PATH=$cwd/bin$PATH_SEPARATOR$PATH; export PATH
# Test mkinstalldirs without mkdir -p.
test -d '~a b/-x y'
rm -rf '~a b'
-./mkinstalldirs "`pwd`///~a b//-x y"
-test -d "`pwd`/~a b/-x y"
+./mkinstalldirs "$cwd///~a b//-x y"
+test -d "$cwd/~a b/-x y"
rm -rf '~a b'
+
+:
echo "$@" >lex.yy.c
END
chmod +x myyacc.sh mylex.sh
-PATH="`pwd`$PATH_SEPARATOR$PATH"
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
# "make maintainer-clean; ./configure; make" should always work,
# per GNU Standard.
./configure
YACC="myyacc.sh" LEX="mylex.sh" \
LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
-grep zardoz.y zardoz.c
-grep joe.l joe.c
+$FGREP zardoz.y zardoz.c
+$FGREP joe.l joe.c
+
+:
cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
cp "$mldir"/multi.m4 m4
-ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}`pwd`/m4
+ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
export ACLOCAL_PATH
cat >configure.ac <<'END'
END
chmod +x mycc
-PATH=`pwd`$PATH_SEPARATOR$PATH
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
cat >Makefile.am <<'EOF'
SUBDIRS = @subdirs@
mkdir sub
cat >source.c <<'EOF'
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
return 0;
}
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
$MAKE install-strip
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
:
mkdir sub
-for file in one.py sub/base.py two.py sub/nobase.py
-do
+for file in one.py sub/base.py two.py sub/nobase.py; do
echo 'def one(): return 1' >$file
done
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE uninstall
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
$MAKE install-strip
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
:
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure --prefix "`pwd`/install"
+./configure --prefix "$(pwd)/install"
$MAKE install-data
:
test -f inst/man/man2/z-bar2.2
test -f inst/man/man1/z-baz.1
test -f inst/man/man1/z-baz2.1
- if test -d inst/man/man8; then (exit 1); else :; fi
- if test -d inst/man/man9; then (exit 1); else :; fi
+ test ! -d inst/man/man8
+ test ! -d inst/man/man9
EOF
: > foo.1
grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
+grep '^install-man8:' Makefile.in && Exit 1
+grep '^install-man9:' Makefile.in && Exit 1
-if grep '^install-man8:' Makefile.in; then Exit 1; else :; fi
-if grep '^install-man9:' Makefile.in; then Exit 1; else :; fi
+cwd=$(pwd) || fatal_ "getting current working directory"
-./configure --program-prefix=gnu- --prefix "`pwd`"/inst --mandir "`pwd`"/inst/man
+./configure --program-prefix=gnu- --prefix "$cwd"/inst \
+ --mandir "$cwd"/inst/man
$MAKE
$MAKE test-install
-test `find inst/man -type f -print | wc -l` = 24
+test $(find inst/man -type f -print | wc -l) -eq 24
$MAKE uninstall
-test `find inst/man -type f -print | wc -l` = 0
+test $(find inst/man -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
test -d inst/man/man5
test -d inst/man/man6
test -d inst/man/man7
-if test -d inst/man/man8; then Exit 1; else :; fi
-if test -d inst/man/man9; then Exit 1; else :; fi
+test -d inst/man/man8 && Exit 1
+test -d inst/man/man9 && Exit 1
+
+:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure _OBJECTS only generated once. Bug reported by
+# Test to make sure _OBJECTS is only generated once. Bug reported by
# Joerg-Martin Schwarz.
. ./defs || Exit 1
$AUTOMAKE
grep '^zardoz_OBJECTS' Makefile.in
-count=`grep -c '^zardoz_OBJECTS' Makefile.in`
-test $count -eq 1
+test $(grep -c '^zardoz_OBJECTS' Makefile.in) -eq 1
:
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent > exp << 'END'
[Hello C, world C]
[Hello C++, world C++]
$MAKE all
cat foo
cat zardoz
-test "`cat foo`" = "Linked foo from foo.fasl"
-test "`cat zardoz`" = "Linked zardoz from mu1.fasl mu2.fasl"
+test "$(cat foo)" = "Linked foo from foo.fasl"
+test "$(cat zardoz)" = "Linked zardoz from mu1.fasl mu2.fasl"
:
$ACLOCAL
AUTOMAKE_fails
-test `grep -c anachronism stderr` -eq 8
+test $(grep -c anachronism stderr) -eq 8
+
+:
./configure
$MAKE
-test "`cat a/foo.sh`" = foo
+test "$(cat a/foo.sh)" = foo
$sleep
echo 'bar' >a/foo.sh.in
cd a
$MAKE foo.sh
-test "`cat foo.sh`" = bar
+test "$(cat foo.sh)" = bar
+
+:
$AUTOMAKE -Wno-override
# "ps:" should be output in two conditions
-test `grep '[^-]ps:' Makefile.in | wc -l` = 2
+test $(grep -c '[^-]ps:' Makefile.in) -eq 2
grep '@COND_TRUE@ps: *foobar' Makefile.in
grep '@COND_FALSE@ps: *ps-am' Makefile.in
$AUTOMAKE -Wno-override
# Overriding 'html' should cause only one "html:" rule to be output.
-test `grep '^html:' Makefile.in | wc -l` = 1
+test $(grep -c '^html:' Makefile.in) -eq 1
:
unset AUTOMAKE_JOBS || :
AUTOMAKE_run --add-missing
mv stderr expected
-Makefile_ins=`find . -name Makefile.in`
+Makefile_ins=$(find . -name Makefile.in)
for file in $Makefile_ins; do
mv $file $file.exp
done
# $failure_statuses should be defined to the list of all integers between
# 1 and 255 (inclusive), excluded 77 and 99.
-failure_statuses=`seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' '`
+failure_statuses=$(seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' ')
# For debugging.
echo "failure_statuses: $failure_statuses"
# Sanity check.
-test `for st in $failure_statuses; do echo $st; done | wc -l` -eq 253 \
+test $(for st in $failure_statuses; do echo $st; done | wc -l) -eq 253 \
|| fatal_ "initializing list of exit statuses for simple failures"
cat > Makefile.am <<END
-LOG_COMPILER = ./do-exit
+LOG_COMPILER = $AM_TEST_RUNNER_SHELL ./do-exit
fail_tests = $failure_statuses
TESTS = 0 77 99 $failure_statuses
\$(TESTS):
echo "$0: $1"
case $1 in
[0-9]|[0-9][0-9]|[0-9][0-9][0-9]) st=$1;;
- */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=`echo x"$1" | sed 's|.*/||'`;;
+ */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=${1##*/};;
*) st=99;;
esac
exit $st
cat > Makefile.am << 'END'
TESTS = foo.test
## Provide more debugging info.
-TEST_LOG_COMPILER = $(SHELL) -x
+TEST_LOG_COMPILER = $(SHELL) -ex
## Required by foo.test; see below.
AM_TESTS_FD_REDIRECT = 9>&1
END
sed 's/--chk/--am-test/' chk-compiler > test-compiler
mkdir bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
cat > bin/t-compiler <<'END'
#! /bin/sh
for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
test $count = E_HUGE && break
- count=`expr $count '*' 100` || Exit 99
+ count=$(($count * 100))
setup_data
if $MAKE this-will-fail; then
continue
# hit the system command-line limits; we can stop. But first, for
# good measure, increase the number of tests of some 20%, to be
# "even more sure" of really tickling command line length limits.
- count=`expr '(' $count '*' 12 ')' / 10` || Exit 99
+ count=$(($count * 12))
+ count=$(($count / 10))
setup_data
break
fi
sed 20q lst # For debugging.
sed 20q grp # Likewise.
-test `cat <grp | wc -l` -eq $count
-test `cat <lst | wc -l` -eq $count
+test $(cat <grp | wc -l) -eq $count
+test $(cat <lst | wc -l) -eq $count
# We need to simulate a failure of two tests.
st=0
env TESTS="$deepdir/$tname-1.test $deepdir/$tname-2.test" \
TEST_LOG_COMPILER=false $MAKE -e check > stdout && st=1
cat stdout
-test `grep -c '^FAIL:' stdout` -eq 2 || st=1
+test $(grep -c '^FAIL:' stdout) -eq 2 || st=1
test $st -eq 0 || fatal_ "couldn't simulate failure of two tests"
unset st
cat stdout
grep "^PASS: .*$tname-1\.test" stdout
grep "^PASS: .*$tname-2\.test" stdout
-test `LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout` -eq 2
+test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 2
grep "^# TOTAL: 2$" stdout
grep "^# PASS: 2$" stdout
# Colorized output from the testsuite report shouldn't end up in log files.
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e'
-
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$esc" | $FGREP "$esc"` in
- "$esc") ;;
-# Creative quoting below to please maintainer-check.
- *) echo "$me: f""grep can't parse nonprinting characters" >&2; Exit 77;;
-esac
-
TERM=ansi; export TERM
cat >>configure.ac <<END
./configure
mv config.log config-log # Avoid possible false positives below.
AM_COLOR_TESTS=always $MAKE -e check && Exit 1
-$FGREP "$esc" *.log && Exit 1
+# Not a useless use of cat; see above comments "grep-nonprinting"
+# requirement in 'test-init.sh'.
+cat *.log | grep "$esc" && Exit 1
:
# Check that the testsuite harness correctly handle overrides of the
# TERM variable by either TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT.
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e['
-
TERM=ansi; export TERM
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$esc" | $FGREP "$esc"` in
- "$esc") ;;
- *) skip_ "$FGREP can't parse nonprinting characters" ;;
-esac
-
cat >> configure.ac << 'END'
AC_OUTPUT
END
./configure
mkcheck TESTS_ENVIRONMENT='TERM=dumb'
-cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
+cat stdout | grep "PASS.*foobar" | grep "$esc\\["
mkcheck AM_TESTS_ENVIRONMENT='TERM=dumb'
-cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
+cat stdout | grep "PASS.*foobar" | grep "$esc\\["
:
cat my-shell
-CONFIG_SHELL=`pwd`/my-shell; export CONFIG_SHELL
+CONFIG_SHELL=$(pwd)/my-shell; export CONFIG_SHELL
$ACLOCAL
$AUTOCONF
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
test -f test-suite.log
cat test-suite.log
-test `grep -c '^FAIL:' test-suite.log` -eq 1
-test `grep -c '^ERROR:' test-suite.log` -eq 1
+test $(grep -c '^FAIL:' test-suite.log) -eq 1
+test $(grep -c '^ERROR:' test-suite.log) -eq 1
$EGREP '^(X?PASS|XFAIL|SKIP)' test-suite.log && Exit 1
test -f baz.log
test -f bar.log
while :; do
for r2h in $RST2HTML rst2html rst2html.py; do
echo "$me: running $r2h --version"
- # Don't use "&&" here, or a bug of 'set -e' present in some
- # versions of the BSD shell will be triggered. We add the
- # dummy "else" branch for extra safety.
- if $r2h --version; then break 2; else :; fi
+ $r2h --version && break 2
+ : For shells with busted 'set -e'.
done
skip_all_ "no proper rst2html program found"
done
# still be ongoing when the parallel one has terminated.
kill -0 $!
cat parallel/stdout
-test `grep -c '^PASS:' parallel/stdout` -eq 12
+test $(grep -c '^PASS:' parallel/stdout) -eq 12
# Wait long enough so that there are no open files any more when the
# post-test cleanup runs. But exit after we've waited for two minutes
# already happened).
i=1
while test ! -f serial/test-suite.log && test $i -le 120; do
- i=`expr $i + 1`
+ i=$(($i + 1))
sleep '1' # Extra quoting to please maintainer-check.
done
$sleep
# Temporarily disable shell traces, to avoid bloating the log file.
set +x
-for i in `seq_ 1 $count`; do
+for i in $(seq_ 1 $count); do
echo dummy $i > $i.log
echo :global-test-result: PASS > $i.trs
echo :test-result: PASS >> $i.trs
# Temporarily disable shell traces, to avoid bloating the log file.
set +x
-for i in `seq_ 1 $count`; do
+for i in $(seq_ 1 $count); do
echo false > $i.t
echo dummy $i > $i.log
echo :global-test-result: PASS > $i.trs
$ACLOCAL
$AUTOMAKE
-test `$FGREP .PHONY: Makefile.in | wc -l` = 3
+test $($FGREP -c '.PHONY:' Makefile.in) -eq 3
+
+:
# Is !CHECK mentioned?
grep ':.*!CHECK$' stderr
# Is there only one missing condition?
-test `grep ': ' stderr | wc -l` = 1
+test $(grep -c ': ' stderr) -eq 1
# By the way, Automake should suggest using AM_CPPFLAGS,
# because INCLUDES is an obsolete name.
$ACLOCAL
$AUTOMAKE
-$FGREP '@mandir@ foo' Makefile.in
-num=`grep '^mandir =' Makefile.in | wc -l`
-test $num -eq 1
+$FGREP 'mandir' Makefile.in # For debugging.
+$FGREP '@mandir@ foo' Makefile.in
+test $(grep -c '^mandir =' Makefile.in) -eq 1
:
$ACLOCAL
AUTOMAKE_fails -Wno-portability
-q="[\`'\"]"
-grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr
+grep "^Makefile\.am:3:.* AR .* with '=' before .*'+='" stderr
:
grep '[cC]annot apply.*+=' stderr
grep ': !COND1 and !COND3$' stderr
# Make sure there is exactly one missing condition.
-test `grep ': ' stderr | wc -l` = 1
+test $(grep -c ': ' stderr) -eq 1
:
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE install
test -f bar.data
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
test -f libfoo2.c
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
test -f libfoo2.c
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
$MAKE install
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
$MAKE test1 test2
#! /bin/sh
echo Maude
END
-
chmod +x foo
mkdir install
$AUTOCONF
$AUTOMAKE -a
-./configure "--prefix=`cd install && pwd`"
+./configure "--prefix=$(cd install && pwd)"
$MAKE
$MAKE distdir
# or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
# file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
# as is the case with openSUSE 12.1). See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
$MAKE
# or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
# file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
# as is the case with openSUSE 12.1). See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
# A rule in the Makefile should create subdir.
$AUTOCONF
$AUTOMAKE --copy --add-missing
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE test-all
$MAKE test-install
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([`echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`])
+AC_CONFIG_FILES([$(echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g')])
AC_OUTPUT
EOF
$AUTOMAKE -a
$AUTOCONF
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE install
am_create_testdir=empty
. ./defs || Exit 1
-libdir=`$AUTOMAKE --print-libdir` || Exit 1
+libdir=$($AUTOMAKE --print-libdir) || Exit 1
case $libdir in /*);; *) Exit 1;; esac
test -d "$libdir"
test "$libdir" = "$am_pkgvdatadir"
|| fatal_ "failed to fetch auxiliary script py-compile"
f=__init__
-for d in foo foo/bar "`pwd`/foo" . .. ../foo ''; do
+for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
if test -z "$d"; then
d2=.
else
required=python
. ./defs || Exit 1
-ocwd=`pwd` || Exit 99
+ocwd=$(pwd) || fatal_ "getting current working directory"
pyfiles="
foo.py
day='([012][0-9]|3[01])'
hour='([01][0-9]|2[0123])'
LC_ALL=C $EGREP "^py-compile $year-$month-$day\.$hour" stdout
-test `wc -l <stdout` -eq 1
+test $(wc -l <stdout) -eq 1
# Unknown option.
for opt in -b -d --foo; do
./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
- grep "^py-compile: unrecognized option ['\`]$opt'" stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^py-compile: unrecognized option '$opt'" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
# Missing option argument.
for opt in --basedir --destdir; do
./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
- grep "^py-compile: option ['\`]$opt' requires an argument" stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^py-compile: option '$opt' requires an argument" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
# Missing files.
./py-compile $args 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep '^py-compile: no files given' stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
:
$AUTOMAKE --add-missing
test -f py-compile
-inst=`pwd`/inst
-
-./configure --prefix="$inst"
+./configure --prefix="$(pwd)/inst"
$MAKE install
-test -f "$inst/py/yes.py"
-test -f "$inst/py/yes.pyc"
-test ! -f "$inst/py/no.py"
-test ! -f "$inst/py/no.pyc"
+test -f inst/py/yes.py
+test -f inst/py/yes.pyc
+test ! -f inst/py/no.py
+test ! -f inst/py/no.pyc
$MAKE disttest
# vary among different python installations, so we need more relaxed
# and ad-hoc checks for them. Also, more proper "functional" checks
# on them should be done in the 'python-virtualenv.test' test.
-PYTHON_VERSION=`$PYTHON -c 'import sys; print(sys.version[:3])'` || Exit 1
-PYTHON_PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` || Exit 1
+PYTHON_VERSION=$($PYTHON -c 'import sys; print(sys.version[:3])') || Exit 1
+PYTHON_PLATFORM=$($PYTHON -c 'import sys; print(sys.platform)') || Exit 1
PYTHON_EXEC_PREFIX='${exec_prefix}'
PYTHON_PREFIX='${prefix}'
pkgpythondir="\${pythondir}/$me"
framework_failure_ "can't activate python virtual environment"
fi
-cwd=`pwd`
-py_version=`python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))'`
+cwd=$(pwd) || fatal_ "getting current working directory"
+py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))')
py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages
# We need control over the package name.
grep "py" Makefile.in Makefile2.in Makefile3.in # For debugging.
for f in Makefile.in Makefile2.in Makefile3.in; do
- test `grep -c '^py_compile =' $f` -eq 1
- test `grep -c '^am__py_compile =' $f` -eq 1
+ test $(grep -c '^py_compile =' $f) -eq 1
+ test $(grep -c '^am__py_compile =' $f) -eq 1
done
:
$AUTOCONF
$AUTOMAKE --add-missing
-mkdir inst
-inst=`pwd`/inst
-mkdir build
-cd build
-../configure --prefix="$inst"
+inst=inst_
+mkdir inst_ build_
+cd build_
+
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+../configure --prefix="$cwd/$inst" one=0
$MAKE install
test -f "$inst/your/two.py"
test -f "$inst/your/two.pyc"
test ! -f "$inst/your/two.pyc"
test ! -f "$inst/your/two.pyo"
-../configure --prefix="$inst" one=1
+../configure --prefix=$cwd/"$inst" one=1
$MAKE install
test ! -f "$inst/your/two.py"
test ! -f "$inst/your/two.pyc"
$AUTOCONF
$AUTOMAKE --add-missing
-rm -rf inst build
-mkdir inst
-instdir=`pwd`/inst
-mkdir build
+instdir=$(pwd)/inst
+mkdir inst build
cd build
../configure --prefix="/usr"
$MAKE install DESTDIR=$instdir
$AUTOCONF
$AUTOMAKE --add-missing
-mkdir inst
-inst=`pwd`/inst
mkdir build
cd build
-../configure --prefix="$inst"
+../configure --prefix="$(pwd)/inst"
$MAKE install
-test -f "$inst/my/one.py"
-test -f "$inst/my/one.pyc"
-test -f "$inst/my/one.pyo"
+test -f inst/my/one.py
+test -f inst/my/one.pyc
+test -f inst/my/one.pyo
:
exec python ${1+"$@"}
END
chmod a+x bin/my-python
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
: > Makefile.am
# Simulate no Python.
./configure PYTHON=:
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
:
$AUTOMAKE --add-missing
./configure
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
:
$AUTOMAKE --add-missing
./configure
-test x"`cat py.out`" = x0:1
+test x"$(cat py.out)" = x0:1
:
# Both aclocal and automake are expected to run one and just one time.
# Create and use wrappers that will verify that.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir bin
. ./defs || Exit 1
-ocwd=`pwd` || Exit 1
+ocwd=$(pwd) || fatal_ "getting current working directory"
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
echo AC_OUTPUT >> "$ocwd"/configure.ac
: > Makefile.am
unset d i
-bottom=`pwd`
+
+bottom=$(pwd) || fatal_ "getting current working directory"
cd "$ocwd"
-makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
-makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
-bar_in_list=`find . -name bar.in | LC_ALL=C sort`
-bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
+makefiles_am_list=$(find . -name Makefile.am | LC_ALL=C sort)
+makefiles_list=$(echo "$makefiles_am_list" | sed 's/\.am$//')
+bar_in_list=$(find . -name bar.in | LC_ALL=C sort)
+bar_list=$(echo "$bar_in_list" | sed 's/\.in$//')
cat configure.ac # For debugging.
./configure
$MAKE
+do_check ()
+{
+ $MAKE >stdout || { cat stdout; Exit 1; }
+ cat stdout
+ test $(grep -c "/missing " stdout) -eq 1
+}
+
# Now, we are set up. Ensure that, for either missing Makefile.in,
# or updated Makefile.am, rebuild rules are run, and run exactly once
# only.
rm -f Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c "/missing " stdout` -eq 1
+do_check
rm -f sub/Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c "/missing " stdout` -eq 1
+do_check
$sleep # Let touched files appear newer.
touch Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c "/missing " stdout` -eq 1
+do_check
touch sub/Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c "/missing " stdout` -eq 1
+do_check
:
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-configure-in # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-makefile-am # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo : > $srcdir/tweak-acinclude-m4 # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-aclocal-m4 # Make it a no-op again.
# We still need a little hack to make ./defs work outside automake's
# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
"$am_top_builddir"/defs-static >defs-static
diff "$am_top_builddir"/defs-static defs-static \
&& fatal_ "failed to edit defs-static"
export have_symlinks # Is used also by spawned shells.
# Don't let a failure poison all subsequent tests.
-do_clean ()
+do_clean_setup ()
{
# Don't try to be smart and use find here, that has caused issues
# and extra ERROR results in the past. Be dumb and safe.
rm -rf t
}
+do_clean_setup
+
# Exporting 'keep_testdirs' to "yes" in the environment should cause
# the cleanup code not to be run, so that the temporary directories
# are left on disk.
env keep_testdirs=yes \
$AM_TEST_RUNNER_SHELL -c ". ./defs && echo okok >foo" t/dummy.sh \
&& test -f t/dummy.dir/foo \
- && test okok = `cat t/dummy.dir/foo`'
+ && test okok = $(cat t/dummy.dir/foo)'
-do_clean
+do_clean_setup
# Check that pre-test cleanup works also with directories with
# "null" permissions, and containing broken symlinks.
&& test ! -d t/dummy.dir \
&& test ! -r t/dummy.dir'
-do_clean
+do_clean_setup
# Check that post-test cleanup works also with directories with
# "null" permissions, and containing broken symlinks.
&& test ! -d t/dummy.dir \
&& test ! -r t/dummy.dir'
-do_clean
+do_clean_setup
# Check that pre-test cleanup does not unduly change the permissions of
# files to which symlinks in the temporary test directory point to.
command_ok_ "post-cleanup with testdir with zero-perms symlinks" \
$AM_TEST_RUNNER_SHELL -c '
- ocwd=`pwd` || exit 1
+ ocwd=$(pwd) || exit 1
stderr_fileno_=2
. ./defs || Exit 1
ln -s "$ocwd/dir" "$ocwd/file" .
skip_row_ 6 "symlinks not supported"
fi
-do_clean
+do_clean_setup
# Check that the cleanup trap does not remove the temporary
# test directory in case of test failure, skip, hard-error,
" t/dummy.sh
command_ok_ "testdir not removed if exiting with status $st" \
test -f t/dummy.dir/foo
- do_clean
+ do_clean_setup
done
for sig in 1 2 3 9 13 15; do
" t/dummy.sh
command_ok_ "testdir not removed if getting signal $sig" \
test -f t/dummy.dir/foo
- do_clean
+ do_clean_setup
done
:
# This needs to be consistent with what $AM_TEST_RUNNER_SHELL
# deems to be the current working directory.
-cwd=`$AM_TEST_RUNNER_SHELL -c 'pwd'` \
+cwd=$($AM_TEST_RUNNER_SHELL -c 'pwd') \
|| fatal_ "can't get current working directory"
echo "$cwd"
do_check 'testdir has the expected path' \
'unset am_create_testdir' \
- 'case `pwd` in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
+ 'case $(pwd) in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
do_check 'fully pre-populated testdir' \
'unset am_create_testdir' \
'test -f install-sh || Exit 1
test -f configure.ac || Exit 1
- case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+ case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
do_check 'testdir has the expected path' \
'am_create_testdir=empty' \
- 'case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+ 'case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
do_check 'do not pre-populate testdir' \
'am_create_testdir=empty' \
test ! -f t/_self.dir || Exit 1
test ! -r t/_self.dir || Exit 1
grep "self-check-dir\.tap" Makefile || Exit 1
- case `pwd` in '"$cwd"') : ;; *) Exit 1;; esac'
+ case $(pwd) in '"$cwd"') : ;; *) Exit 1;; esac'
:
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Sanity check for the automake testsuite.
-# Check creation/removal of temporary test working directory by './defs'.
+# Check that our testsuite framework can be instructed not to consider
+# an early exit due to some command exiting unexpectedly with status 77.
-am_create_testdir=empty
+am_create_testdir=no
. ./defs || Exit 1
-# We still need a little hack to make ./defs work outside automake's
-# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
- "$am_top_builddir"/defs-static > defs-static
-diff "$am_top_builddir"/defs-static defs-static \
- && fatal_ "failed to edit defs-static"
-cp "$am_top_builddir"/defs .
-
set +e
unset am_explicit_skips stderr_fileno_
AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
-# I'm a lazy typist.
-sh=$AM_TEST_RUNNER_SHELL
+# FIXME: this can be simplified when we improve our runtime checks on the
+# testsuite shell to ensure it supports "VAR=val shell_func" correctly.
+run_dummy_test ()
+{
+ env $2 $AM_TEST_RUNNER_SHELL -c "am_create_testdir=no; . ./defs; $1" \
+ dummy.sh
+}
-$sh -c '. ./defs; (exit 77); exit 77' dummy.test
+run_dummy_test '(exit 77); exit 77'
test $? -eq 77 || Exit 1
-am_explicit_skips=no $sh -c '. ./defs; sh -c "exit 77"' dummy.test
+run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
test $? -eq 77 || Exit 1
-am_explicit_skips=yes $sh -c '. ./defs; (exit 77); exit 77' dummy.test
+run_dummy_test '(exit 77); exit 77' am_explicit_skips=yes
test $? -eq 78 || Exit 1
-am_explicit_skips=y $sh -c '. ./defs; sh -c "exit 77"' dummy.test
+run_dummy_test 'sh -c "exit 77"' am_explicit_skips=y
test $? -eq 78 || Exit 1
-am_explicit_skips=yes $sh -c '. ./defs; Exit 77' dummy.test
+run_dummy_test 'Exit 77' am_explicit_skips=yes
test $? -eq 77 || Exit 1
-am_explicit_skips=y $sh -c '. ./defs; skip_ "foo"' dummy.test
+run_dummy_test 'skip_ "foo"' am_explicit_skips=y
test $? -eq 77 || Exit 1
:
# If we override $me, ./defs should not modify it.
-s=`$AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh`
+s=$($AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh)
command_ok_ "override of \$me before ./defs causes no error" \
test $? -eq 0
unset r
# Overriding $me after sourcing ./defs-static should work.
-s=`$AM_TEST_RUNNER_SHELL -c '. ./defs-static && me=zardoz &&
- . ./defs && echo me=$me' bad.sh`
+s=$($AM_TEST_RUNNER_SHELL -c '. ./defs-static && me=zardoz &&
+ . ./defs && echo me=$me' bad.sh)
command_ok_ "override of \$me after ./defs-static causes no error" \
test $? -eq 0
unset AM_TESTS_REEXEC BASH_VERSION || :
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
cp "$am_top_builddir"/defs . || fatal_ "fetching 'defs' from top_builddir"
#
dir=$1; shift
get_ddata "$dir"
$sh "${dir}${dsep}dummy.sh" "$@" \
- | grep "^dummy: exec $AM_TEST_RUNNER_SHELL ${dir}${dsep}dummy\\.sh $*\$" \
+ | grep "^exec $AM_TEST_RUNNER_SHELL ${dir}${dsep}dummy\\.sh $*\$" \
&& r='ok' || r='not ok'
result_ "$r" "$sh display re-exec message [$dname] [args: $*]"
}
./dummy.sh a b \
- | grep "^dummy: exec $AM_TEST_RUNNER_SHELL \\./dummy\\.sh a b$" \
+ | grep "^exec $AM_TEST_RUNNER_SHELL \\./dummy\\.sh a b$" \
&& r='ok' || r='not ok'
result_ "$r" "direct run display re-exec message [args: a b]"
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 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 <http://www.gnu.org/licenses/>.
-
-# Sanity check for the automake testsuite.
-# Test the sanity checks performed by the 'defs' script. Also check
-# that we can use 'defs' elsewhere, when we duplicate some of the
-# infrastructure from the automake/tests subdirectory.
-
-am_create_testdir=empty
-. ./defs || Exit 1
-
-# Avoid to confuse traces from child processed with our own traces.
-show_stderr ()
-{
- sed 's/^/ | /' stderr >&2
-}
-
-AM_TESTS_REEXEC=no; export AM_TESTS_REEXEC
-
-source_defs=". '$am_top_builddir/defs'"
-
-if $AM_TEST_RUNNER_SHELL -c "$source_defs" dummy.sh 2>stderr; then
- show_stderr
- Exit 1
-else
- show_stderr
- grep 'defs-static: not found in current directory' stderr
-fi
-
-sed 's|^am_top_srcdir=.*|am_top_srcdir=foo|' \
- "$am_top_builddir"/defs-static > defs-static
-if $AM_TEST_RUNNER_SHELL -c "$source_defs" t/dummy.sh 2>stderr; then
- show_stderr
- Exit 1
-else
- show_stderr
- grep 'foo/defs-static\.in not found.*check \$am_top_srcdir' stderr
-fi
-
-sed 's|^am_top_builddir=.*|am_top_builddir=foo|' \
- "$am_top_builddir"/defs-static > defs-static
-if $AM_TEST_RUNNER_SHELL -c "$source_defs" t/dummy.sh 2>stderr; then
- show_stderr
- Exit 1
-else
- show_stderr
- grep 'foo/defs-static not found.*check \$am_top_builddir' stderr
-fi
-
-# We still need a little hack to make ./defs work outside automake's
-# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
- "$am_top_builddir"/defs-static > defs-static
-# Redefining *srcdir and *builddir variables in the environment shouldn't
-# cause problems
-env \
- builddir=bad-dir srcdir=bad-dir \
- top_builddir=bad-dir top_srcdir=bad-dir \
- abs_builddir=bad-dir abs_srcdir=bad-dir \
- abs_top_builddir=bad-dir abs_top_srcdir=bad-dir \
- $AM_TEST_RUNNER_SHELL -c "$source_defs && echo '!OK!' > ../foo" t/dummy.sh
-$FGREP '!OK!' t/foo
-
-:
check_work ()
{
desc=$1 args=$2 exp=$3
- st=0; got=`seq_ $args` || st=$?
+ st=0; got=$(seq_ $args) || st=$?
command_ok_ "$desc [exit status = 0]" test $st -eq 0
command_ok_ "$desc [output]" test x"$exp" = x"$got"
}
grep 'CXXLD .*baz' stdout
grep 'CCLD .*bla' stdout
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'YACC .*foo6\.' stdout
grep 'YACC .*baz6\.' stdout
grep 'LEX .*foo5\.' stdout
$EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'ylwrap ' stdout
$EGREP '(LEX|YACC) ' stdout && Exit 1
fi
grep 'CXXLD .*baz' stdout
grep 'CCLD .*bla' stdout
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'YACC .*foo6\.' stdout
grep 'YACC .*baz6\.' stdout
grep 'LEX .*foo5\.' stdout
$EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'ylwrap ' stdout
$EGREP '(LEX|YACC) ' stdout && Exit 1
fi
mkdir bin
saved_PATH=$PATH; export saved_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
$ACLOCAL
$AUTOMAKE --add-missing
# Check texinfo rules in silent-rules mode.
-required='makeinfo-html tex texi2dvi-o dvips'
+required='makeinfo tex texi2dvi dvips'
. ./defs || Exit 1
echo AC_OUTPUT >> configure.ac
$ACLOCAL
$AUTOMAKE
-uncondval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+uncondval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
cat >> Makefile.am << 'END'
foo_SOURCES += $(BAR_SRCS)
$AUTOMAKE
-condval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+condval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
test "x$uncondval" = "x$condval"
./true | grep true
./false | grep false
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
test -f ./t-false.$objext
test -f ./f-false.$objext
./true
./false && Exit 1
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
test -f ./true-true.$objext
test -f ./false-true.$objext
$sleep
: > a
$MAKE
-test "`cat a`" = ''
+test x"$(cat a)" = x
$sleep
touch b
$MAKE
-test "`cat a`" = rule1
+test "$(cat a)" = "rule1"
# Ensure a is strictly newer than b, so HP-UX make does not execute rule2.
$sleep
: > a
$sleep
touch c
$MAKE
-test "`cat a`" = rule2
+test "$(cat a)" = "rule2"
# Unfortunately, the following is not portable to FreeBSD/NetBSD/OpenBSD
# make, see explanation above.
$ACLOCAL
AUTOMAKE_fails
-q="[\`'\"]"
badname='not a standard library name'
# We're specifically testing for line-number information.
-grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr
+grep "^Makefile\\.am:1:.*'sub/foo'.*$badname" stderr
grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr
-grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr
+grep "^foo\\.mk:5:.*'zardoz\\.a'.*$badname" stderr
grep "^foo\\.mk:5:.*libzardoz\\.a" stderr
:
$AUTOCONF
$AUTOMAKE -a
-prefix=`cd install && pwd` || Exit 1
+prefix=$(cd install && pwd) || Exit 99
./configure --prefix="$prefix"
$MAKE
$MAKE install-strip
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip. See sister test strip3.
+# This test needs GNU binutils strip. See sister test 'strip3.sh'.
required='cc strip'
. ./defs || Exit 1
lib_LIBRARIES = libfoo.a
END
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
-
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
$MAKE
$MAKE install-strip
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip. Libtool variant.
+# This test needs GNU binutils strip. Libtool variant. See sister
+# test 'strip2.sh'.
required='cc libtoolize strip'
. ./defs || Exit 1
lib_LTLIBRARIES = libfoo.la
END
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
libtoolize
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
$MAKE
$MAKE install-strip
END
oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
# An rm(1) wrapper that fails when invoked too many times.
mkdir rm-wrap
max_rm_invocations=6
count_file=$ocwd/rm-wrap/count
cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+if ! test \$count -le $max_rm_invocations; then
echo "rm invoked more than $max_rm_invocations times" >&2
exit 1
fi
echo "OBJEXT='@OBJEXT@'" > get-objext.in
oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
# An rm(1) wrapper that fails when invoked too many times.
mkdir rm-wrap
max_rm_invocations=3
count_file=$ocwd/rm-wrap/count
cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+test \$count -le $max_rm_invocations || {
echo "rm invoked more than $max_rm_invocations times" >&2
exit 1
-fi
+}
echo "\$count" > '$count_file'
PATH='$oPATH'; export PATH
exec rm "\$@"
./configure --enable-dependency-tracking
-depdir=`sed -n 's/^ *DEPDIR *= *//p' Makefile`
+depdir=$(sed -n 's/^ *DEPDIR *= *//p' Makefile)
if test x"$depdir" != x; then
depdir=src/$depdir
else
# internals are changed.
for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
case $x in
- */*) d=`echo $x | sed 's,[^/]*$,,'`; b=`echo $x | sed 's,^.*/,,'`;;
+ */*) d=$(echo $x | sed 's,[^/]*$,,'); b=$(echo $x | sed 's,^.*/,,');;
*) d=''; b=$x;;
esac
# Be a little lax in the regexp, to account for automake conditionals,
cat > Makefile.am << 'END'
noinst_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # The `.//' is meant.
+libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # The './/' is meant.
.PHONY: print
print:
@echo BEG1: "$(LTCXXCOMPILE)" :1END
grep '^am_d_OBJECTS = ' Makefile.in
# Now the actual test. Are both values equal?
-cobj=`sed -n '/^am_c_OBJECTS = / {
- s/.* = \(.*\)$/\1/
- p
- }' Makefile.in`
-dobj=`sed -n '/^am_d_OBJECTS = / {
- s/^.* = \(.*\)$/\1/
- p
- }' Makefile.in`
+cobj=$(sed -n '/^am_c_OBJECTS = / {
+ s/.* = \(.*\)$/\1/
+ p
+ }' Makefile.in)
+dobj=$(sed -n '/^am_d_OBJECTS = / {
+ s/^.* = \(.*\)$/\1/
+ p
+ }' Makefile.in)
test "$cobj" = "$dobj"
:
# For debugging.
$EGREP -n 'ABCD|am__empty' Makefile.in
# Sanity check.
-test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 3
+test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
./configure
{
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
-if test -n "$doit"; then
+if test x"$doit" = x"yes"; then
AC_SUBST([basehdr], [sub/base.h])
AC_SUBST([nobasehdr], [sub/nobase.h])
AC_SUBST([basedata], [sub/base.dat])
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
$MAKE
$MAKE test-install-data
$MAKE uninstall
$MAKE clean
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
$MAKE
$MAKE test-install-nothing-data
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
$MAKE
$MAKE test-install-nothing-data
$MAKE test-install-nothing-exec
AUTOMAKE_fails
grep 'overrid.*libfake@SUBST@.a' stderr
$AUTOMAKE -Wno-override
-num=`grep '^libfake@SUBST@.a:' Makefile.in | wc -l`
-test $num -eq 1
+test $(grep -c '^libfake@SUBST@.a:' Makefile.in) -eq 1
+
+:
$AUTOMAKE $am_warns -i
grep '^ *\.c' Makefile.in # For debugging.
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+ test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+ test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
$AUTOMAKE $am_warns
grep '^ *\.c' Makefile.in # For debugging.
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+ test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+ test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
done
$AUTOMAKE -a
grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
$AUTOMAKE -i
grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
:
grep '^configure\.ac:3: .*missing.*error while making link' stderr
grep '^configure\.ac:3: .*install-sh.*error while making link' stderr
-test `$FGREP -c 'error while making link' stderr` -eq 2
+test $(grep -c 'error while making link' stderr) -eq 2
:
$FGREP 'Not seen' stdout && Exit 1
-test `$FGREP -c ': foo.test' stdout` -eq 1
-test `$FGREP -c ': bar.test' stdout` -eq 2
-test `$FGREP -c ': baz.test' stdout` -eq 2
+test $($FGREP -c ': foo.test' stdout) -eq 1
+test $($FGREP -c ': bar.test' stdout) -eq 2
+test $($FGREP -c ': baz.test' stdout) -eq 2
:
grep '^ERROR: bail\.test - Bail out!' stdout
grep '^PASS:' stdout && Exit 1
-test `$FGREP -c ': bail.test' stdout` -eq 1
+test $($FGREP -c ': bail.test' stdout) -eq 1
$FGREP 'success.test' stdout && Exit 1
# Override TEST_LOGS from the command line, making it point to a test
# TAP support:
# - colorization of TAP results and diagnostic messages
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
- "$std") ;;
- *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
-esac
-
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = color-tests
AM_TEST_LOG_DRIVER_FLAGS = --comments
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: all\.test 1 - foo$"
cat stdout | grep "^${lgn}XFAIL${std}: all\.test 2 - bar # TODO td$"
cat stdout | grep "^${blu}SKIP${std}: all\.test 3 - baz # SKIP sk$"
# colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
'## leave its behaviour in this context undefined for the moment.'
do
case $string in '##'*) continue;; esac
- i=`expr $i + 1`
+ i=$(($i + 1))
unindent >> Makefile.am << END
TEST_EXTENSIONS += .t$i
TESTS += foo$i.t$i
grep "^# all.test:${ws1p}zardoz${ws0p}$" stdout
grep "^# all.test:${ws1p}foo bar${tab}baz${ws0p}$" stdout
-test `grep -c '^# all\.test:' stdout` -eq 4
+test $(grep -c '^# all\.test:' stdout) -eq 4
:
#
# From manpage Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+# Lines written to standard output matching /^(not )?ok\b/ must be
# interpreted as test lines. All other lines must not be considered
-# test output.''
+# test output.
#
# Unfortunately, the exact format of TODO and SKIP directives is not as
# clearly described in that manpage; but a simple reverse-engineering of
#
# From manpage Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+# Lines written to standard output matching /^(not )?ok\b/ must be
# interpreted as test lines. All other lines must not be considered
-# test output.''
+# test output.
#
# Unfortunately, the exact format of TODO and SKIP directives is not as
# clearly described in that manpage; but a simple reverse-engineering of
xpass=130 # = 4 * 34 - 6
skip=130 # = 4 * 34 - 6
error=0
-total=`expr $pass + $fail + $xfail + $xpass + $skip`
+total=$(($pass + $fail + $xfail + $xpass + $skip))
# Even nastier! But accordingly to the specifics, it should still work.
for result in 'ok' 'not ok'; do
echo "ok{[(<#${tab}SKIP>)]}" >> all.test
# We have to update some test counts.
-xfail=`expr $xfail + 1`
-xpass=`expr $xpass + 1`
-skip=`expr $skip + 1`
-total=`expr $total + 3`
+xfail=$(($xfail + 1))
+xpass=$(($xpass + 1))
+skip=$(($skip + 1))
+total=$(($total + 3))
# And add the test plan!
echo 1..$total >> all.test
END
# We don't care about the exit status of "make check" here.
-TESTS="`echo *.test`" $MAKE -e check || :
+TESTS="$(echo *.test)" $MAKE -e check || :
cat test-suite.log
grep ':.*ok|not seen' test-suite.log && Exit 1
grep '^1\.\.0 # SKIP all$' test-suite.log
-case `cat test-suite.log` in
- *"`cat hodgepodge`"*) ;;
+test_suite_contents=$(cat test-suite.log)
+hodgepodge_contents=$(cat hodgepodge)
+case $test_suite_contents in
+ *"$hodgepodge_contents"*) ;;
*) Exit 1;;
esac
Bail out!
END
-tests=`echo *.test` # Also required later.
+tests=$(echo *.test) # Also required later.
TESTS="$tests" $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
# Dirty trick required here.
-for tst in `echo " $tests " | sed 's/.test / /'`; do
+for tst in $(echo " $tests " | sed 's/\.test / /'); do
echo :copy-in-global-log: yes >> $tst.trs
done
have_rst_section ()
{
- eqeq=`echo "$1" | sed 's/./=/g'`
+ eqeq=$(echo "$1" | sed 's/./=/g')
# Assume $1 contains no RE metacharacters.
sed -n "/^$1$/,/^$eqeq$/p" test-suite.log > got
(echo "$1" && echo "$eqeq") > exp
$FGREP "$pmarker $result $pmarker" my.log || st=1
$FGREP "$cmarker $result $cmarker" my.log || st=1
done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
# Passed test scripts shouldn't be mentioned in the global log.
$EGREP '(^pass|[^x]pass)\.test' my.log && Exit 1
test ! -f test-suite.log
# Check that VERBOSE causes the global testsuite log to be
# emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
case $out in *"$log"*) ;; *) Exit 1;; esac
touch error2.log test-suite.log my.log
count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0
grep '^PASS: 1\.test 1 - mu$' stdout
grep '^SKIP: 1\.test 2 zardoz # SKIP$' stdout
- test `$FGREP -c '1.test' stdout` -eq 2
+ test $(grep -c '1\.test' stdout) -eq 2
grep '^PASS: 2\.test 1$' stdout
grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
grep '^PASS: 2\.test 3$' stdout
- test `$FGREP -c '2.test' stdout` -eq 3
+ test $(grep -c '2\.test' stdout) -eq 3
grep '^PASS: 3\.test 1 - blah blah blah$' stdout
grep '^# 3\.test: Some diagnostic$' stdout
- test `$FGREP -c '3.test' stdout` -eq 2
+ test $(grep -c '3\.test' stdout) -eq 2
# Failure.
count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1
grep '^PASS: 1\.test 1 - mu$' stdout
grep '^FAIL: 1\.test 2 zardoz$' stdout
- test `$FGREP -c '1.test' stdout` -eq 2
+ test $(grep -c '1\.test' stdout) -eq 2
grep '^PASS: 2\.test 1$' stdout
grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
grep '^PASS: 2\.test 3$' stdout
- test `$FGREP -c '2.test' stdout` -eq 3
+ test $(grep -c '2\.test' stdout) -eq 3
grep '^PASS: 3\.test 1 - blah blah blah$' stdout
grep '^# 3\.test: Some diagnostic$' stdout
grep '^ERROR: 3\.test - Bail out! Kernel Panic$' stdout
- test `$FGREP -c '3.test' stdout` -eq 3
+ test $(grep -c '3\.test' stdout) -eq 3
cd $srcdir
>
END
-n=`wc -l <prefixes`
+n=$(wc -l <prefixes)
# See the loop below to understand this initialization.
-pass=`expr $n '*' 3`
+pass=$(($n * 3))
fail=$pass
-skip=`expr $pass - 3`
+skip=$(($pass - 3))
xfail=$skip
xpass=$xfail
error=0
-total=`expr $pass + $fail + $skip + $xfail + $xpass`
+total=$(($pass + $fail + $skip + $xfail + $xpass))
echo 1..$total > all.test
cat all.test # For debugging.
# Sanity checks.
-grep '#.*#' all.test && framework_failure_ "creating all.test"
-test `wc -l <all.test` -lt $highno || framework_failure_ "creating all.test"
+grep '#.*#' all.test \
+ && framework_failure_ "creating all.test"
+test $(wc -l <all.test) -lt $highno \
+ || framework_failure_ "creating all.test"
$MAKE check >stdout || :
cat stdout
# According to documentation of Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/
+# Lines written to standard output matching /^(not )?ok\b/
# must be interpreted as test lines. All other lines must
-# not be considered test output.''
+# not be considered test output.
cat >> all.test <<END
ok
# Bail out!
END
-cat all.test # For debugging.
-# Minor sanity check.
-test `grep -c '^ok1$' all.test` -eq 1 \
- && test `grep -c '^not ok1$' all.test` -eq 1 \
+# Debugging info and minor sanity check.
+cat all.test \
+ && test $(grep -c '^ok1$' all.test) -eq 1 \
+ && test $(grep -c '^not ok1$' all.test) -eq 1 \
|| framework_failure_ "creating all.test"
$MAKE check >stdout || { cat stdout; Exit 1; }
END
# Strip any extra whitespace, for Solaris' wc.
-planned=`wc -l <punctuation | tr -d " $tab"`
+planned=$(wc -l <punctuation | tr -d " $tab")
echo 1..$planned > all.test
awk '{print "ok " NR $0 }' punctuation >> all.test
count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
-test `$FGREP -c ': a.test' stdout` -eq 3
-test `$FGREP -c ': b.test' stdout` -eq 5
-test `$FGREP -c ': c.test' stdout` -eq 4
-test `$FGREP -c ': d.test' stdout` -eq 5
+test $($FGREP -c ': a.test' stdout) -eq 3
+test $($FGREP -c ': b.test' stdout) -eq 5
+test $($FGREP -c ': c.test' stdout) -eq 4
+test $($FGREP -c ': d.test' stdout) -eq 5
grep '^ERROR: a\.test 71 # OUT-OF-ORDER (expecting 3)$' stdout
grep '^ERROR: b\.test 4 foo # OUT-OF-ORDER (expecting 3)$' stdout
0..0
END
-tests_list=`echo *.test`
+tests_list=$(echo *.test)
TESTS="$tests_list" $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
END
-tests=`echo *.test`
+tests=$(echo *.test)
for tap_flags in "" "--comments"; do
env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-# These nested loops are clearer without indentation.
-
+# These nested loops below are clearer without indentation.
i=0
for c1 in s S; do
for c2 in k K; do
for c3 in i I; do
for c4 in p P; do
- i=`expr $i + 1`
- case $i in ?) i=0$i; esac
- echo "1..0 # $c1$c2$c3$c4 foobar" > $i.test
+ i=$(($i + 1))
+ case $i in ?) j=0$i;; *) j=$i;; esac
+ echo "1..0 # $c1$c2$c3$c4 foobar" > $j.test
done; done; done; done
-TESTS="`echo *.test`" $MAKE -e check >stdout || { cat stdout; Exit 1; }
+TESTS="$(echo *.test)" $MAKE -e check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=16 pass=0 fail=0 xpass=0 xfail=0 skip=16 error=0
grep '^SKIP: foo\.test .* from the last line$' stdout
grep '^SKIP: bar\.test$' stdout
-test `grep -c ': .*\.test' stdout` -eq 2
+test $(grep -c ': .*\.test' stdout) -eq 2
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
:
cat stdout
count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=3
-test `grep -c '^ERROR: all\.test - multiple test plans' stdout` -eq 3
+test $(grep -c '^ERROR: all\.test - multiple test plans' stdout) -eq 3
:
grep '^SKIP: wget\.test .* wget(1) not installed$' stdout
grep '^SKIP: curl\.test .* Can'\''t connect to gnu\.org!$' stdout
grep '^SKIP: mu\.test' stdout | $FGREP "$weirdchars" stdout
-test `grep -c ': .*\.test' stdout` -eq 6
+test $(grep -c ': .*\.test' stdout) -eq 6
:
# out its output progressively and "in sync" with test execution -- it is
# make that is stowing such output away instead of presenting it to the
# user as soon as it gets it.
-if using_gmake; then :; else
+if ! using_gmake; then
case $MAKE in
*\ -j*) skip_ "doesn't with non-GNU concurrent make";;
esac
END
echo TESTS += signal-$sig.test >> Makefile.am
done
-results_count=`ls *.test | wc -l | tr -d "$tab$sp"`
+results_count=$(ls *.test | wc -l | tr -d "$tab$sp")
chmod a+x *.test
./configure
-system=`uname -s -r || echo unknown` # Needed later.
+system=$(uname -s -r || echo unknown) # Needed later.
signal_caught ()
{
cat stdout # For debugging.
command_ok_ "count of test results" count_test_results \
- total=`expr $results_count '*' 2` \
+ total=$(($results_count * 2)) \
pass=$results_count error=$results_count \
fail=0 xpass=0 xfail=0 skip=0
END
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
- test `$FGREP -c ': all.test' stdout` -eq 4
+ test $($FGREP -c ': all.test' stdout) -eq 4
$EGREP '^PASS: all\.test 1($| )' stdout
$EGREP '^SKIP: all\.test 2($| )' stdout
$EGREP ': all\.test 3($| )' stdout
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "couldn't get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
echo AC_OUTPUT >> configure.ac
TAR="$cwd/am--tar foo" $MAKE distcheck
test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = foo
+test "$(cat am--tar-has-run)" = foo
rm -f *.tar.* *has-run*
# Creative use of eval to pacify maintainer checks.
eval \$'MAKE dist "TAR=./am--tar mu"'
test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = mu
+test "$(cat am--tar-has-run)" = mu
:
AUTOMAKE_fails
grep "^configure\.ac:2:.*mutually exclusive" stderr > tar-err
cat tar-err
-test 1 = `wc -l < tar-err`
+test 1 -eq $(wc -l < tar-err)
grep "'tar-pax'" tar-err
grep "'tar-v7'" tar-err
cd build
../configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./foo
./bar
fi
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./foo
./bar
fi
test -f sub1/baz.trs
END
-cat > checkdir-driver <<'END'
-#! /bin/sh
+echo "#!$AM_TEST_RUNNER_SHELL" > checkdir-driver
+cat >> checkdir-driver <<'END'
set -e; set -u
while test $# -gt 0; do
case $1 in
echo "log: $log_file" # For debugging.
echo "trs: $trs_file" # Ditto.
case $log_file in */*);; *) exit 1;; esac
-dir_log=`expr "$log_file" : '\(.*\)/[^/]*'`
-dir_trs=`expr "$trs_file" : '\(.*\)/[^/]*'`
+dir_log=${log_file%/*}
+dir_trs=${trs_file%/*}
echo "dir_log: $dir_log" # For debugging.
echo "dir_trs: $dir_trs" # Likewise.
test x"$dir_trs" = x"$dir_log" || exit 1
grep '%% fail2 %%' test-suite.log
grep '%% pass-fail %%' test-suite.log
grep '%% pass-xpass-fail-xfail-skip-error %%' test-suite.log
- test `grep -c '%% ' test-suite.log` -eq 4
+ test $(grep -c '%% ' test-suite.log) -eq 4
TESTS='pass.t pass3-skip2-xfail.t' $MAKE -e check >stdout \
|| { cat stdout; cat test-suite.log; Exit 1; }
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
-test `grep -c '^PASS:' stdout` -eq 3
-test `grep -c '^XFAIL:' stdout` -eq 13
+test $(grep -c '^PASS:' stdout) -eq 3
+test $(grep -c '^XFAIL:' stdout) -eq 13
for dir in sub1 sub2; do
cd $dir
cp x2.test pass.test
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
- test "`cat pass.trs`" = ":test-result: FAIL"
- test "`cat x1.trs`" = ":test-result: XPASS"
- test "`cat x2.trs`" = ":test-result: XFAIL"
+ test "$(cat pass.trs)" = ":test-result: FAIL"
+ test "$(cat x1.trs)" = ":test-result: XPASS"
+ test "$(cat x2.trs)" = ":test-result: XFAIL"
grep '^FAIL: pass\.test$' stdout
grep '^XPASS: x1\.test$' stdout
grep '^XFAIL: x2\.test$' stdout
END
mkdir sub bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
cat > wrapper.skel <<'END'
#! /bin/sh
am_create_testdir=empty
. ./defs || Exit 1
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
for i in 1 2; do
mkdir D$i
. ./defs || Exit 1
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir src build
mv install-sh missing configure.ac src
for i in 1 2 3; do
AUTOMAKE_fails $i
- lineno=`sed -n 's/^## lineno //p' $i.am` \
+ lineno=$(sed -n 's/^## lineno //p' $i.am) \
&& test 0 -lt "$lineno" \
|| Exit 99
grep "^$i\\.am:$lineno:.*TEST_EXTENSIONS.*conditional content" stderr
grep -i 'log' Makefile.in # For debugging.
for lc in $valid_extensions; do
- uc=`echo $lc | tr '[a-z]' '[A-Z]'`
+ uc=$(echo $lc | tr '[a-z]' '[A-Z]')
$FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
grep "^${uc}_LOG_COMPILE =" Makefile.in
grep "^\.${lc}\.log:" Makefile.in
AUTOMAKE_fails
for suf in mu .x-y a-b .t.1 .6c .0 .11 @suf@ .@ext@ '.=' '_&_'; do
- suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
+ suf2=$(printf '%s\n' "$suf" | sed -e 's/\./\\./')
$EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
done
$FGREP "$pmarker $result $pmarker" my.log || st=1
$FGREP "$cmarker $result $cmarker" my.log || st=1
done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
have_rst_section ()
{
- eqeq=`echo "$1" | sed 's/./=/g'`
+ eqeq=$(echo "$1" | sed 's/./=/g')
# Assume $1 contains no RE metacharacters.
sed -n "/^$1$/,/^$eqeq$/p" $2 > got
(echo "$1" && echo "$eqeq") > exp
test ! -f test-suite.log
# Check that VERBOSE causes the global testsuite log to be
# emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
case $out in *"$log"*) ;; *) Exit 1;; esac
touch error2.log test-suite.log my.log
have_result ()
{
cat > exp; echo >> exp; echo logloglog >> exp
- eline=`get_escaped_line exp`
+ eline=$(get_escaped_line exp)
sed -n -e "/^$eline$/,/^logloglog$/p" test-suite.log > got
cat exp; cat got
diff exp got
:recheck: no
END
-rechecked=`echo y-[0-9]*`
+rechecked=$(echo y-[0-9]*)
for t in [yn]-[0-9]*; do echo $t; done \
| sed 's/.*/TESTS += &/' >> Makefile.am
$srcdir/configure
$MAKE tb
- test x"`cat tb`" = x"foo bar sub/zardoz"
+ test x"$(cat tb)" = x"foo bar sub/zardoz"
rm -f tb
# Please don't change the order of the stuff in TESTS, below.
TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' $MAKE -e tb
- test x"`cat tb`" = x"foo foo2 foo-log foolog a.log.b 0.exe"
+ test x"$(cat tb)" = x"foo foo2 foo-log foolog a.log.b 0.exe"
rm -f tb
cd $srcdir
error_count=17
tests_count=120
-pass=` seq_ 1 $pass_count | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
do_check $pass $skip $xfail $fail $xpass $error <<END
$header
xpass_count=17
error_count=9
-pass=` seq_ 1 $pass_count | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
do_check $pass $skip $xfail $fail $xpass $error <<END
$header
$AUTOCONF
$AUTOMAKE
-./configure --program-prefix=gnu- --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-prefix=gnu- --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
$AUTOCONF
$AUTOMAKE
-./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-transform-name='s/[12]//' --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Also squash all file types in question.
# On newer Cygwin versions, that won't work, likely due to overly
# aggressive appending of '.exe' suffix when copying/renaming Windows
-# executables). So let's skip this part of the test if we detect the
+# executables. So let's skip this part of the test if we detect the
# faulty heuristic is present. See also:
# <http://lists.gnu.org/archive/html/automake-patches/2010-08/msg00153.html>
# <http://thread.gmane.org/gmane.os.cygwin/119380>
cp foo bar && cmp foo bar \
|| skip_ "your Cygwin is too aggressive in tweaking '.exe' suffixes"
-./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+./configure --program-transform-name='s/.*/foo/' --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install-foo
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
:
$AUTOCONF
$AUTOMAKE -a
-./configure --program-prefix=gnu- --prefix "`pwd`/inst"
+./configure --program-prefix=gnu- --prefix "$(pwd)/inst"
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
# The pdf, ps and dvi targets shouldn't let clutter in the build directory.
# Related to automake bug#11146.
-required='makeinfo tex texi2dvi-o dvips'
+required='makeinfo tex texi2dvi dvips'
. ./defs || Exit 1
mkdir sub
$MAKE $fmt
ls -l . sub # For debugging.
ls -d foo* baz* sub/bar* > lst
- $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info)$' lst && Exit 1
+ $EGREP -v '^(foo|sub/bar|baz)\.(texi|dvi|ps|pdf|html|info|t2[dp])$' \
+ lst && Exit 1
$MAKE clean
done
# Also make sure we do not distribute too much foo.info* files (Report
# from Vincent Lefevre).
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
echo AC_OUTPUT >> configure.ac
$AUTOMAKE --add-missing
$AUTOCONF
-./configure "--infodir=`pwd`/_inst"
+./configure "--infodir=$(pwd)/_inst"
$MAKE
# Make sure .iNN files are installed.
# Test support for building HTML documentation, and the many
# install-DOC flavors.
-required='makeinfo-html tex texi2dvi'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >>configure.ac <<\EOF
AM_MAKEINFOFLAGS = --unsupported-option
EOF
$AUTOMAKE
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
+
$MAKE html
test -f main.html
test -f sub/main2.html
# (Similar to txinfo13.test, plus DISTCLEANFILES).
# (See also txinfo24.test and txinfo25.test).
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >> configure.ac << 'END'
# (Similar to txinfo16.test, plus CLEANFILES).
# (See also txinfo23.test and txinfo25.test).
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >> configure.ac << 'END'
# (Similar to txinfo16.test, plus CLEANFILES).
# (See also txinfo23.test and txinfo24.test).
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
cat >> configure.ac << 'END'
$MAKE
$MAKE distclean
-case `pwd` in
+abscwd=$(pwd) || fatal_ "getting current working directory"
+
+case $abscwd in
*\ * | *\ *)
skip_ "this test might fail in a directory containing white spaces";;
esac
mkdir build
cd build
-../configure "--srcdir=`pwd`/.." "--prefix=`pwd`/_inst" "--infodir=`pwd`/_inst/info"
+../configure --srcdir="$abscwd" \
+ --prefix="$abscwd/build/_inst" \
+ --infodir="$abscwd/build/_inst/info"
+
$MAKE install
+
test -f ../main.info
test ! -f ./main.info
test -f _inst/info/main.info
$AUTOMAKE --add-missing
$AUTOCONF
-./configure "--prefix=`pwd`/inst" "--infodir=`pwd`/inst/info"
+./configure --prefix="$(pwd)/inst" --infodir="$(pwd)/inst/info"
$MAKE install-info
test -f inst/info/main.info
+
+:
# references.
# Report from Ralf Corsepius.
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi'
. ./defs || Exit 1
# This setting, when honored by GNU ls, used to cause an infinite loop
$AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
# ... and it is the right one.
grep '^INFO_DEPS *= *foo.info *$' Makefile.in
$AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
# ... and it is the right one.
grep '^INFO_DEPS *= *@INFO_DEPS@ *$' Makefile.in
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE html dvi ps pdf info \
install-html install-dvi install-ps install-pdf install-info \
install-man install-data install-exec install uninstall
-Exit 0
+:
# DVIS, PDFS, PSS, HTMLS should not be cleaned upon 'mostlyclean'.
# Similar to txinfo25.test.
-required='makeinfo tex texi2dvi-o dvips'
+required='makeinfo tex texi2dvi dvips'
. ./defs || Exit 1
mkdir sub
# overkill.
for t in info dist-info dvi-am install-html uninstall-pdf-am; do
$EGREP "(^| )$t*.:" Makefile.in # For debugging.
- test `$EGREP -c "(^| )$t(:| *.:)" Makefile.in` -eq 1
+ test $($EGREP -c "(^| )$t(:| *.:)" Makefile.in) -eq 1
done
:
$AUTOMAKE
$AUTOCONF
+# Make it harder to experience false postives when grepping error messages.
inst=__inst-dir__
-./configure --prefix="`pwd`/$inst"
+./configure --prefix="$(pwd)/$inst"
mkdir $inst $inst/share
: > $inst/share/foobar.txt
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE uninstall
test ! -d inst
baz_SOURCES = baz.c
END
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent >> Makefile.am <<'END'
check-local:
./zardoz
public const string BARBAR;
END
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent >> Makefile.am <<'END'
check-local: test2
.PHONY: test1 test2
$FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
$FGREP 'zardoz_vala.stamp:' Makefile.in
$FGREP 'libzardoz_la_vala.stamp:' Makefile.in
-test `$FGREP -c '.stamp:' Makefile.in` -eq 2
+test $($FGREP -c '.stamp:' Makefile.in) -eq 2
$FGREP 'zardoz.c' Makefile.in
$FGREP 'zardoz-foo.c' Makefile.in
$FGREP 'zardoz-bar.c' Makefile.in
$FGREP 'bar.c' sub/Makefile.in
$FGREP 'baz.c' sub/Makefile.in
$FGREP 'foo_vala.stamp:' sub/Makefile.in
-test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
+test $($FGREP -c '.stamp:' sub/Makefile.in) -eq 1
# Check against regression for weird bug due to unescaped '@'
# characters used in a "..." perl string when writing the vala
END
chmod +x valac
-cwd=`pwd`
-
-# Use $cwd instead of `pwd` in the && list below to avoid a bug in
-# the way Solaris/Heirloom Sh handles 'set -e'.
+cwd=$(pwd) || fatal_ "getting current working directory"
$ACLOCAL
$AUTOMAKE -a
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./src/foo
./src/bar
- test `./src/foo` = foo
- test `./src/bar` = bar
+ test "$(./src/foo)" = foo
+ test "$(./src/bar)" = bar
fi
# Test clean rules.
AUTOMAKE_fails --add-missing
# The expected diagnostic is:
# automake: warnings are treated as errors
-# Makefile.am:3: warning: variable `EXTRA_libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:3: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:1: warning: variable `libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:1: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:2: warning: variable `nodist_libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:2: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:4: warning: variable `libfoo_la_LIBADD' is defined but no program or
-# Makefile.am:4: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:6: warning: variable `EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
-# Makefile.am:6: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
-# Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
-
+# Makefile.am:3: warning: variable 'EXTRA_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:3: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:1: warning: variable 'libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:1: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:2: warning: variable 'nodist_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:2: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:4: warning: variable 'libfoo_la_LIBADD' is defined but no program or
+# Makefile.am:4: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:6: warning: variable 'EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:5: warning: variable 'libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:5: library has 'libfoo_la' as canonical name (possible typo)
grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 6
+test $(grep -c 'variable.*is defined but' stderr) -eq 6
# If we add a global -Wnone, all warnings should disappear.
$AUTOMAKE -Wnone
grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. ' \
&& Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 13
+test $(grep -c 'variable.*is defined but' stderr) -eq 13
# If we add a global -Wnone, all warnings should disappear.
$AUTOMAKE -Wnone
. ./defs || Exit 1
-amver=`$AUTOMAKE --version | sed -e 's/.* //;1q'`
+amver=$($AUTOMAKE --version | sed -e 's/.* //;1q')
# Does the extracted version number seems legit?
case $amver in
# Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
# are consistent.
$EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
- vmonth=`grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}'`
+ vmonth=$(grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}')
grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
# Check that the vers*.texi file is distributed according
# to $(DISTFILES).
# for more vers*.texi files, and does not require makeinfo, tex and
# texi2dvi.
-required='makeinfo tex texi2dvi-o'
+required='makeinfo tex texi2dvi grep-nonprint'
. ./defs || Exit 1
-case `LC_ALL=C date '+%u'` in
- [1-7]) date_is_posix=:;;
- *) date_is_posx=false;;
-esac
-$date_is_posix \
- && day=`LC_ALL=C date '+%d'` && test -n "$day" \
- && month=`LC_ALL=C date '+%B'` && test -n "$month" \
- && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
+test $(LC_ALL=C date '+%u') -gt 0 && test $(LC_ALL=C date '+%u') -lt 8 \
+ && day=$(LC_ALL=C date '+%d') && test -n "$day" \
+ && month=$(LC_ALL=C date '+%B') && test -n "$month" \
+ && year=$(LC_ALL=C date '+%Y') && test -n "$year" \
|| skip_ "'date' is not POSIX-compliant enough"
-day=`echo "$day" | sed 's/^0//'`
-
-(echo '\ex\a' | grep x) \
- || skip_ "grep doesn't work on input that is not pure text"
+day=$(echo "$day" | sed 's/^0//')
cat > configure.ac << END
AC_INIT([$me], [123.456])
include defs.am
info_TEXINFOS = foo.texi
test-grepinfo:
-## Not useless uses of cat: we only tested that grep worked on
+## Not useless uses of cat: we only tested that grep works on
## non-text input when that's given from a pipe.
cat $(srcdir)/foo.info | grep 'GREPVERSION=$(my_version_rx)='
cat $(srcdir)/foo.info | grep 'GREPEDITION=$(my_version_rx)='
{
AUTOMAKE_run $*
grep '^Makefile\.am:.*:=.*not portable' stderr
- test `wc -l <stderr` -eq 1
+ test $(wc -l <stderr) -eq 1
}
set_am_opts()
grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
grep '^Makefile.am:.*INCLUDES' stderr && Exit 1
# Only three lines of warnings.
-test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
+test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 3
# On fast machines the autom4te.cache created during the above run of
# $AUTOMAKE is likely to have the same time stamp as the configure.ac
END
$ACLOCAL
$AUTOMAKE
+
+:
AUTOMAKE_fails -Wno-error
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
sed '/AUTOMAKE_OPTIONS/d' sub/Makefile.am > t
mv -f t sub/Makefile.am
AUTOMAKE_fails -Wno-error
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
sed '/AUTOMAKE_OPTIONS/d' Makefile.am > t
mv -f t Makefile.am
AUTOMAKE_fails -Werror
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
AUTOMAKE_run -Wno-error
grep 'VAR multiply defined' stderr
# Check that per-object flags are honored.
test -f bar-parse.output
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo a | ./foo
echo b | ./foo && Exit 1
echo a | ./bar
test -f foo3-parse3.output
test -f foo4-parse4.output
-if cross_compiling; then :; else
+if ! cross_compiling; then
for i in 1 2 3 4; do
echo a | ./foo$i
echo b | ./foo$i && Exit 1
AM_YFLAGS = -d
foo_SOURCES = foo.y main.c
BUILT_SOURCES = foo.h
-.PHONY: debug-info test-time-unchanged test-time-changed
-debug-info:
- ls -l
- stat *.[ch] *.$(OBJEXT) my-timestamp || :
-test-time-unchanged: debug-info
- test `ls -1t main.$(OBJEXT) my-timestamp | sed 1q` = my-timestamp
-test-time-changed: debug-info
- test `ls -1t main.$(OBJEXT) my-timestamp | sed 1q` = main.$(OBJEXT)
+.PHONY: test-time-unchanged test-time-changed
+test-time-unchanged:
+ is_newest foo.y foo.h main.$(OBJEXT)
+test-time-changed:
+ is_newest main.$(OBJEXT) foo.y foo.h
END
cat > foo.y << 'END'
ls -l # For debugging.
$sleep
-: > my-timestamp
-$sleep
touch foo.y
$MAKE
$MAKE test-time-unchanged
END
cp bin/yacc bin/bison
chmod a+x bin/yacc bin/bison
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
YACC=yacc BISON=bison
export YACC BISON
touch parse.y parse2.y
$sleep
$MAKE parse.c parse2.c
-stat parse.c parse.y parse2.c parse2.y || : # For debugging.
-test `ls -t parse.c parse.y | sed 1q` = parse.c
-test `ls -t parse2.c parse2.y | sed 1q` = parse2.c
+is_newest parse.c parse.y
+is_newest parse2.c parse2.y
:
# Make sure foo/parse.h is not updated, unless when needed.
$sleep
-: > z
-$sleep
touch ../foo/parse.y
$MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = z
+is_newest ../foo/parse.y foo/parse.h
$sleep
sed 's/%%/%token TOKEN\n%%/g' ../foo/parse.y >../foo/parse.yt
mv -f ../foo/parse.yt ../foo/parse.y
$MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h
+is_newest foo/parse.h ../foo/parse.y
# Now, adds another parser to test ylwrap.
echo 'extern int dummy;' >> y.tab.c
END
chmod a+x bin/fake-yacc
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
YACC=fake-yacc; export YACC
cat > Makefile.am <<'END'