]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Merge branch 'master' into ng/master
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 22 Jun 2012 18:05:11 +0000 (20:05 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 22 Jun 2012 18:18:25 +0000 (20:18 +0200)
* master:
  tests: prefer using 'is_newest' over 'ls -t' hacks
  tests: implement is_newest as an auxiliary script, not shell function
  tests: fix some spurious failures in VPATH setup
  tests: work in VPATH setup again
  tests: automatic re-execution works for non-POSIX shells too
  tests: use more POSIX shell features our test scripts
  docs: avoid failures with development version of Texinfo (4.13.90)
  typofix: s/test derivers/test drivers/ in check.am comments
  typofix: s/env/even/ in comments in GNUmakefile

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
140 files changed:
1  2 
GNUmakefile
Makefile.am
lib/am/parallel-tests.am
syntax-checks.mk
t/README
t/autodist-subdir.sh
t/autodist.sh
t/ax/depcomp.sh
t/ax/tap-summary-aux.sh
t/ax/test-init.sh
t/built-sources-check.sh
t/ccnoco3.sh
t/check12.sh
t/check4.sh
t/color.sh
t/color2.sh
t/condman3.sh
t/cscope.tap
t/depend.sh
t/depend4.sh
t/dist-auxfile.sh
t/dist-formats.tap
t/dist-missing-am.sh
t/dist-missing-included-m4.sh
t/dist-missing-m4.sh
t/dist-repeated.sh
t/distcheck-missing-m4.sh
t/distcheck-outdated-m4.sh
t/distcheck-override-infodir.sh
t/distcheck-pr9579.sh
t/distdir.sh
t/distlinksbrk.sh
t/dollar.sh
t/empty-data-primary.sh
t/exeext.sh
t/exeext4.sh
t/gnits2.sh
t/gnits3.sh
t/hdr-vars-defined-once.sh
t/instdir-java.sh
t/instdir-lisp.sh
t/instdir-ltlib.sh
t/instdir-no-empty.sh
t/instdir-prog.sh
t/instdir-python.sh
t/instdir-texi.sh
t/instdir.sh
t/instdir2.sh
t/insthook.sh
t/instmany-mans.sh
t/instmany-python.sh
t/instmany.sh
t/instspc.tap
t/java-compile-install.sh
t/java-compile-run-flat.sh
t/java-compile-run-nested.sh
t/java-nobase.sh
t/lex-depend-cxx.sh
t/lex-depend.sh
t/lex-lib-external.sh
t/lex-noyywrap.sh
t/lex3.sh
t/libtool7.sh
t/lisp3.sh
t/lisp8.sh
t/longline.sh
t/make-dryrun.tap
t/makej2.sh
t/maken.sh
t/mkinst3.sh
t/mmodely.sh
t/multlib.sh
t/nobase-python.sh
t/parallel-tests-exit-statuses.sh
t/parallel-tests-log-compiler-1.sh
t/parallel-tests-many.sh
t/parallel-tests.sh
t/parallel-tests2.sh
t/parallel-tests3.sh
t/phony.sh
t/pluseq5.sh
t/posixsubst-libraries.sh
t/posixsubst-ltlibraries.sh
t/pr87.sh
t/primary-prefix-couples-force-valid.sh
t/python-virtualenv.sh
t/remake-subdir-long-time.sh
t/remake9a.sh
t/remake9b.sh
t/remake9c.sh
t/remake9d.sh
t/self-check-dir.tap
t/silent-many-gcc.sh
t/silent-many-generic.sh
t/specflg6.sh
t/subobj-clean-lt-pr10697.sh
t/subobj-clean-pr10697.sh
t/subobj9.sh
t/suffix2.sh
t/tap-bailout-suppress-later-errors.sh
t/tap-basic.sh
t/tap-diagnostic-custom.sh
t/tap-diagnostic.sh
t/tap-global-log.sh
t/tap-global-result.sh
t/tap-log.sh
t/tap-more.sh
t/tap-out-of-order.sh
t/tap-plan-malformed.sh
t/tap-plan-middle.sh
t/tap-planskip-case-insensitive.sh
t/tap-planskip-late.sh
t/tap-planskip.sh
t/tap-signal.tap
t/tap-unplanned.sh
t/test-driver-create-log-dir.sh
t/test-driver-custom-multitest.sh
t/test-driver-custom-xfail-tests.sh
t/test-driver-custom.sh
t/test-driver-is-distributed.sh
t/test-driver-strip-vpath.sh
t/test-log.sh
t/test-metadata-global-result.sh
t/test-metadata-recheck.sh
t/test-trs-basic.sh
t/transform3.sh
t/txinfo21.sh
t/uninstall-fail.sh
t/vala-mix.sh
t/vala-vapi.sh
t/vala5.sh
t/vtexi3.sh
t/vtexi4.sh
t/warnings-win-over-strictness.sh
t/warnopts.sh
t/yacc-basic.sh
t/yacc-cxx.sh
t/yacc-depend2.sh
t/yacc-dist-nobuild.sh
t/yacc8.sh

diff --cc GNUmakefile
Simple merge
diff --cc Makefile.am
index 59aa1f60a3f88877b9de3710ae2cabfe2dddd2c3,872714e6d47f343b25090e27cd112771d9d0f3bc..a986f3b62225880bcc6f3eac225b3c1b1fe443f0
@@@ -296,67 -322,9 +296,67 @@@ TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(
  
  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.
 +# All tests, both hand-written and autogenerated.
 +# IMPORTANT: This assumes that the autogenerated tests are placed
 +#            in the $(srcdir) as well!
 +all_TESTS = \
 +  $(wildcard $(srcdir)/t/*.sh) \
 +  $(wildcard $(srcdir)/t/*.tap) \
 +  $(wildcard $(srcdir)/t/pm/*.pl) \
 +  $(wildcard $(srcdir)/t/perf/*.sh)
 +
 +# This is to ensure longer-running tests will be run earlier, which is
 +# useful when running the testsuite in parallel on multicore machines.
 +# Here too we assume that the autogenerated tests are placed in $(srcdir).
 +long_running_TESTS = \
 +  $(srcdir)/t/add-missing.tap \
 +  $(srcdir)/t/instspc.tap \
 +  $(wildcard $(srcdir)/t/depcomp-*.tap) \
 +  $(wildcard $(srcdir)/t/*libtool*.sh) \
 +  $(wildcard $(srcdir)/t/lt*.sh) \
 +  $(wildcard $(srcdir)/t/remake*.sh)
 +
 +TESTS = \
 +  $(long_running_TESTS) \
 +  $(filter-out $(long_running_TESTS), $(all_TESTS))
 +
 +EXTRA_DIST += $(TESTS)
 +
 +# FIXME: this "expected failures" are in truth an hack used to
 +# FIXME: to verify that some incorrect usages of our perl libraries
 +# FIXME: raise an error.  We should find a cleaner way to check that.
 +perl_fake_XFAIL_TESTS = \
 +  t/pm/Cond2.pl \
 +  t/pm/Cond3.pl \
 +  t/pm/DisjCon2.pl \
 +  t/pm/DisjCon3.pl \
 +  t/pm/Version2.pl \
 +  t/pm/Version3.pl
 +
 +XFAIL_TESTS = \
 +  t/all.sh \
 +  t/override-suggest-local.sh \
 +  t/yacc-bison-skeleton-cxx.sh \
 +  t/yacc-bison-skeleton.sh \
 +  t/comments-in-var-def.sh \
 +  t/cond17.sh \
 +  t/dist-srcdir2.sh \
 +  t/gcj6.sh \
 +  t/override-conditional-2.sh \
 +  t/dist-pr109765.sh \
 +  t/instdir-cond2.sh \
 +  t/interp3.sh \
 +  t/java-nobase.sh \
 +  t/objext-pr10128.sh \
 +  t/parallel-tests-many.sh \
 +  t/pr8365-remake-timing.sh \
 +  t/remake-am-pr10111.sh \
 +  t/remake-m4-pr10111.sh \
 +  t/txinfo5.sh \
 +  t/var-undef-append.sh \
 +  $(perl_fake_XFAIL_TESTS)
  
  # Some testsuite-influential variables should be overridable from the
  # test scripts, but not from the environment.
index 8f4c0f96c129f8447224d8079aa890a30d432654,0000000000000000000000000000000000000000..d945d0bdabcfc32aedda2048f287be52a0b2343e
mode 100644,000000..100644
--- /dev/null
@@@ -1,416 -1,0 +1,416 @@@
- ## of more test metadata, and the use of custom test derivers and protocols
 +## automake - create Makefile.in from Makefile.am
 +## Copyright (C) 2001-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/>.
 +
 +include color-tests.am
 +
 +## New parallel test driver.
 +##
 +## The first version of the code here was adapted from check.mk, which was
 +## 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 drivers and protocols
 +## (among them, TAP).
 +
 +## Used by (at least) 'check-typos.am'.
 +am__using_parallel_tests := yes
 +
 +am__is_xfail_test = \
 +  $(if $(filter-out $(am__xfail_test_bases), \
 +                    $(patsubst $(srcdir)/%,%,$(1))),no,yes)
 +am__runtest = \
 +  $(am__sh_e_setup);                                                  \
 +  $(am__tty_colors);                                                  \
 +  srcdir=$(srcdir); export srcdir;                                    \
 +## Creates the directory for the log file if needed.  Avoid extra forks.
 +  test x$(@D) = x. || test -d $(@D) || $(MKDIR_P) $(@D) || exit $$?;  \
 +## We need to invoke the test in way that won't cause a PATH search.
 +## Quotes around '$<' are required to avoid extra errors when a circular
 +## dependency is detected (e.g., because $(TEST_SUITE_LOG) is in
 +## $(am__test_logs)), because in that case '$<' expands to empty and an
 +## unquote usage of it could cause syntax errors in the shell.
 +  case '$<' in */*) tst='$<';; *) tst=./'$<';; esac;                  \
 +## Executes the developer-defined and user-defined test
 +## setups (if any), in that order.
 +  $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT)                                \
 +  $($(1)LOG_DRIVER)                                                   \
 +  --test-name '$(patsubst $(srcdir)/%,%,$<)'                          \
 +  --log-file $*.log                                                   \
 +  --trs-file $*.trs                                                   \
 +  --color-tests "$$am__color_tests"                                   \
 +  --enable-hard-errors $(if $(DISABLE_HARD_ERRORS),no,yes)            \
 +  --expect-failure $(call am__is_xfail_test,$*)                               \
 +  $(AM_$(1)LOG_DRIVER_FLAGS)                                          \
 +  $($(1)LOG_DRIVER_FLAGS)                                             \
 +  --                                                                  \
 +  $($(1)LOG_COMPILER)                                                 \
 +  $(AM_$(1)LOG_FLAGS)                                                 \
 +  $($(1)LOG_FLAGS)                                                    \
 +  "$$tst"                                                             \
 +  $(AM_TESTS_FD_REDIRECT)
 +
 +## Turn e.g., ".test" in "_TEST", and return the empty string unchanged.
 +am__tpfx = \
 +  $(if $1,$(call am__toupper,$(patsubst .%,%_,$1)))
 +
 +!define am__handle_per_suffix_test
 +!
 +## FIXME: This will pick up the default from the environment; are we sure
 +## FIXME: we want that?
 +!$$(call am__tpfx,$1)LOG_DRIVER ?= $(SHELL) $(am__config_aux_dir)/test-driver
 +!
 +!%.log %.trs: %$1 $$($$(call am__tpfx,$1)LOG_DEPENDENCIES)
 +!     @$$(call am__runtest,$$(call am__tpfx,$1))
 +!
 +!ifeq ($(am__handle_exeext),yes)
 +!ifdef EXEEXT
 +!%.log %.trs: %$1$(EXEEXT) $$($$(call am__tpfx,$1)LOG_DEPENDENCIES)
 +!     @$$(call am__runtest,$$(call am__tpfx,$1))
 +!endif # defined EXEEXT
 +!endif # am__handle_exeext = yes
 +!
 +!endef # am__handle_per_suffix_test
 +!
 +## FIXME: this will pick up the default from the environment; are we sure
 +## FIXME: we want that?
 +!TEST_EXTENSIONS ?= .test
 +!$(foreach am__e,$(filter-out .%,$(TEST_EXTENSIONS)),\
 +!     $(call am__error,invalid test extension: '$(am__e)'))
 +!$(foreach am__e,$(TEST_EXTENSIONS), \
 +!  $(eval $(call am__handle_per_suffix_test,$(am__e))))
 +## It is *imperative* that the "empty" suffix goes last.  Otherwise, a
 +## declaration like "TESTS = all.test" would cause GNU make to mistakenly
 +## try to build the 'all.log' and 'all.trs' files from a non-existent
 +## 'all' program (because the Makefile contains an explicit 'all' target,
 +## albeit .PHONY), rather than from the 'all.test' script, thus causing
 +## all sort of mishaps and confusion.
 +!$(eval $(call am__handle_per_suffix_test))
 +
 +# The names of the given tests scripts with any possible registered
 +# test extension removed, as well as any leading '$(srcdir)' component
 +# (if any) stripped.
 +# The stripping of $(srcdir) is required to support explicit use of
 +# $(srcdir) in TESTS entries.  That might actually be very useful in
 +# practice, for example in usages like this:
 +#   TESTS = $(wildcard $(srcdir)/t[0-9][0-9]*.sh)
 +# where removing the $(srcdir) from the $(wildcard) invocation would
 +# cause the idiom to break in VPATH builds.
 +am__get_test_bases = $(patsubst $(srcdir)/%,%,$(strip \
 +$(call am__strip_suffixes, $(TEST_EXTENSIONS), \
 +?!HANDLE-EXEEXT?             $(1))))
 +?HANDLE-EXEEXT?              $(patsubst %$(EXEEXT),%,$(1)))))
 +
 +am__recheck_rx = ^[   ]*:recheck:[    ]*
 +am__global_test_result_rx = ^[        ]*:global-test-result:[         ]*
 +am__copy_in_global_log_rx = ^[        ]*:copy-in-global-log:[         ]*
 +
 +# A command that, given a newline-separated list of test names on the
 +# standard input, print the name of the tests that are to be re-run
 +# upon "make recheck".
 +am__list_recheck_tests = $(AWK) '{ \
 +## By default, we assume the test is to be re-run.
 +  recheck = 1; \
 +  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
 +    { \
 +      if (rc < 0) \
 +        { \
 +## If we've encountered an I/O error here, there are three possibilities:
 +##
 +##  [1] The '.log' file exists, but the '.trs' does not; in this case,
 +##      we "gracefully" recover by assuming the corresponding test is
 +##      to be re-run (which will re-create the missing '.trs' file).
 +##
 +##  [2] Both the '.log' and '.trs' files are missing; this means that
 +##      the corresponding test has not been run, and is thus *not* to
 +##      be re-run.
 +##
 +##  [3] We have encountered some corner-case problem (e.g., a '.log' or
 +##      '.trs' files somehow made unreadable, or issues with a bad NFS
 +##      connection, or whatever); we don't handle such corner cases.
 +##
 +          if ((getline line2 < ($$0 ".log")) < 0) \
 +          recheck = 0; \
 +          break; \
 +        } \
 +      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
 +## A directive explicitly specifying the test is *not* to be re-run.
 +        { \
 +          recheck = 0; \
 +          break; \
 +        } \
 +      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
 +        { \
 +## A directive explicitly specifying the test *is* to be re-run.
 +          break; \
 +        } \
 +## else continue with the next iteration.
 +    }; \
 +  if (recheck) \
 +    print $$0; \
 +## Don't leak open file descriptors, as this could cause serious
 +## problems when there are many tests (yes, even on Linux).
 +  close ($$0 ".trs"); \
 +  close ($$0 ".log"); \
 +}'
 +
 +# A command that, given a newline-separated list of test names on the
 +# standard input, create the global log from their .trs and .log files.
 +am__create_global_log = $(AWK) ' \
 +## Don't leak open file descriptors, as this could cause serious
 +## problems when there are many tests (yes, even on Linux).
 +function close_current() \
 +{ \
 +  close ($$0 ".trs"); \
 +  close ($$0 ".log"); \
 +} \
 +function error(msg) \
 +{ \
 +  print msg | "cat >&2"; \
 +  exit_status = 1; \
 +} \
 +function input_error(file) \
 +{ \
 +  error("awk" ": cannot read \"" file "\""); \
 +  close_current(); \
 +} \
 +function rst_section(header) \
 +{ \
 +  print header; \
 +  len = length(header); \
 +  for (i = 1; i <= len; i = i + 1) \
 +    printf "="; \
 +  printf "\n\n"; \
 +} \
 +BEGIN { exit_status = 0; } \
 +{ \
 +## By default, we assume the test log is to be copied in the global log,
 +## and that its result is simply "RUN" (i.e., we still don't know what
 +## it outcome was, but we know that at least it has run).
 +  copy_in_global_log = 1; \
 +  global_test_result = "RUN"; \
 +  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
 +    { \
 +      if (rc < 0) \
 +        { \
 +          input_error($$0 ".trs"); \
 +          next; \
 +        } \
 +      if (line ~ /$(am__global_test_result_rx)/) \
 +        { \
 +          sub("$(am__global_test_result_rx)", "", line); \
 +          sub("[      ]*$$", "", line); \
 +          global_test_result = line; \
 +        } \
 +      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
 +        copy_in_global_log = 0; \
 +    }; \
 +  if (copy_in_global_log) \
 +    { \
 +      rst_section(global_test_result ": " $$0); \
 +      while ((rc = (getline line < ($$0 ".log"))) != 0) \
 +      { \
 +        if (rc < 0) \
 +          { \
 +            input_error($$0 ".log"); \
 +            next; \
 +          } \
 +        print line; \
 +      }; \
 +      printf "\n"; \
 +    }; \
 +  close_current(); \
 +} \
 +END { \
 +  if (exit_status != 0) \
 +    error("fatal: making $@: I/O error reading test results"); \
 +  exit(exit_status); \
 +}'
 +
 +# Restructured Text title.
 +am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
 +
 +# This supports runtime overriding of $(TESTS) and $(XFAIL_TESTS).
 +am__test_bases = \
 +  $(call am__memoize,am__test_bases,$(call am__get_test_bases,$(TESTS)))
 +am__xfail_test_bases = \
 +  $(call am__memoize,am__xfail_test_bases,$(call am__get_test_bases,$(XFAIL_TESTS)))
 +
 +# The $(strip) is to work around the GNU make 3.80 bug where trailing
 +# whitespace in "TESTS = foo.test $(empty)" causes $(TESTS_LOGS) to
 +# erroneously expand to "foo.log .log".
 +am__test_results = \
 +  $(call am__memoize,am__test_results,$(addsuffix .trs,$(strip $(am__test_bases))))
 +am__test_logs = \
 +  $(call am__memoize,am__test_logs,$(addsuffix .log,$(strip $(am__test_bases))))
 +
 +# $(TEST_LOGS) is a published interface.
 +TEST_LOGS = $(am__test_logs)
 +
 +$(TEST_SUITE_LOG): $(am__test_logs) $(am__test_results)
 +      @$(am__sh_e_setup); $(am__tty_colors); \
 +      fatal () { echo "fatal: making $@: $$*" >&2; exit 1; }; \
 +## Detect a possible circular dependency, and error out.
 +      case ' $(strip $(am__test_logs)) ' in *' $(TEST_SUITE_LOG) '*) \
 +        fatal "depends on itself (check TESTS content)";; \
 +      esac; \
 +      ws='[   ]'; \
 +      count_result () \
 +      { \
 +        r='$(strip $(am__test_results))'; \
 +        r=`grep "^$$ws*:test-result:$$ws*$${1-}" $$r </dev/null`; \
 +## Catch I/O errors, and complain accordingly.
 +        test $$? -le 1 || fatal "I/O error reading test results"; \
 +        case $$r in \
 +          "") echo 0;; \
 +          * ) printf '%s\n' "$$r" | wc -l;; \
 +        esac; \
 +      }; \
 +## Prepare data for the test suite summary.  These do not take into account
 +## unreadable test results, but they'll be appropriately updated later if
 +## needed.
 +      all=`count_result` \
 +        && pass=` count_result PASS` \
 +        && fail=` count_result FAIL` \
 +        && skip=` count_result SKIP` \
 +        && xfail=`count_result XFAIL` \
 +        && xpass=`count_result XPASS` \
 +        && error=`count_result ERROR` \
 +        || exit 1; \
 +## Whether the testsuite was successful or not.
 +      if test `expr $$fail + $$xpass + $$error` -eq 0; then \
 +        success=true; \
 +      else \
 +        success=false; \
 +      fi; \
 +## Make $br a line of exactly 76 '=' characters, that will be used to
 +## enclose the testsuite summary report when displayed on the console.
 +      br='==================='; br=$$br$$br$$br$$br; \
 +## When writing the test summary to the console, we want to color a line
 +## reporting the count of some result *only* if at least one test
 +## experienced such a result.  This function is handy in this regard.
 +      display_result_count () \
 +      { \
 +          if test x"$$1" = x"--maybe-color"; then \
 +            maybe_colorize=yes; \
 +          elif test x"$$1" = x"--no-color"; then \
 +            maybe_colorize=no; \
 +          else \
 +            echo "$@: invalid 'display_result_count' usage" >&2; \
 +            exit 4; \
 +          fi; \
 +          shift; \
 +          desc=$$1 count=$$2; \
 +          if test $$maybe_colorize = yes && test $$count -gt 0; then \
 +            color_start=$$3 color_end=$$std; \
 +          else \
 +            color_start= color_end=; \
 +          fi; \
 +          echo "$${color_start}# $$desc $$count$${color_end}"; \
 +      }; \
 +## A shell function that creates the testsuite summary.  We need it
 +## because we have to create *two* summaries, one for test-suite.log,
 +## and a possibly-colorized one for console output.
 +      create_testsuite_report () \
 +      { \
 +        opts=$$*; \
 +        display_result_count $$opts "TOTAL:" $$all   "$$brg"; \
 +        display_result_count $$opts "PASS: " $$pass  "$$grn"; \
 +        display_result_count $$opts "SKIP: " $$skip  "$$blu"; \
 +        display_result_count $$opts "XFAIL:" $$xfail "$$lgn"; \
 +        display_result_count $$opts "FAIL: " $$fail  "$$red"; \
 +        display_result_count $$opts "XPASS:" $$xpass "$$red"; \
 +        display_result_count $$opts "ERROR:" $$error "$$mgn"; \
 +      }; \
 +## Write "global" testsuite log.
 +      if {                                                            \
 +        st=0;                                                         \
 +        echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" |       \
 +          $(am__rst_title);                                           \
 +        create_testsuite_report --no-color;                           \
 +        echo;                                                         \
 +        echo ".. contents:: :depth: 2";                               \
 +        echo;                                                         \
 +        bases='$(am__test_bases)';                                    \
 +        for b in $$bases; do echo $$b; done                           \
 +          | $(am__create_global_log);                                 \
 +      } >$(TEST_SUITE_LOG).tmp; then                                  \
 +        mv -f $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                \
 +      else                                                            \
 +## The awk program in $(am__create_global_log) should have already emitted
 +## a proper error message about I/O error, no need to repeat it.
 +        rm -f $(TEST_SUITE_LOG).tmp; exit 1;                          \
 +      fi;                                                             \
 +## Emit the test summary on the console.
 +      if $$success; then                                              \
 +        col="$$grn";                                                  \
 +       else                                                           \
 +        col="$$red";                                                  \
 +        test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
 +      fi;                                                             \
 +## Multi line coloring is problematic with "less -R", so we really need
 +## to color each line individually.
 +      echo "$${col}$$br$${std}";                                      \
 +      echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
 +      echo "$${col}$$br$${std}";                                      \
 +## This is expected to go to the console, so it might have to be colorized.
 +      create_testsuite_report --maybe-color;                          \
 +      echo "$$col$$br$$std";                                          \
 +      if $$success; then :; else                                      \
 +        echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}";         \
 +        if test -n "$(PACKAGE_BUGREPORT)"; then                       \
 +          echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \
 +        fi;                                                           \
 +        echo "$$col$$br$$std";                                        \
 +      fi;                                                             \
 +      $$success || exit 1
 +
 +## ------------------------------------------ ##
 +## Running all tests, or rechecking failures. ##
 +## ------------------------------------------ ##
 +
 +am__remove_if_not_lazy_check = \
 +## Expand the given list only once, to avoid exceeding line length limits.
 +  $(if $(filter yes,$(AM_LAZY_CHECK)),, \
 +       list='$(strip $(1))'; test -z "$$list" || rm -f $$list)
 +
 +check-TESTS:
 +      @$(call am__remove_if_not_lazy_check,$(am__test_results))
 +      @$(call am__remove_if_not_lazy_check,$(am__test_logs))
 +## We always have to remove TEST_SUITE_LOG, to ensure its rule is run
 +## in any case even in lazy mode: otherwise, if no test needs rerunning,
 +## or a prior run plus reruns all happen within the same timestamp (can
 +## happen with a prior "make TESTS=<subset>"), then we get no log output.
 +## OTOH, this means that, in the rule for '$(TEST_SUITE_LOG)', we
 +## cannot use '$?' to compute the set of lazily rerun tests, lest
 +## we rely on .PHONY to work portably.
 +      @rm -f $(TEST_SUITE_LOG)
 +      $(MAKE) $(TEST_SUITE_LOG)
 +.PHONY: check-TESTS
 +
 +## Recheck must depend on $(check_SCRIPTS), $(check_PROGRAMS), etc.
 +## It must also depend on the 'all' target.  See automake bug#11252.
 +recheck: all %CHECK_DEPS%
 +      @bases='$(am__test_bases)'; \
 +## If running a "make recheck", we must only consider tests that had an
 +## unexpected outcome (FAIL or XPASS) in the earlier run.
 +      bases=`for i in $$bases; do echo $$i; done \
 +               | $(am__list_recheck_tests)` || exit 1; \
 +## Remove newlines and normalize whitespace.
 +      bases=`echo $$bases`; \
 +      $(MAKE) check-TESTS am__test_bases="$$bases"
 +.PHONY: recheck
 +
 +AM_RECURSIVE_TARGETS += check recheck
index 27b91a9a33f116b3c2e99f11032168026db3c854,d9302dab71ee2f041380706299d47c5b2eea72fe..8f3c4b77292f304c1885295a751573bbf20ca56b
@@@ -31,10 -31,9 +31,10 @@@ xtests := $(shell 
       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)
 +pms := $(dist_perllib_DATA)
  
  # Some simple checks, and then ordinary check.  These are only really
  # guaranteed to work on my machine.
@@@ -73,10 -61,14 +73,11 @@@ sc_tests_here_document_format 
  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 \
  sc_tests_logs_duplicate_prefixes \
 -sc_tests_makefile_variable_order \
  sc_perl_at_substs \
  sc_unquoted_DESTDIR \
  sc_tabs_in_texi \
@@@ -484,6 -325,58 +485,16 @@@ sc_tests_required_after_defs
          fi; \
        done
  
 -## Overriding a Makefile macro on the command line is not portable when
 -## recursive targets are used.  Better use an envvar.  SHELL is an
 -## exception, POSIX says it can't come from the environment.  V, DESTDIR,
 -## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
 -## as package authors are urged not to initialize them anywhere.
 -## Finally, 'exp' is used by some ad-hoc checks, where we ensure it's
 -## ok to override it from the command line.
 -sc_tests_overriding_macros_on_cmdline:
 -      @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
 -        echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
 -        echo ' in the above lines, it is more portable.' 1>&2; \
 -        exit 1; \
 -      fi
 -# The first s/// tries to account for usages like "$MAKE || st=$?".
 -# 'DISTCHECK_CONFIGURE_FLAGS' and 'exp' are allowed to contain whitespace in
 -# their definitions, hence the more complex last three substitutions below.
 -# Also, the 'make-dryrun.sh' is whitelisted, since there we need to
 -# override variables from the command line in order to cover the expected
 -# code paths.
 -      @tests=`for t in $(xtests); do \
 -                case $$t in */make-dryrun.sh);; *) echo $$t;; esac; \
 -              done`; \
 -      if sed -e 's/ || .*//' -e 's/ && .*//' \
 -              -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
 -              -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
 -              -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
 -              -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
 -              -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
 -              -e "s/ exp='[^']*'/ /" \
 -              -e 's/ exp="[^"]*"/ /' \
 -              -e 's/ exp=[^ ]/ /' \
 -            $$tests | grep '\$$MAKE .*='; then \
 -        echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
 -        echo 'it is more portable.' 1>&2; \
 -        exit 1; \
 -      fi
 -      @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
 -        echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
 -        echo 'the above lines.' 1>&2; \
 -        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.
diff --cc t/README
index ed39765a9805695b05b5dd1e84014ad2f9f64ec1,57cab89d4f5a5085a3dd51bed3227749ec5a5441..1d630c0a4a3e5f2a2eca90624f05e9505f9aa370
+++ b/t/README
  Do not
  ------
  
 -  
+   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'.
++
+   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
+   years we'll discover that this test failed for some other bogus reason.
+   This happened many times.  Better use something like
++
 +  Do not test an Automake-NG 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.:
 -    $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
 +
 +  (Note this doesn't prevent the test from failing for another
 +  reason, but at least it makes sure the original error is still
 +  here.)
Simple merge
diff --cc t/autodist.sh
Simple merge
diff --cc t/ax/depcomp.sh
Simple merge
Simple merge
index 0000000000000000000000000000000000000000,9d196214d8f09528e52bc76e060d8e554c2aaf73..d19d352c9fcd1b9e1ec886aafd89734fb16bfe90
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,1029 +1,905 @@@
 -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.
+ # -*- 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
+   # 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. ##
+ ## --------------------- ##
+ # 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='
+ '
+ # 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.
 -# Also unset variables that will let "make -e install" divert
 -# files into unwanted directories.
++unset MFLAGS MAKEFLAGS MAKELEVEL
+ # Unset verbosity flag.
+ unset V
 -unset RECHECK_LOGS
++# Also unset variables that might let "make 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 AM_LAZY_CHECK
+ unset TESTS
+ unset XFAIL_TESTS
+ unset TEST_LOGS
+ unset TEST_SUITE_LOG
 -# 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+"$@"}; }
 -
+ 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
+ }
 -    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_
 -      ;;
+ # 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"
+       ;;
+     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"
+       ;;
+     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
Simple merge
diff --cc t/ccnoco3.sh
Simple merge
diff --cc t/check12.sh
Simple merge
diff --cc t/check4.sh
Simple merge
diff --cc t/color.sh
Simple merge
diff --cc t/color2.sh
Simple merge
diff --cc t/condman3.sh
Simple merge
diff --cc t/cscope.tap
Simple merge
diff --cc t/depend.sh
index 2105e3317a7a97ebc44bdc68abf44c7df00e651f,b69427dd6e2745366627960068e85fbe2b44c01d..23359ca5168240d99b0b1cb95a85252ad8cdb843
@@@ -31,6 -31,6 +31,6 @@@ EN
  $ACLOCAL
  $AUTOMAKE
  
- test 1 = `grep '^@AMDEP_TRUE@-include ' Makefile.in | wc -l`
 -test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
++test 1 -eq $(grep -c '^@AMDEP_TRUE@-include' Makefile.in)
  
  :
diff --cc t/depend4.sh
index 136ff32de8b71f8e29d092604468ad441d8efdd5,e3ace0bbceb73fb2c57ac7eaf37f62202b4ded5a..560648dded6e50819d25429aa3eb4d017077266e
@@@ -30,7 -30,7 +30,7 @@@ for header in one.h two.h three.h four.
      fred_SOURCES = fred1.c $headers
  END
    $AUTOMAKE
-   test 1 = `grep '^@AMDEP_TRUE@-include ' Makefile.in | wc -l`
 -  test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
++  test 1 -eq $(grep -c '^@AMDEP_TRUE@-include' Makefile.in)
  done
  
  :
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 71543c9b24750451c689002234c30ef377d44a43,4aaf268c872d920b6654eb1e725adce5d1c946f4..e3bff09151efa5c9f85981291701f141d9630103
@@@ -55,7 -55,7 +55,7 @@@ $AUTOCON
  $MAKE
  
  $MAKE distcheck
- $MAKE distcheck infodir="`pwd`"/_info
 -infodir="$(pwd)/_info" $MAKE -e distcheck
++$MAKE distcheck infodir="$(pwd)"/_info
  test -f _info/dir || Exit 99 # Sanity check.
  
  :
Simple merge
diff --cc t/distdir.sh
Simple merge
Simple merge
diff --cc t/dollar.sh
Simple merge
Simple merge
diff --cc t/exeext.sh
Simple merge
diff --cc t/exeext4.sh
Simple merge
diff --cc t/gnits2.sh
index 5bb3fbe3e10bab080d8e0acc456e8cf1c7717455,6bc9146095d0637f1ad0a964eb21a4a7c44af0e4..e27a87e710eaca33093462e9c304c3bb6472fea5
@@@ -104,10 -104,10 +104,10 @@@ mkdir buil
  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.
 +$MAKE -k installcheck 2>stderr && { cat stderr >&2; Exit 1; }
  cat stderr >&2
  $MAKE grep-stderr
  
diff --cc t/gnits3.sh
Simple merge
index abd1c563b84263c48485940c20f0af6223bb722e,de868a841d660e300f8df09b65f32eda2fd1167f..58aca5a88f4b0ffda93426269c0dda538af090eb
@@@ -31,11 -31,10 +31,10 @@@ EN
  
  $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 =.*\\$/ {
 +sed -n -e '/^am__dist_common =.*\\$/ {
     :loop
     p
     n
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc t/instdir.sh
Simple merge
diff --cc t/instdir2.sh
Simple merge
diff --cc t/insthook.sh
index 04a5ff9cde2b3a12cad73e4f8de02fa1ebcb594a,7fe0278c3ace2f2708706a177f3334a0e7e38efc..6c18d2448de3d54d9737299450e034b2fe2cff2c
@@@ -56,10 -56,10 +56,10 @@@ test -f o
  # 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
 +$MAKE install VERSION=2.0
  grep 1 bin/foo-1.0
  grep 2 bin/foo-2.0
  grep 2 bin/foo
index 8d1b5d3ea73935b5673a44032e5c64646c80ecbe,682fc1da7eadd723d50ff048c29c3c29c417911d..b9e250a8f80c09a622aa9359302d92798c3659b7
@@@ -110,11 -110,11 +110,11 @@@ $MAKE instal
  # 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
 +$MAKE install INSTALL='$(SHELL) $(top_builddir)/myinstall'
- 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
index 794eacdfcf49a0ecb4ead7bd32d258d50544322b,d6dd1189510075346757c71e57593d2007b397aa..458e62bed5cb288dc1d29fdf93494a325d81dcb8
@@@ -101,11 -101,11 +101,11 @@@ $MAKE instal
  # 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
 +$MAKE install INSTALL='$(SHELL) $(top_builddir)/myinstall'
- 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
diff --cc t/instmany.sh
index 668128c63d4a11bc8680f504f1d6ff2e68ab5677,7721f7df76eb9cf604b4d97b16d18009b3d2f51c..b911492bfb658b86525bd9e5cd64169a6918ab75
@@@ -124,11 -124,11 +124,11 @@@ $MAKE instal
  # 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
 +$MAKE install INSTALL='$(SHELL) $(top_builddir)/myinstall'
- 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
diff --cc t/instspc.tap
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 183a7fb78b60cad6d52dd5a5785f7ab3396ac91d,ec592f7c6237aecafc9ce4b59f0695060f1c27fb..c713d2e91058516a398bb3e6a5688b07655e4258
@@@ -83,10 -82,9 +82,9 @@@ $AUTOCON
  # using slow dependency extractors.
  ./configure --enable-dependency-tracking
  
 -$MAKE test-deps-exist
  $MAKE
 +$MAKE test-deps-exist
  
- : > older
  $sleep
  touch my-hdr.hxx
  $MAKE test-obj-updated
diff --cc t/lex-depend.sh
index a2897edffcef30ff53a973d4523aa807a09f5aae,be7da7fef894422b1270c30d1f923d13c4e8e181..653ae8da0ae0452cf76e39c7dea754d10cb0cbf6
@@@ -78,12 -77,17 +77,17 @@@ $AUTOCON
  # using slow dependency extractors.
  ./configure --enable-dependency-tracking
  
 -$MAKE test-deps-exist
  $MAKE
 +$MAKE test-deps-exist
+ 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
  
  :
Simple merge
Simple merge
diff --cc t/lex3.sh
Simple merge
diff --cc t/libtool7.sh
Simple merge
diff --cc t/lisp3.sh
Simple merge
diff --cc t/lisp8.sh
Simple merge
diff --cc t/longline.sh
index 4900da42c74678e694b3fad926dd7690d127cd29,0c7e09e820b428de6e84cbfb587dddb162d433cf..e246e3008d12999bc18fb069711586dce9c7ae5a
@@@ -30,8 -27,6 +30,8 @@@ done > 
  
  $ACLOCAL
  $AUTOMAKE
- test 80 -ge `grep DUMMY Makefile.in | wc -c`
- test 80 -ge `grep ZARDOZ Makefile.in | wc -c`
 +grep long_variable Makefile.in # For debugging.
+ test 80 -ge $(grep DUMMY Makefile.in | wc -c)
++test 80 -ge $(grep ZARDOZ Makefile.in | wc -c)
  
  :
index 90a2b8ca590ff44a6f2ba471f8283ce1856dd7b9,8e25d88f874d2504cf2f822736526f00ce692ccb..8dec8621385304491eb76260daec75b04c7362dd
@@@ -66,12 -72,21 +66,12 @@@ check_no_dryrun MYFLAGS="-n --dryrun -
  
  check_dryrun ()
  {
 -  r=ok directive=
 -  case $1 in
 -    -C) condition=$2 reason=$3; shift; shift; shift;;
 -     *) condition=: reason=;;
 -  esac
 -  if $condition; then
 -    $MAKE dry ${1+"$@"}   || r='not ok'
 -    test -f from-dry-mode || r='not ok'
 -    rm -f from-dry-mode   || fatal_ "cleaning up"
 -  else
 -    directive=SKIP
 -  fi
 -  result_ "$r" -D "$directive" -r "$reason" "not dry-run ($cnt)"
 -  unset r directive reason
 +  r=ok
 +  $MAKE dry ${1+"$@"}   || r='not ok'
 +  test -f from-dry-mode || r='not ok'
 +  rm -f from-dry-mode   || fatal_ "cleaning up"
 +  result_ "$r" "not dry-run ($cnt)"
-   cnt=`expr $cnt + 1`
+   cnt=$(($cnt + 1))
  }
  cnt=1
  
diff --cc t/makej2.sh
index 3e89df6340c0fcdf1e3a6332142b10b2d687c903,2e5d55b94c7dab45c61a7ed597453a609843ee68..317d3ff7c097280605af1f1312b3e61ea6344ec2
@@@ -37,8 -35,9 +37,8 @@@ $AUTOMAK
  
  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
  
diff --cc t/maken.sh
index 5ff5b85d09c031d0061ebc5835f890025cc95f47,1257e4a7f31e71b09fc54cc7cd27584b6c6786e4..ffd5ef0df492a61376f03f5d004835a7daec75b0
@@@ -52,9 -51,12 +51,10 @@@ echo stamp > stampfil
  $sleep
  for target in dist distcheck; do
    $MAKE -n $target
 -  if using_gmake; then
 -    $MAKE -n $target | grep stamp-sub-dist-hook || Exit 1
 -  fi
 +  $MAKE -n $target | grep stamp-sub-dist-hook
    $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
+ :
diff --cc t/mkinst3.sh
index 79485349a9adf84a777af726d4ff091b09372bc5,08cfb76e8558a814d808aae29e3dce4ac7a9a365..79a8dd5d020b4b6aca16c1e15a6dcb7e4b148fe8
@@@ -49,19 -51,18 +51,18 @@@ exec mkdir "$@
  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 without mkdir -p.
  
 -./mkinstalldirs '~a b/-x  y'
 +./install-sh -d '~a b/-x  y'
  test -d '~a b/-x  y'
  rm -rf '~a b'
  
- ./install-sh -d "`pwd`///~a b//-x  y"
- test -d "`pwd`/~a b/-x  y"
 -./mkinstalldirs "$cwd///~a b//-x  y"
++./install-sh -d "$cwd///~a b//-x  y"
+ test -d "$cwd/~a b/-x  y"
  rm -rf '~a b'
  
  :
diff --cc t/mmodely.sh
index a628419ae1531b1365ef04112c21d0d94cec7467,25139aa889682197ca6392c8bd1d326d047a6791..2cf1be01156d9f5b2f6b366099e8dde6664926e2
@@@ -87,9 -87,9 +87,9 @@@ PATH=$(pwd)$PATH_SEPARATOR$PATH; expor
  # per GNU Standard.
  $MAKE maintainer-clean
  ./configure
 -YACC="myyacc.sh" LEX="mylex.sh" \
 -   LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
 +$MAKE zardoz.c joe.c YACC="myyacc.sh" LEX="mylex.sh" \
 +                     LEX_OUTPUT_ROOT='lex.yy'
grep zardoz.y zardoz.c
grep joe.l joe.c
$FGREP zardoz.y zardoz.c
$FGREP joe.l joe.c
  
  :
diff --cc t/multlib.sh
Simple merge
Simple merge
Simple merge
Simple merge
index 5f73dba56130f0214368a940f959722f4ff4795c,b2c1f7626f53b5c0129f8e9d56c472ae7aa281ba..b8725916840d55ff7719bae6a5b081a00f51bb3a
@@@ -165,9 -166,9 +166,9 @@@ test $(cat <lst | wc -l) -eq $coun
  # 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
 +    $MAKE check TEST_LOG_COMPILER=false > 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
  
Simple merge
Simple merge
Simple merge
diff --cc t/phony.sh
index 5382470506423eb22745b58a11c53375df0cb158,7ee11163c6388a72c27775c5f891a1bbd11c39cb..ce4d5f8bbbc09992b1fab2e7f3adbdbf8909d1aa
@@@ -26,4 -26,6 +26,6 @@@ EO
  
  $ACLOCAL
  $AUTOMAKE
- test `$FGREP .PHONY: Makefile.in | wc -l` -gt 3
 -test $($FGREP -c '.PHONY:' Makefile.in) -eq 3
++test $($FGREP -c '.PHONY:' Makefile.in) -gt 3
+ :
diff --cc t/pluseq5.sh
index 83223ffc1964676aaf8b02ff5af3097a0e6f8754,b8b18a5bd04232490e3b942be58bd05be438ef50..b64343efba9cd44836521b5691a2704509985a06
@@@ -43,6 -43,18 +43,6 @@@ AUTOMAKE_fail
  # 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.
 -grep AM_CPPFLAGS stderr
 -
 -# A way to suppress the obsolete warning is to use
 -# -Wno-obsolete:
 -echo 'AUTOMAKE_OPTIONS = -Wno-obsolete' >> Makefile.am
 -AUTOMAKE_fails
 -grep AM_CPPFLAGS stderr && Exit 1
 -# !CHECK should still be mentioned.
 -grep ':.*!CHECK$' stderr
 -
  :
Simple merge
Simple merge
diff --cc t/pr87.sh
Simple merge
Simple merge
Simple merge
diff --cc t/remake9a.sh
index 983e8e0deba4526e41a7dd3cc9c2e997062792eb,2f4349a1a722c8d75a452597667d49ab726e1f18..f9a2b836770012de9ce00499953091f906314374
@@@ -71,10 -77,10 +71,10 @@@ for vpath in : false; d
    $sleep
    sed "s/^\\(FINGERPRINT\\)=.*/\\1=$magic1/" $srcdir/configure.ac >t
    mv -f t $srcdir/configure.ac
 -  remake_
 +  $MAKE nil
    $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'/"' \
diff --cc t/remake9b.sh
index c41da2009970397114d4930f53fdffae2a715f1e,4e0bfdcf3f11a9930d629aac95f97bb6af1ee4da..901ebe2c62bc6ebe5abb1d4e9a01a9c38fed7b8b
@@@ -73,10 -79,10 +73,10 @@@ for vpath in : false; d
    $sleep
    sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = $magic1/" $srcdir/Makefile.am >t
    mv -f t $srcdir/Makefile.am
 -  remake_
 +  $MAKE nil
    $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'/"' \
diff --cc t/remake9c.sh
index 5d0b0b2f45de2324483595c08201c2bd8dfa72cf,5ed7893e7f590be271b302dba1dfc0649b92a882..7ef7ca10d9f42a352843c8dcc8a9599b5f8ab3d9
@@@ -75,10 -81,10 +75,10 @@@ for vpath in : false; d
  
    $sleep
    echo "AC_DEFUN([my_fingerprint], [$magic1])" > $srcdir/acinclude.m4
 -  remake_
 +  $MAKE nil
    $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])'" \
diff --cc t/remake9d.sh
index 67b1ff7ee5ea89a19173ff0307ddcc6aa807d553,5f4892bbaa36eb722ac02c8a788c6019813aed78..9a4e77796bc5a54d2486d2a6059dfc25b7cc98fc
@@@ -75,10 -81,10 +75,10 @@@ for vpath in : false; d
  
    $sleep
    echo "AC_DEFUN([my_fingerprint], [$magic1])dnl %%%" >> $srcdir/aclocal.m4
 -  remake_
 +  $MAKE nil
    $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])/'" \
index ede9b191efe71beed66b7c2210a80b033150ffea,6a0fbd3c398e7118a2ea47c7357338ed1727f3fa..7e09fc79b949e7ffa9ded883a062502ee4dfe653
@@@ -69,7 -69,7 +69,7 @@@ do_check 'do not create nor chdir in te
           'test ! -d t/_self.dir || Exit 1
            test ! -f t/_self.dir || Exit 1
            test ! -r t/_self.dir || Exit 1
 -          grep "self-check-dir\.tap" Makefile || Exit 1
 +          grep "compare-autodiffs" Makefile || Exit 1
-           case `pwd` in '"$cwd"') : ;; *) Exit 1;; esac'
+           case $(pwd) in '"$cwd"') : ;; *) Exit 1;; esac'
  
  :
index eb00ceb2d2ed45d73fd21715f801decb565aab84,f746dc1428c16a142bb30c465da4b79ca41247f7..1560bc21d8b8f90c19490d66914e45b28c51be87
@@@ -42,20 -42,27 +42,20 @@@ do_and_check_silent_build (
    $EGREP ' (-c|-o)' stdout && Exit 1
    $EGREP '(mv|ylwrap) ' stdout && Exit 1
  
 +  grep ' CC .*bar\.'  stdout
    grep 'CXX .*foo1\.' stdout
 -  grep 'CXX .*baz1\.' stdout
 -  grep 'FC .*foo2\.'  stdout
 -  grep 'FC .*baz2\.'  stdout
 +  grep ' FC .*foo2\.' stdout
    grep 'F77 .*foo3\.' stdout
 -  grep 'F77 .*baz3\.' stdout
    grep ' CC .*foo5\.' stdout
 -  grep ' CC .*baz5\.' stdout
    grep ' CC .*foo6\.' stdout
 -  grep ' CC .*baz6\.' stdout
  
    grep 'CXXLD .*foo' stdout
 -  grep 'CCLD .*bar'  stdout
 +  grep ' CCLD .*bar' stdout
    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
 -    grep 'LEX .*baz5\.'  stdout
    fi
  
    unset rebuild
index 732079448ee9320575de309ce99ca66b5520c356,1318d9894f352a567e9f25fd27a2c4a1c22bc8d0..05fd6111e52fa02c6085fb19c13c69509faa79e8
@@@ -43,20 -43,27 +43,20 @@@ do_and_check_silent_build (
    $EGREP ' (-c|-o)' stdout && Exit 1
    $EGREP '(mv|ylwrap) ' stdout && Exit 1
  
 +  grep ' CC .*bar\.'  stdout
    grep 'CXX .*foo1\.' stdout
 -  grep 'CXX .*baz1\.' stdout
 -  grep 'FC .*foo2\.'  stdout
 -  grep 'FC .*baz2\.'  stdout
 +  grep ' FC .*foo2\.' stdout
    grep 'F77 .*foo3\.' stdout
 -  grep 'F77 .*baz3\.' stdout
    grep ' CC .*foo5\.' stdout
 -  grep ' CC .*baz5\.' stdout
    grep ' CC .*foo6\.' stdout
 -  grep ' CC .*baz6\.' stdout
  
    grep 'CXXLD .*foo' stdout
 -  grep 'CCLD .*bar'  stdout
 +  grep ' CCLD .*bar' stdout
    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
 -    grep 'LEX .*baz5\.'  stdout
    fi
  
    unset rebuild
diff --cc t/specflg6.sh
index cc585e9ddb898b1de0558c8e0213d65a75456f10,5566ae31b998c136727b45e2d05835c83e50bc72..9d0d1edb011e1ab7dbd7620c6fbeb7a84d080159
@@@ -41,7 -41,7 +41,7 @@@ EN
  $ACLOCAL
  $AUTOMAKE
  
- uncondval=`$FGREP 'foo-foo.$(OBJEXT): foo.c' Makefile.in`
 -uncondval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
++uncondval=$($FGREP 'foo-foo.$(OBJEXT): foo.c' Makefile.in)
  
  cat >> Makefile.am << 'END'
  foo_SOURCES += $(BAR_SRCS)
@@@ -49,8 -49,8 +49,10 @@@ EN
  
  $AUTOMAKE
  
- condval=`$FGREP 'foo-foo.$(OBJEXT): foo.c' Makefile.in`
 -condval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
++condval=$($FGREP 'foo-foo.$(OBJEXT): foo.c' Makefile.in)
  
++test -n "$uncondval"
++test -n "$condval"
  test "x$uncondval" = "x$condval"
  
  :
Simple merge
Simple merge
diff --cc t/subobj9.sh
Simple merge
diff --cc t/suffix2.sh
index bca816988797c2aa9d43871446de29a7c8a41135,5bf24d3b18f4be7374c0dedbf7f8c8fccee9e8c9..aa23b719960fb4b412f8c8181b0d56222e9ccc25
@@@ -40,11 -41,14 +40,11 @@@ EN
  
  $ACLOCAL
  
 -$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
 -
 -$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
 +for o in -a -i; do
 +  $AUTOMAKE $o
 +  grep '%\.[lco$]' Makefile.in # For debugging.
-   test `grep -c '^%\.$(OBJEXT): %\.c$' Makefile.in` -eq 1
-   test `grep -c '^%\.lo: %\.c$' Makefile.in` -eq 1
++  test $(grep -c '^%\.$(OBJEXT): %\.c$' Makefile.in) -eq 1
++  test $(grep -c '^%\.lo: %\.c$' Makefile.in) -eq 1
 +done
  
  :
diff --cc t/tap-basic.sh
index 60f3592ffd21a03a48e63929d3b0cb4b8410eb20,2e12e6ec02483a7dd2f04b03ea8e7e12ce5a760d..ad67f6524989e1af03daba1f0237b4f2ff611a1a
@@@ -145,10 -138,10 +145,10 @@@ test -f test-suite.lo
  
  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
 +# Override TESTS from the command line, making it point to a test
  # (ok.test) that has to be generated at make time.
  
  rm -f *.log *.test
Simple merge
Simple merge
index 9aa11879efd9126b33471f3b10958b7295034854,493a5a46d51f8522d86e4fb9b6253f086c37d58a..9c19145190517046aed7f864e117a455364b885a
@@@ -102,7 -102,7 +102,7 @@@ cat > skipall.test << 'END
  END
  
  # We don't care about the exit status of "make check" here.
- $MAKE TESTS="`echo *.test`" check || :
 -TESTS="$(echo *.test)" $MAKE -e check || :
++$MAKE TESTS="$(echo *.test)" check || :
  cat test-suite.log
  
  grep ':.*ok|not seen' test-suite.log && Exit 1
index 6f3ad04be1b1a4c152ea6d2aeed7dbcd8ce74ae5,6d7a4dd270ba72ce885e48227b55c1749e850be4..e5ca64b560fbd45ac94fb736ab5e5ccf41006b1d
@@@ -138,9 -138,9 +138,9 @@@ ok 4 # TOD
  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; }
 +$MAKE TESTS="$tests" check >stdout && { cat stdout; Exit 1; }
  cat stdout
  
  # Dirty trick required here.
diff --cc t/tap-log.sh
Simple merge
diff --cc t/tap-more.sh
Simple merge
Simple merge
index 11173473cc55ea20a38e3da06bad7cd3f7e6db73,99fd8c583db506895a7e46ddf5fc26d197ce98f7..274b07c858d19a85f35ee7f3c307fb0ae5826f38
@@@ -45,9 -45,9 +45,9 @@@ cat > e.test <<EN
  0..0
  END
  
- tests_list=`echo *.test`
+ tests_list=$(echo *.test)
  
 -TESTS="$tests_list" $MAKE -e check >stdout && { cat stdout; Exit 1; }
 +$MAKE TESTS="$tests_list" check >stdout && { cat stdout; Exit 1; }
  cat stdout
  
  count_test_results total=9 pass=2 fail=0 xpass=0 xfail=2 skip=0 error=5
index 9c595c0e96694f802642eb562d89c2ca32d60b4b,3a63821cf38a73594c70e57f6a8ecdc194e80bfb..b3b2cef77f213478ec77e5a600c3d7b06470b82e
@@@ -70,11 -70,11 +70,11 @@@ ok 4 # SKI
  
  END
  
- tests=`echo *.test`
+ tests=$(echo *.test)
  
  for tap_flags in "" "--comments"; do
 -  env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
 -    $MAKE -e check >stdout || { cat stdout; Exit 1; }
 +  $MAKE check TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" >stdout \
 +    || { cat stdout; Exit 1; }
    cat stdout
    count_test_results total=12 pass=7 xfail=2 skip=3 fail=0 xpass=0 error=0
  done
index 3afddec2cda96458f9ea9cafa714c077865b97de,f53534c48487a4a1780d674263f7c852a4be3a3e..f278e3d4ce3080b219a0a7e90d433179a53af249
@@@ -28,12 -27,12 +27,12 @@@ for c1 in s S; d
  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
  
- $MAKE TESTS="`echo *.test`" check >stdout || { cat stdout; Exit 1; }
 -TESTS="$(echo *.test)" $MAKE -e check >stdout || { cat stdout; Exit 1; }
++$MAKE TESTS="$(echo *.test)" 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
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 291c95f22e574dbceee10fbdf35dc1388a285468,28e170081ac8314e15bd9c3a115010c6175f5708..ed65c299637a35d03cdac5bbcc2e17bfcb01221d
@@@ -165,9 -156,9 +165,9 @@@ for vpath in : false; d
    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 \
 +  $MAKE TESTS='pass.t pass3-skip2-xfail.t' check >stdout \
      || { cat stdout; cat test-suite.log; Exit 1; }
    cat test-suite.log
    cat stdout
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc t/test-log.sh
Simple merge
Simple merge
Simple merge
index 896db04d1b5ea1fdb41a32eac9471346ecdfc6a8,b8d13d81d30b46100ca88d8d399a51c979bdf74e..fb614a34ab00353ba7bf0db265fe8f23d83f8adb
@@@ -68,11 -68,11 +68,11 @@@ for vpath in : false; d
    $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
 +  $MAKE TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' 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
diff --cc t/transform3.sh
Simple merge
diff --cc t/txinfo21.sh
Simple merge
Simple merge
diff --cc t/vala-mix.sh
Simple merge
diff --cc t/vala-vapi.sh
Simple merge
diff --cc t/vala5.sh
Simple merge
diff --cc t/vtexi3.sh
index c8736eafe4b5a53edb18e44a54f292d97b540726,5bea2811b10cd37de3f71d38372c650fa212aaa3..82ab71bb829074cb7c938911a671a95137932fe1
@@@ -91,10 -91,10 +91,10 @@@ do_check (
    # 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).
 +  # to $(am__dist_files).
    $MAKE echo-distfiles # For debugging.
    $MAKE -s echo-distfiles | grep "[ /]$vfile\\.texi"
  }
diff --cc t/vtexi4.sh
Simple merge
index e9534f52ad4b6fbf5caebfae8845587a09a4fbba,d0af92411f198ad36a1abef39035faf1d3aa5f67..3e20ae0f1eab944b08acd8777bdba3e53e9897ff
@@@ -31,11 -31,11 +31,11 @@@ ok (
  ko ()
  {
    AUTOMAKE_run $*
 -  grep '^Makefile\.am:.*:=.*not portable' stderr
 +  grep '^Makefile\.am:.*sub/foo\.c.*requires.*AM_PROG_CC_C_O' stderr
-   test `wc -l <stderr` -eq 1
+   test $(wc -l <stderr) -eq 1
  }
  
 -set_am_opts()
 +set_am_opts ()
  {
    set +x
    sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
diff --cc t/warnopts.sh
index ccf011b693d9b1ff8e3584a0b552016dd320c2d0,584f864d0ba41e2f4256fd44773c95e59ed26258..887f73a5e357f80aa796dc5c7a2f7260e8fa0cf8
@@@ -52,16 -44,22 +52,16 @@@ EN
  $ACLOCAL
  AUTOMAKE_fails
  # The expected diagnostic is
 -#   Makefile.am:3: warning: variable 'foo_SOURCES' is defined but no program or
 -#                           library has 'foo' as canonical name (possible typo)
 -#   sub/Makefile.am:2: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS'
 -grep '^Makefile.am:.*foo_SOURCES' stderr
 -grep '^sub/Makefile.am:.*INCLUDES' stderr
 -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) -eq 3
 +#   automake: warnings are treated as errors
 +#   Makefile.am:6: warning: compiling 'sub/foo.c' in subdir requires 'AM_PROG_CC_C_O' in 'configure.ac'
 +#   sub/Makefile.am:1: warning: 'AUTOMAKE_OPTIONS' cannot have conditional contents
 +grep '^Makefile\.am:.*sub/foo\.c.*AM_PROG_CC_C_O' stderr
 +grep '^sub/Makefile.am:.*AUTOMAKE_OPTIONS' stderr
 +grep '^sub/Makefile\.am:.*AM_PROG_CC_C_O' stderr && Exit 1
 +grep '^Makefile\.am:.*AUTOMAKE_OPTIONS' stderr && Exit 1
 +# Only two lines of warnings.
- test $(grep -v 'warnings are treated as errors' stderr | wc -l) = 2
++test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 2
  
 -# 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
 -# created below; thus causing traces for the old configure.ac to be
 -# used.  We could do '$sleep', but it's faster to erase the
 -# directory.  (Erase autom4te*.cache, not autom4te.cache, because some
 -# bogus installations of Autoconf use a versioned cache).
  rm -rf autom4te*.cache
  
  # If we add a global -Wnone, all warnings should disappear.
diff --cc t/yacc-basic.sh
Simple merge
diff --cc t/yacc-cxx.sh
Simple merge
Simple merge
Simple merge
diff --cc t/yacc8.sh
Simple merge