/test-suite.log
/t/wrap/aclocal-1.*
/t/wrap/automake-1.*
-/defs-static
+/t/ax/test-defs.sh
/t/testsuite-part.am
/t/*-w.tap
/t/*-w.sh
# Some testsuite-influential variables should be overridable from the
# test scripts, but not from the environment.
+# Keep this in sync with the similar list in 'runtest.in'.
AM_TESTS_ENVIRONMENT = \
for v in \
required \
- am_using_tap \
+ am_test_protocol \
am_serial_tests \
am_test_prefer_config_shell \
am_original_AUTOMAKE \
am_original_ACLOCAL \
+ am_test_lib_sourced \
+ test_lib_sourced \
; do \
eval test x"\$${$$v}" = x || unset $$v; \
done;
AM_TESTS_FD_REDIRECT = 9>&2
AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
+# For sourcing of extra "shell libraries" by our test scripts. As per
+# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
+# in case it is given with a relative name containing no slashes.
+AM_TESTS_ENVIRONMENT += \
+ if test $(srcdir) != .; then \
+ PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
+ fi; \
+ PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
+ export PATH;
+
# Hand-written tests.
include $(srcdir)/t/list-of-tests.mk
TESTS += $(contrib_TESTS)
EXTRA_DIST += $(contrib_TESTS)
-# Static dependencies valid for each test case.
-check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION)
-dist_check_DATA = \
- t/ax/test-init.sh \
- t/ax/plain-functions.sh \
+# Static dependencies valid for each test case (also further
+# extended later). Note that use 'noinst_' rather than 'check_'
+# as the prefix, because we really want them to be built by
+# "make all". This makes it easier to run the test cases by
+# hand after having simply configured and built the package.
+
+nodist_noinst_SCRIPTS = \
+ t/wrap/aclocal-$(APIVERSION) \
+ t/wrap/automake-$(APIVERSION)
+
+dist_noinst_DATA = \
+ t/ax/test-lib.sh \
+ t/ax/am-test-lib.sh \
t/ax/tap-functions.sh
-nodist_check_DATA = defs-static
# Few more static dependencies.
t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am
EXTRA_DIST += t/ax/distcheck-hook-m4.am
-defs-static: defs-static.in Makefile
+t/ax/test-defs.sh: t/ax/test-defs.in Makefile
$(AM_V_at)rm -f $@ $@-t
- $(AM_V_GEN)in=defs-static.in\
- && $(do_subst) <$(srcdir)/defs-static.in >$@-t
+ $(AM_V_at)$(MKDIR_P) t/ax
+ $(AM_V_GEN)in=t/ax/test-defs.in \
+ && $(do_subst) <$(srcdir)/$$in >$@-t
$(generated_file_finalize)
-EXTRA_DIST += defs-static.in
-CLEANFILES += defs-static
+EXTRA_DIST += t/ax/test-defs.in
+CLEANFILES += t/ax/test-defs.sh
+nodist_noinst_DATA = t/ax/test-defs.sh
runtest: runtest.in Makefile
$(AM_V_at)rm -f $@ $@-t
.PHONY: check-tests-syntax
## Checking the list of tests.
-test_subdirs = t t/pm t/perf contrib/t
+test_subdirs = t t/pm contrib/t
include $(srcdir)/t/CheckListOfTests.am
# Run the testsuite with the installed aclocal and automake.
installcheck-testsuite:
am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
+# Performance tests.
+.PHONY: perf
+perf: all
+ $(MAKE) $(AM_MAKEFLAGS) TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' \
+ TESTS='$(perf_TESTS)' check
+PERF_TEST_SUITE_LOG = t/perf/test-suite.log
+CLEANFILES += $(PERF_TEST_SUITE_LOG)
+EXTRA_DIST += $(perf_TESTS)
+
clean-local: clean-local-check
.PHONY: clean-local-check
clean-local-check:
-## Directries candidate to be test directories match this wildcard.
+## Directories candidate to be test directories match this wildcard.
@globs='t/*.dir t/*/*.dir */t/*.dir */t/*/*.dir'; \
## The 'nullglob' bash option is not portable, so use perl.
dirs=`$(PERL) -e "print join(' ', glob('$$globs'));"` || exit 1; \
missing \
src/Makefile.in
-dist_noinst_DATA = $(amhello_sources)
+dist_noinst_DATA += $(amhello_sources)
dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
# We depend on configure.ac so that we regenerate the tarball
testsuite harness will still be available through the use of the
'serial-tests' option (introduced in Automake 1.12).
+ - The 'color-tests' option is now unconditionally activated by default.
+ In particular, this means that testsuite output is now colorized by
+ default if the attached terminal seems to support ANSI escapes, and
+ that the user can force output colorization by setting the variable
+ AM_COLOR_TESTS to "always". The 'color-tests' is still recognized
+ for backward-compatibility, although it's a handled as a no-op now.
+
* Silent rules support:
- Support for silent rules is now always active in Automake-generated
* Texinfo Support:
- The rules to build PDF and DVI files from Texinfo input now use the
- ' --build-dir' option, to keep the auxiliary files used by texi2dvi
+ '--build-dir' option, to keep the auxiliary files used by texi2dvi
and texi2pdf around without cluttering the build directory, and to
make it possible to run the "dvi" and "pdf" recipes in parallel.
* Recursive targets:
- The user can now define his own recursive targets that recurse
- in the directories specified in $(SUBDIRS). This can be done by
- specifying the name of such targets in invocations of the new
- 'AM_EXTRA_RECURSIVE_TARGETS' m4 macro.
+ - The user can now define his own recursive targets that recurse
+ in the directories specified in $(SUBDIRS). This can be done by
+ specifying the name of such targets in invocations of the new
+ 'AM_EXTRA_RECURSIVE_TARGETS' m4 macro.
+
+ - Any failure in the recipe of the "tags", "ctags", "cscope" or
+ "cscopelist" targets in a subdirectory is now propagated to the
+ top-level make invocation.
* Improvements to aclocal and related rebuilds rules:
giving more useful warnings than a bare "command not found" from a
make recipe would.
-* Automake Testsuite:
+* Miscellaneous changes:
+
+ - The '.m4' files provided by Automake does not define serial numbers
+ anymore. This should cause no difference in the behaviour of aclocal
+ though.
- Some testsuite weaknesses and spurious failures have been fixed.
+Bugs fixed in 1.12.3:
+
+* Long-standing bugs:
+
+ - Instead of renaming only self-references of files (typically for
+ #lines), ylwrap now also renames references to the other generated
+ files. This fixes support for GLR and C++ parsers from Bison (PR
+ automake/491 and automake bug#7648): 'parser.c' now properly
+ #includes 'parser.h' instead of 'y.tab.h'.
+
+ - Generated files unknown to ylwrap are now preserved. This fixes
+ C++ support for Bison (automake bug#7648): location.hh and the
+ like are no longer discarded.
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
New in 1.12.2:
Inoue inoue@ainet.or.jp
Jack Kelly jack@jackkelly.name
James Amundson amundson@users.sourceforge.net
+James Bostock james.bostock@gmail.com
James Henstridge james@daa.com.au
James R. Van Zandt jrv@vanzandt.mv.com
James Youngman jay@gnu.org
'install-ps-am' => 1,
'install-info-am' => 1,
'installcheck-am' => 1,
- 'uninstall-am' => 1,
-
- 'install-man' => 1,
+ 'uninstall-am' => 1,
+ 'tags-am' => 1,
+ 'ctags-am' => 1,
+ 'cscopelist-am' => 1,
+ 'install-man' => 1,
);
# Queue to push require_conf_file requirements to.
'$(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)'
. "@config", INTERNAL);
- my @tag_deps = ();
- my @ctag_deps = ();
- my @cscope_deps = ();
- if (var ('SUBDIRS'))
- {
- $output_rules .= ("tags-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) tags); \\\n"
- . "\tdone\n");
- push (@tag_deps, 'tags-recursive');
- &depend ('.PHONY', 'tags-recursive');
- &depend ('.MAKE', 'tags-recursive');
-
- $output_rules .= ("ctags-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) ctags); \\\n"
- . "\tdone\n");
- push (@ctag_deps, 'ctags-recursive');
- &depend ('.PHONY', 'ctags-recursive');
- &depend ('.MAKE', 'ctags-recursive');
-
- $output_rules .= ("cscopelist-recursive:\n"
- . "\tlist='\$(SUBDIRS)'; for subdir in \$\$list; do \\\n"
- # Never fail here if a subdir fails; it
- # isn't important.
- . "\t test \"\$\$subdir\" = . || (\$(am__cd) \$\$subdir"
- . " && \$(MAKE) \$(AM_MAKEFLAGS) cscopelist); \\\n"
- . "\tdone\n");
- push (@cscope_deps, 'cscopelist-recursive');
- &depend ('.PHONY', 'cscopelist-recursive');
- &depend ('.MAKE', 'cscopelist-recursive');
- }
-
if (rvar('am__tagged_files')->value_as_list_recursive
- || var ('ETAGS_ARGS') || @tag_deps)
- {
- $output_rules .= &file_contents ('tags',
- new Automake::Location,
- TAGSDIRS => "@tag_deps",
- CTAGSDIRS => "@ctag_deps",
- CSCOPEDIRS => "@cscope_deps");
-
+ || var ('ETAGS_ARGS') || var ('SUBDIRS'))
+ {
+ $output_rules .= &file_contents ('tags', new Automake::Location);
set_seen 'TAGS_DEPENDENCIES';
- }
- elsif (reject_var ('TAGS_DEPENDENCIES',
- "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
- . " without\nsources or 'ETAGS_ARGS'"))
- {
- }
+ }
else
- {
+ {
+ reject_var ('TAGS_DEPENDENCIES',
+ "it doesn't make sense to define 'TAGS_DEPENDENCIES'"
+ . " without\nsources or 'ETAGS_ARGS'");
# Every Makefile must define some sort of TAGS rule.
# Otherwise, it would be possible for a top-level "make TAGS"
- # to fail because some subdirectory failed.
- $output_rules .= "tags: TAGS\nTAGS:\n\n";
- # Ditto ctags and cscope.
- $output_rules .= "ctags: CTAGS\nCTAGS:\n\n";
- $output_rules .= "cscope cscopelist:\n\n";
- }
+ # to fail because some subdirectory failed. Ditto ctags and
+ # cscope.
+ $output_rules .=
+ "tags TAGS:\n\n" .
+ "ctags CTAGS:\n\n" .
+ "cscope cscopelist:\n\n";
+ }
}
push (@check_tests, 'check-TESTS');
my $check_deps = "@check";
$output_rules .= &file_contents ('check', new Automake::Location,
- COLOR => !! option 'color-tests',
SERIAL_TESTS => !! option 'serial-tests',
CHECK_DEPS => $check_deps);
# preprocess_file ($MAKEFILE, [%TRANSFORM])
# -----------------------------------------
# Load a $MAKEFILE, apply the %TRANSFORM, and return the result.
-# No extra parsing of post-processing is done (i.e., recognition of
+# No extra parsing or post-processing is done (i.e., recognition of
# rules declaration or of make variables definitions).
sub preprocess_file ($%)
{
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
+ [supports \${@%:@var}],
+ [zero='' one='x' twelve=' foobar baz!' \
+ && test ${@%:@zero} -eq 0 \
+ && test ${@%:@one} -eq 1 \
+ && test ${@%:@twelve} -eq 12],
+ [], [am_score=1; break])
+
+ _AM_CHECK_SHELL_FEATURE([$1],
[supports \${var@%:@glob} and \${var%glob}],
[v=a/b/c \
&& test ${v@%:@*/} = b/c \
[], [am_score=1; break])
_AM_CHECK_SHELL_FEATURE([$1],
+ [can define exit traps in a shell function],
+ [fail=0 && foo() { trap 'fail=1' 0; } && foo && test $fail = 0],
+ [], [am_score=1; break])
+
+ _AM_CHECK_SHELL_FEATURE([$1],
[corrupts stderr with "set -x"],
[(set -x; P=1 true 2>&3) 3>&1 2>/dev/null | grep P=1],
[am_score=9], [])
+ echo 'return 34' > conftest-return.sh
+ echo 'ok=no' >> conftest-return.sh
+ _AM_CHECK_SHELL_FEATURE([$1],
+ [can return early from "dot-sourced" files],
+ [ok=yes; . ./conftest-return.sh; test $? -eq 34 && test $ok = yes],
+ [rm -f conftest-return.sh],
+ [rm -f conftest-return.sh; am_score=1; break])
+
echo 'alias false=echo' > conftest-alias.sh
echo 'false && test "$(false 97)" = 97' >> conftest-alias.sh
_AM_CHECK_SHELL_FEATURE([$1],
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Source the shell static setup and variable definitions.
-. ./defs-static; test $? -eq 0 || exit 99
+set -e
-# Source the actual test initialization and setup code, and return
-# control to the test script that is sourcing us.
-. "$am_testauxdir/test-init.sh"
+# Source the actual code for test initialization and setup.
+. test-lib.sh
+. am-test-lib.sh
+
+# Run that setup, and return control to the test script sourcing us.
+am_test_setup
@anchor{Simple tests and color-tests}
@vindex AM_COLOR_TESTS
@cindex Colorized testsuite output
-If the Automake option @code{color-tests} is used (@pxref{Options})
-and standard output is connected to a capable terminal, then the test
-results and the summary are colored appropriately. The user can disable
-colored output by setting the @command{make} variable
-@samp{AM_COLOR_TESTS=no}, or force colored output even without a connecting
-terminal with @samp{AM_COLOR_TESTS=always}. It's also worth noting that
-some @command{make} implementations, when used in parallel mode, have
-slightly different semantics (@pxref{Parallel make,,, autoconf,
-The Autoconf Manual}), which can break the automatic detection of a
-connection to a capable terminal. If this is the case, you'll have to
-resort to the use of @samp{AM_COLOR_TESTS=always} in order to have the
-testsuite output colorized.
+If the standard output is connected to a capable terminal, then the test
+results and the summary are colored appropriately. The developer and the
+user can disable colored output by setting the @command{make} variable
+@samp{AM_COLOR_TESTS=no}; the user can in addition force colored output
+even without a connecting terminal with @samp{AM_COLOR_TESTS=always}.
+It's also worth noting that some @command{make} implementations,
+when used in parallel mode, have slightly different semantics
+(@pxref{Parallel make,,, autoconf, The Autoconf Manual}), which can
+break the automatic detection of a connection to a capable terminal.
+If this is the case, the user will have to resort to the use of
+@samp{AM_COLOR_TESTS=always} in order to have the testsuite output
+colorized.
Test programs that need data files should look for them in @code{srcdir}
(which is both a make variable and an environment variable made available
@end itemize
@noindent
-On the other hand, the exact semantics of how (and if)
-@option{color-tests}, @code{XFAIL_TESTS}, and hard errors are supported
-and handled is left to the individual test drivers.
+On the other hand, the exact semantics of how (and if) testsuite output
+colorization, @code{XFAIL_TESTS}, and hard errors are supported and
+handled is left to the individual test drivers.
@c TODO: We should really add a working example in the doc/ directory,
@c TODO: and reference if from here.
Cause @samp{make dist} to fail unless the current version number appears
in the first few lines of the @file{NEWS} file.
-@item @option{color-tests}
-@cindex Option, @option{color-tests}
-@opindex color-tests
-Cause output of the serial and parallel test harnesses (see @ref{Simple
-Tests}) and of properly-written custom test drivers (@pxref{Custom Test
-Drivers}) to be colorized on capable terminals.
-
@item @option{dejagnu}
@cindex Option, @option{dejagnu}
@opindex dejagnu
# For use in VPATH builds.
my $srcdir = ".";
+# The testsuite subdirectory, relative to the top-lever source directory.
+my $testdir = "t";
+
+# Where testsuite-related helper scripts, data files and shell libraries
+# are placed. Relative to the top-lever source directory.
+my $testauxdir = "$testdir/ax";
+
#--------------------------------------------------------------------------
sub unindent ($)
print $file_handle unindent <<EOF;
#! /bin/sh
# This file has been automatically generated. DO NOT EDIT BY HAND!
- . ./defs-static || exit 1
+ . test-lib.sh
$shell_setup_code
# In the spirit of VPATH, we prefer a test in the build tree
# over one in the source tree.
my $make = defined $ENV{MAKE} ? $ENV{MAKE} : "make";
# Unset MAKEFLAGS, for when we are called from make itself.
my $cmd = "MAKEFLAGS= && unset MAKEFLAGS && cd '$srcdir' && "
- . "$make -s -f t/list-of-tests.mk print-list-of-tests";
+ . "$make -s -f $testdir/list-of-tests.mk print-list-of-tests";
my @tests_list = split /\s+/, `$cmd`;
die "$me: cannot get list of tests\n" unless $? == 0 && @tests_list;
my $ok = 1;
#--------------------------------------------------------------------------
-# Where testsuite-related helper scripts, data files and shell libraries
-# are placed. Relative to the 't/' subdirectory.
-my $auxdir = "ax";
-
my %deps_extractor =
(
libtool_macros =>
{
line_matcher => qr/^\s*required=.*\blibtool/,
- nodist_prereqs => "t/libtool-macros.log",
+ nodist_prereqs => "$testdir/libtool-macros.log",
},
gettext_macros =>
{
line_matcher => qr/^\s*required=.*\bgettext/,
- nodist_prereqs => "t/gettext-macros.log",
+ nodist_prereqs => "$testdir/gettext-macros.log",
},
use_trivial_test_driver =>
{
line_matcher => qr/\btrivial-test-driver\b/,
- dist_prereqs => "t/$auxdir/trivial-test-driver",
+ dist_prereqs => "$testauxdir/trivial-test-driver",
},
check_testsuite_summary =>
{
line_matcher => qr/\btestsuite-summary-checks\.sh\b/,
- dist_prereqs => "t/$auxdir/testsuite-summary-checks.sh",
+ dist_prereqs => "$testauxdir/testsuite-summary-checks.sh",
},
extract_testsuite_summary =>
{
line_matcher => qr/\bextract-testsuite-summary\.pl\b/,
- dist_prereqs => "t/$auxdir/extract-testsuite-summary.pl",
+ dist_prereqs => "$testauxdir/extract-testsuite-summary.pl",
},
check_tap_testsuite_summary =>
{
line_matcher => qr/\btap-summary-aux\.sh\b/,
- dist_prereqs => "t/$auxdir/tap-summary-aux.sh",
+ dist_prereqs => "$testauxdir/tap-summary-aux.sh",
},
on_tap_with_common_setup =>
{
line_matcher => qr/\btap-setup\.sh\b/,
- dist_prereqs => "t/$auxdir/tap-setup.sh",
- nodist_prereqs => "t/tap-common-setup.log",
+ dist_prereqs => "$testauxdir/tap-setup.sh",
+ nodist_prereqs => "$testdir/tap-common-setup.log",
},
depcomp =>
{
line_matcher => qr/\bdepcomp\.sh\b/,
- dist_prereqs => "t/$auxdir/depcomp.sh",
+ dist_prereqs => "$testauxdir/depcomp.sh",
},
);
"depmode=$m",
"depcomp_with_libtool=" . ($lt ? "yes" : "no"),
);
- my $test = "t/depcomp" . ($lt ? "-lt-" : "-") . $m . ".tap";
+ my $test = "$testdir/depcomp" . ($lt ? "-lt-" : "-") . "$m.tap";
# Register wrapper test as "autogenerated" ...
push @generated_tests, $test;
# ... and create it.
required="@required"
. ./defs || exit 1
plan_ $planned
- . "\$am_testauxdir/depcomp.sh"; exit \$?
+ . depcomp.sh
+ exit \$?
EOF
},
0555);
am__tty_colors_dummy = \
mgn= red= grn= lgn= blu= brg= std=; \
am__color_tests=no
-if %?COLOR%
+
am__tty_colors = { \
$(am__tty_colors_dummy); \
if test "X$(AM_COLOR_TESTS)" = Xno; then \
std='\e[m'; \
fi; \
}
-else !%?COLOR%
-am__tty_colors = $(am__tty_colors_dummy)
-endif !%?COLOR%
.PHONY: check-TESTS
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+## Handle VPATH correctly.
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
+
## ---- ##
## ID. ##
## ---- ##
ID: $(am__tagged_files)
-## Make sure the list of sources is unique.
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
-## Handle VPATH correctly.
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
## ------ ##
## ------ ##
ETAGS = etags
-.PHONY: tags
+.PHONY: TAGS tags
if %?SUBDIRS%
-AM_RECURSIVE_TARGETS += tags TAGS
-endif %?SUBDIRS%
-tags: TAGS
-
-TAGS: %TAGSDIRS% $(TAGS_DEPENDENCIES) $(am__tagged_files)
+AM_RECURSIVE_TARGETS += TAGS
+RECURSIVE_TARGETS += tags-recursive
+tags: tags-recursive
+else !%?SUBDIRS%
+tags: tags-am
+endif !%?SUBDIRS%
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
## We use the positional parameters to build the subdir list with
## absolute names, without the need to worry about white space in `pwd`.
set x; \
?SUBDIRS? set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
?SUBDIRS? fi; \
?SUBDIRS? done; \
-## Make sure the list of sources is unique.
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
-## Handle VPATH correctly.
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
## Remove the 'x' we added first:
shift; \
## Make sure we have something to run etags on.
CTAGS = ctags
.PHONY: CTAGS ctags
if %?SUBDIRS%
-AM_RECURSIVE_TARGETS += ctags CTAGS
-endif %?SUBDIRS%
-ctags: CTAGS
-
-## We have a dummy name here because 'tags' has already been in use
-## for a long time to mean Emacs-style tags. Oops. This means the
-## dependencies here are useless.
-CTAGS: %CTAGSDIRS% $(TAGS_DEPENDENCIES) $(am__tagged_files)
-## Make sure the list of sources is unique.
- list='$(am__tagged_files)'; \
- unique=`for i in $$list; do \
-## Handle VPATH correctly.
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+AM_RECURSIVE_TARGETS += CTAGS
+RECURSIVE_TARGETS += ctags-recursive
+ctags: ctags-recursive
+else !%?SUBDIRS%
+ctags: ctags-am
+endif !%?SUBDIRS%
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
## Make sure we have something to run ctags on.
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
## ------- ##
if %?TOPDIR_P%
-
CSCOPE = cscope
.PHONY: cscope clean-cscope
AM_RECURSIVE_TARGETS += cscope
-
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
-
clean-cscope:
-rm -f cscope.files
-
-cscope.files: clean-cscope %CSCOPEDIRS% cscopelist
-
+cscope.files: clean-cscope cscopelist
endif %?TOPDIR_P%
-.PHONY: cscopelist
-cscopelist: %CSCOPEDIRS% $(am__tagged_files)
+if %?SUBDIRS%
+RECURSIVE_TARGETS += cscopelist-recursive
+cscopelist: cscopelist-recursive
+else !%?SUBDIRS%
+cscopelist: cscopelist-am
+endif !%?SUBDIRS%
+
+cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2012-03-27.16; # UTC
+scriptversion=2012-07-12.20; # UTC
# Copyright (C) 1999-2012 Free Software Foundation, Inc.
rm -f "$tmpdepfile"
;;
+## The order of this option in the case statement is important, since the
+## shell code in configure will try each of these formats in the order
+## listed in this file. A plain '-MD' option would be understood by many
+## compilers, so we must ensure this comes after the gcc and icc options.
+pgcc)
+ # Portland's C compiler understands '-MD'.
+ # Will always output deps to 'file.d' where file is the root name of the
+ # source file under compilation, even if file resides in a subdirectory.
+ # The object file name does not affect the name of the '.d' file.
+ # pgcc 10.2 will output
+ # foo.o: sub/foo.c sub/foo.h
+ # and will wrap long lines using '\' :
+ # foo.o: sub/foo.c ... \
+ # sub/foo.h ... \
+ # ...
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ # Use the source, not the object, to determine the base name, since
+ # that's sadly what pgcc will do too.
+ base=`echo "$source" | sed -e 's|^.*/||' -e 's/\.[-_a-zA-Z0-9]*$//'`
+ tmpdepfile="$base.d"
+
+ # For projects that build the same source file twice into different object
+ # files, the pgcc approach of using the *source* file root name can cause
+ # problems in parallel builds. Use a locking strategy to avoid stomping on
+ # the same $tmpdepfile.
+ lockdir="$base.d-lock"
+ trap "echo '$0: caught signal, cleaning up...' >&2; rm -rf $lockdir" 1 2 13 15
+ numtries=100
+ i=$numtries
+ while test $i -gt 0 ; do
+ # mkdir is a portable test-and-set.
+ if mkdir $lockdir 2>/dev/null; then
+ # This process acquired the lock.
+ "$@" -MD
+ stat=$?
+ # Release the lock.
+ rm -rf $lockdir
+ break
+ else
+ ## the lock is being held by a different process,
+ ## wait until the winning process is done or we timeout
+ while test -d $lockdir && test $i -gt 0; do
+ sleep 1
+ i=`expr $i - 1`
+ done
+ fi
+ i=`expr $i - 1`
+ done
+ trap - 1 2 13 15
+ if test $i -le 0; then
+ echo "$0: failed to acquire lock after $numtries attempts" >&2
+ echo "$0: check lockdir '$lockdir'" >&2
+ exit 1
+ fi
+
+ if test $stat -ne 0; then
+ rm -f "$tmpdepfile"
+ exit $stat
+ fi
+ rm -f "$depfile"
+ # Each line is of the form `foo.o: dependent.h',
+ # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+ # Do two passes, one to just change these to
+ # `$object: dependent.h' and one to simply `dependent.h:'.
+ sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+ # Some versions of the HPUX 10.20 sed can't process this invocation
+ # correctly. Breaking it into two sed invocations is a workaround.
+ sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+ sed -e 's/$/ :/' >> "$depfile"
+ rm -f "$tmpdepfile"
+ ;;
+
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
#! /bin/sh
# ylwrap - wrapper for lex/yacc invocations.
-scriptversion=2011-08-25.18; # UTC
+scriptversion=2012-07-14.08; # UTC
# Copyright (C) 1996-2012 Free Software Foundation, Inc.
#
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
+get_dirname ()
+{
+ case $1 in
+ */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';;
+ # Otherwise, we want the empty string (not ".").
+ esac
+}
+
+# guard FILE
+# ----------
+# The CPP macro used to guard inclusion of FILE.
+guard()
+{
+ printf '%s\n' "$from" \
+ | sed \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
+ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'
+}
+
+# quote_for_sed [STRING]
+# ----------------------
+# Return STRING (or stdin) quoted to be used as a sed pattern.
+quote_for_sed ()
+{
+ case $# in
+ 0) cat;;
+ 1) printf '%s\n' "$1";;
+ esac \
+ | sed -e 's|[][\\.*]|\\&|g'
+}
+
case "$1" in
'')
echo "$0: No files given. Try '$0 --help' for more information." 1>&2
;;
esac
-get_dirname ()
-{
- case $1 in
- */*|*\\*) printf '%s\n' "$1" | sed -e 's,\([\\/]\)[^\\/]*$,\1,';;
- # Otherwise, we want the empty string (not ".").
- esac
-}
-
-quote_for_sed ()
-{
- # FIXME: really we should care about more than '.' and '\'.
- sed -e 's,[\\.],\\&,g'
-}
# The input.
input="$1"
input="`pwd`/$input"
;;
esac
+input_rx=`get_dirname "$input" | quote_for_sed`
+
+# Since DOS filename conventions don't allow two dots,
+# the DOS version of Bison writes out y_tab.c instead of y.tab.c
+# and y_tab.h instead of y.tab.h. Test to see if this is the case.
+y_tab_nodot=false
+if test -f y_tab.c || test -f y_tab.h; then
+ y_tab_nodot=true
+fi
-pairlist=
+# The parser itself, the first file, is the destination of the .y.c
+# rule in the Makefile.
+parser=$1
+# A sed program to s/FROM/TO/g for all the FROM/TO so that, for
+# instance, we rename #include "y.tab.h" into #include "parse.h"
+# during the conversion from y.tab.c to parse.c.
+rename_sed=
while test "$#" -ne 0; do
if test "$1" = "--"; then
shift
break
fi
- pairlist="$pairlist $1"
+ from=$1
+ # Handle y_tab.c and y_tab.h output by DOS
+ if $y_tab_nodot; then
+ case $from in
+ "y.tab.c") from=y_tab.c;;
+ "y.tab.h") from=y_tab.h;;
+ esac
+ fi
+ shift
+ to=$1
shift
+ rename_sed="${rename_sed}s|"`quote_for_sed "$from"`"|$to|g;"
done
# The program to run.
ret=$?
if test $ret -eq 0; then
- set X $pairlist
- shift
- first=yes
- # Since DOS filename conventions don't allow two dots,
- # the DOS version of Bison writes out y_tab.c instead of y.tab.c
- # and y_tab.h instead of y.tab.h. Test to see if this is the case.
- y_tab_nodot="no"
- if test -f y_tab.c || test -f y_tab.h; then
- y_tab_nodot="yes"
- fi
-
- input_rx=`get_dirname "$input" | quote_for_sed`
-
- while test "$#" -ne 0; do
- from="$1"
- # Handle y_tab.c and y_tab.h output by DOS
- if test $y_tab_nodot = "yes"; then
- if test $from = "y.tab.c"; then
- from="y_tab.c"
- else
- if test $from = "y.tab.h"; then
- from="y_tab.h"
- fi
- fi
- fi
+ for from in *
+ do
+ to=`printf '%s\n' "$from" | sed "$rename_sed"`
if test -f "$from"; then
# If $2 is an absolute path name, then just use that,
# otherwise prepend '../'.
- case "$2" in
- [\\/]* | ?:[\\/]*) target="$2";;
- *) target="../$2";;
+ case $to in
+ [\\/]* | ?:[\\/]*) target=$to;;
+ *) target="../$to";;
esac
- # We do not want to overwrite a header file if it hasn't
- # changed. This avoid useless recompilations. However the
- # parser itself (the first file) should always be updated,
- # because it is the destination of the .y.c rule in the
- # Makefile. Divert the output of all other files to a temporary
- # file so we can compare them to existing versions.
- if test $first = no; then
+ # Do not overwrite unchanged header files to avoid useless
+ # recompilations. Always update the parser itself: it is the
+ # destination of the .y.c rule in the Makefile. Divert the
+ # output of all other files to a temporary file so we can
+ # compare them to existing versions.
+ if test $from != $parser; then
realtarget="$target"
- target="tmp-`echo $target | sed s/.*[\\/]//g`"
+ target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'`
fi
- # Munge "#line" or "#" directives.
- # We don't want the resulting debug information to point at
- # an absolute srcdir.
- # We want to use the real output file name, not yy.lex.c for
- # instance.
- # We want the include guards to be adjusted too.
- FROM=`echo "$from" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
- TARGET=`echo "$2" | sed \
- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'\
- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`
-
- sed -e "/^#/!b" -e "s,$input_rx,$input_sub_rx," -e "s,$from,$2," \
- -e "s,$FROM,$TARGET," "$from" >"$target" || ret=$?
-
- # Check whether header files must be updated.
- if test $first = no; then
+
+ # Munge "#line" or "#" directives. Don't let the resulting
+ # debug information point at an absolute srcdir. Use the real
+ # output file name, not yy.lex.c for instance. Adjust the
+ # include guards too.
+ FROM=`guard "$from"`
+ TARGET=`guard "$to"`
+ sed -e "/^#/!b" -e "s|$input_rx|$input_sub_rx|" -e "$rename_sed" \
+ -e "s|$FROM|$TARGET|" "$from" >"$target" || ret=$?
+
+ # Check whether files must be updated.
+ if test "$from" != "$parser"; then
if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then
- echo "$2" is unchanged
+ echo "$to is unchanged"
rm -f "$target"
else
- echo updating "$2"
+ echo "updating $to"
mv -f "$target" "$realtarget"
fi
fi
else
- # A missing file is only an error for the first file. This
- # is a blatant hack to let us support using "yacc -d". If -d
- # is not specified, we don't want an error when the header
- # file is "missing".
- if test $first = yes; then
+ # A missing file is only an error for the parser. This is a
+ # blatant hack to let us support using "yacc -d". If -d is not
+ # specified, don't fail when the header file is "missing".
+ if test "$from" = "$parser"; then
ret=1
fi
fi
- shift
- shift
- first=no
done
-else
- ret=$?
fi
# Remove the directory.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_PROG_AR([ACT-IF-FAIL])
# -------------------------
# Try to determine the archiver interface, and trigger the ar-lib wrapper
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_PROG_AS
# ----------
AC_DEFUN([AM_PROG_AS],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
-
# _AM_COND_IF
# _AM_COND_ELSE
# _AM_COND_ENDIF
m4_define([_AM_COND_ELSE])
m4_define([_AM_COND_ENDIF])
-
# AM_COND_IF(COND, [IF-TRUE], [IF-FALSE])
# ---------------------------------------
# If the shell condition COND is true, execute IF-TRUE, otherwise execute
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 10
-
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 17
# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 7
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 7
-
AC_DEFUN([AM_WITH_DMALLOC],
[AC_MSG_CHECKING([if malloc debugging is wanted])
AC_ARG_WITH([dmalloc],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
AC_DEFUN([AM_PROG_GCJ],
[AC_CHECK_TOOLS([GCJ], [gcj], [gcj])
test -z "$GCJ" && AC_MSG_ERROR([no acceptable gcj found in \$PATH])
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 22
-
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# AM_PROG_LEX
# -----------
# Autoconf leaves LEX=: if lex or flex can't be found. Change that to a
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 12
-
# AM_PATH_LISPDIR
# ---------------
AC_DEFUN([AM_PATH_LISPDIR],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
-
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# AM_PROG_CC_C_O
# --------------
# Like AC_PROG_CC_C_O, but changed for automake.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 8
-
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
-
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it is modern enough.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
AC_DEFUN([AM_C_PROTOTYPES],
[AC_FATAL([automatic de-ANSI-fication support has been removed])])
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# ---------------------------------------------------------------------------
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
# AM_RUN_LOG(COMMAND)
# -------------------
# Run COMMAND, save the exit status in ac_status, and log it.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
-
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
-
# AM_SILENT_RULES([DEFAULT])
# --------------------------
# Enable less verbose build rules; with the default set to DEFAULT
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor 'install' (even GNU) is that you can't
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
-
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 3
-
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 1
-
AC_DEFUN([AM_PROG_UPC],
[dnl We need OBJEXT and EXEEXT, but Autoconf doesn't offer any public
dnl macro to compute them. Use AC_PROG_CC instead.
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# Check whether the Vala compiler exists in $PATH. If it is found, the
# variable VALAC is set. Optionally a minimum release number of the
# compiler can be requested.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Run an Automake test from the command line.
-# Usage:
set -e; set -u
: ${AM_PROVE_CMD='prove'}
: ${AM_PROVEFLAGS='--merge --verbose'}
: ${srcdir='@srcdir@'}
+: ${abs_srcdir='@abs_srcdir@'}
+: ${abs_builddir='@abs_builddir@'}
+: ${PATH_SEPARATOR='@PATH_SEPARATOR@'}
+
+# For sourcing of extra "shell libraries" by our test scripts. As per
+# POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
+# in case it is given with a relative name containing no slashes.
+if test "$srcdir" != .; then
+ PATH=$abs_srcdir/t/ax$PATH_SEPARATOR$PATH
+fi
+PATH=$abs_builddir/t/ax$PATH_SEPARATOR$PATH
+export PATH
+
+# For use by the testsuite framework. The Automake test harness
+# define this, so we better do the same.
+export srcdir
+
+# Some testsuite-influential variables should be overridable from the
+# test scripts, but not from the environment.
+# Keep this in sync with the 'Makefile.am:AM_TESTS_ENVIRONMENT'.
+for v in \
+ required \
+ am_test_protocol \
+ am_serial_tests \
+ am_test_prefer_config_shell \
+ am_original_AUTOMAKE \
+ am_original_ACLOCAL \
+ am_test_lib_sourced \
+ test_lib_sourced \
+; do
+ eval "$v= && unset $v" || exit 1
+done
+unset v
error () { echo "$0: $*" >&2; exit 255; }
# Some shell flags should be passed over to the test scripts.
-#while test $# -gt 0; do
-# case $1 in
-# --help) echo "Usage: $0 [SHELL-OPTIONS] TEST [TEST-OPTIONS]"; exit $?;;
-# -*)
-# esac
-#done
+shell_opts=
+while test $# -gt 0; do
+ case $1 in
+ --help)
+ echo "Usage: $0 [--shell=PATH] [SHELL-OPTIONS] TEST [TEST-OPTIONS]"
+ exit $?
+ ;;
+ --shell)
+ test $# -gt 1 || error "missing argument for option '$1'"
+ AM_TEST_RUNNER_SHELL=$2
+ shift
+ ;;
+ --shell=*)
+ AM_TEST_RUNNER_SHELL=${1#--shell=}
+ ;;
+ -o)
+ test $# -gt 1 || error "missing argument for option '$1'"
+ shell_opts="$shell_opts -o $2"
+ shift
+ ;;
+ -*)
+ # Assume it is an option to pass through to the shell.
+ shell_opts="$shell_opts $1";;
+ *)
+ break;;
+ esac
+ shift
+done
test $# -gt 0 || error "missing argument"
tst=$1; shift
case $tst in
- *.sh) wrapper () { exec "$@"; };;
- *.tap) wrapper () { exec "$AM_PROVE_CMD" $AM_PROVEFLAGS -e "$@"; };;
- *) error "test '$tst' has an unrecognized extension";;
-esac
-
-case $tst in
/*) ;;
*) if test -f ./$tst; then
tst=./$tst
;;
esac
-wrapper "$AM_TEST_RUNNER_SHELL" "$tst" "$@"
+case $tst in
+ *.sh)
+ exec $AM_TEST_RUNNER_SHELL $shell_opts "$tst" "$@" ;;
+ *.tap)
+ exec "$AM_PROVE_CMD" $AM_PROVEFLAGS -e \
+ "$AM_TEST_RUNNER_SHELL $shell_opts" "$tst" "$@" ;;
+ *)
+ error "test '$tst' has an unrecognized extension" ;;
+esac
+
error "dead code reached"
done; \
done | sort)
-xdefs = $(srcdir)/t/ax/test-init.sh $(srcdir)/defs $(srcdir)/defs-static.in
+xdefs = \
+ $(srcdir)/t/ax/am-test-lib.sh \
+ $(srcdir)/t/ax/test-lib.sh \
+ $(srcdir)/t/ax/test-defs.in \
+ $(srcdir)/defs
ams := $(shell find $(srcdir) -name '*.dir' -prune -o -name '*.am' -print)
sc_tests_obsolete_variables:
@vars=" \
using_tap \
+ am_using_tap \
test_prefer_config_shell \
original_AUTOMAKE \
original_ACLOCAL \
example, if you need to copy or grep an automake-provided script,
do not assume that they can be found in the '$top_srcdir/lib'
directory, but use '$am_scriptdir' instead. The complete list of
- such "$am_...dir" variables can be found in the 'defs-static.in'
+ such "$am_...dir" variables can be found in the 't/ax/test-defs.in'
file.
* When writing input for lex, include the following in the definitions
### IMPORTANT NOTE: keep this file 'set -e' clean. ###
########################################################
-# Enable the errexit shell flag early.
-set -e
-
-
-## --------------------- ##
-## 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. ##
-## ------------------ ##
+# Do not source several times.
+test ${am_test_lib_sourced-no} = yes && return 0
+am_test_lib_sourced=yes
-# A single whitespace character.
-sp=' '
-# A tabulation character.
-tab=' '
-# A newline character.
-nl='
-'
# A literal escape character. Used by test checking colored output.
esc='\e'
-# As autoconf-generated configure scripts do, ensure that IFS
-# is defined initially, so that saving and restoring $IFS works.
-IFS=$sp$tab$nl
-
-
-## ----------------------- ##
-## Early debugging info. ##
-## ----------------------- ##
-
-echo "Running from installcheck: $am_running_installcheck"
-echo "Using TAP: $am_using_tap"
-echo "PATH = $PATH"
-
+# 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
## ---------------------- ##
## Environment cleanup. ##
# 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 '_am_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.
-# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
-# sh inside this function (FIXME: is this still relevant now that we
-# require a POSIX shell?).
-_am_exit ()
-{
- set +e
- # See comments in the exit trap for the reason we do this.
- test 77 = $1 && am__test_skipped=yes
- # Spurious escaping to ensure we do not call our 'exit' alias.
- (\exit $1); \exit $1
-}
-alias exit=_am_exit
-
-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
$AUTOMAKE ${1+"$@"} >stdout 2>stderr || am__got_rc=$?
cat stderr >&2
cat stdout
- if test $am_using_tap != yes; then
+ if test $am_test_protocol = none; then
test $am__got_rc -eq $am__exp_rc || exit 1
return
fi
yl_distcheck () { useless_vpath_rebuild || $MAKE distcheck ${1+"$@"}; }
-# seq_ - print a sequence of numbers
-# ----------------------------------
-# This function simulates GNU seq(1) portably. Valid usages:
-# - seq LAST
-# - seq FIRST LAST
-# - seq FIRST INCREMENT LAST
-seq_ ()
-{
- case $# in
- 0) fatal_ "seq_: missing argument";;
- 1) seq_first=1 seq_incr=1 seq_last=$1;;
- 2) seq_first=$1 seq_incr=1 seq_last=$2;;
- 3) seq_first=$1 seq_incr=$2 seq_last=$3;;
- *) fatal_ "seq_: too many arguments";;
- esac
- i=$seq_first
- while test $i -le $seq_last; do
- echo $i
- i=$(($i + $seq_incr))
- done
-}
-
-# rm_rf_ [FILES OR DIRECTORIES ...]
-# ---------------------------------
-# Recursively remove the given files or directory, also handling the case
-# of non-writable subdirectories.
-rm_rf_ ()
-{
- test $# -gt 0 || return 0
- # Ignore failures in find, we are only interested in failures of the
- # final rm.
- find "$@" -type d ! -perm -700 -exec chmod u+rwx {} \; || :
- rm -rf "$@"
-}
-
# count_test_results total=N pass=N fail=N xpass=N xfail=N skip=N error=N
# -----------------------------------------------------------------------
# Check that a testsuite run driven by the parallel-tests harness has
)
}
-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
## 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
- :) ;;
+require_tool ()
+{
+ am_tool=$1
+ case $1 in
cc|c++|fortran|fortran77)
- require_compiler_ $tool;;
+ require_compiler_ $1;;
xsi-lib-shell)
if test x"$am_test_prefer_config_shell" = x"yes"; then
require_xsi "$SHELL"
;;
*)
# 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,
+ echo "$me: running $1 --version"
+ # It is not likely but possible that the required 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"
+ ($1 --version) </dev/null \
+ || skip_all_ "required program '$1' not available"
;;
esac
-done
-
-# 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
+}
+process_requirements ()
+{
+ # Look for (and maybe set up) required tools and/or system features;
+ # skip the current test if they are not found.
+ for am_tool in $*; do
+ require_tool $am_tool
+ done
+ unset am_tool
+ # 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_ $am_test_subdir
- set +x
- echo "$me: exit $exit_status"
- # Spurious escaping to ensure we do not call our "exit" alias.
- \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
-# - 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
- am_test_subdir=
-else
+am_setup_testdir ()
+{
# 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,
echo "AC_CONFIG_FILES([Makefile])"
} >configure.ac || framework_failure_ "creating configure.ac skeleton"
fi
-fi
-
-
-## ---------------- ##
-## Ready to go... ##
-## ---------------- ##
+}
-set -x
-pwd
+am_extra_info ()
+{
+ echo "Running from installcheck: $am_running_installcheck"
+ echo "Test Protocol: $am_test_protocol"
+ echo "PATH = $PATH"
+}
+++ /dev/null
-# -*- shell-script -*-
-#
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Helper functions used by "plain" tests of the Automake testsuite
-# (i.e., tests that don't use any test protocol).
-
-# Print warnings (e.g., about skipped and failed tests) to this file
-# number. Override by putting, say:
-# AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
-# AM_TESTS_FD_REDIRECT = 9>&2
-# in your Makefile.am.
-# This is useful when using automake's parallel tests mode, to print the
-# reason for skip/failure to console, rather than to the *.log files.
-: ${stderr_fileno_=2}
-
-# Copied from Gnulib's 'tests/init.sh'.
-warn_ () { echo "$@" 1>&$stderr_fileno_; }
-fail_ () { warn_ "$me: failed test: $@"; exit 1; }
-skip_ () { warn_ "$me: skipped test: $@"; exit 77; }
-fatal_ () { warn_ "$me: hard error: $@"; exit 99; }
-framework_failure_ () { warn_ "$me: set-up failure: $@"; exit 99; }
-
-# For compatibility with TAP functions.
-skip_all_ () { skip_ "$@"; }
-
-:
# Check that we are running from a proper directory: last thing we want
# is to overwrite some random user files.
-test -f ../../defs-static && test -f ../../defs && test -d ../../t \
+test -f ../../automake && test -f ../../defs && test -d ../../t \
|| fatal_ "running from a wrong directory"
test ! -f Makefile.am || mv Makefile.am Makefile.am~ \
mgn="$esc[0;35m"
brg="$esc[1m"
std="$esc[m"
- echo AUTOMAKE_OPTIONS = color-tests >> Makefile.am
else
red= grn= lgn= blu= mgn= brg= std=
fi
# IMPORTANT NOTES AND REQUIREMENTS
# - Multiple inclusions of this file should be idempotent.
# - This code has to be 'set -e' clean.
-# - This file should execute correctly with any system's /bin/sh
-# shell, not only with configure-time detected $SHELL and/or
-# $AM_TEST_RUNNER_SHELL.
-
-# CDPATH is evil if exported in the environment.
-CDPATH=; unset CDPATH
-
-# Be more Bourne compatible.
-# (Snippet inspired to configure's initialization in Autoconf 2.64)
-DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- setopt NO_GLOB_SUBST
- # If Zsh is not started directly in POSIX-compatibility mode, it has some
- # incompatibilities in the handling of $0 that conflict with our usage;
- # i.e., $0 inside a file sourced with the '.' builtin is temporarily set
- # to the name of the sourced file. Work around that.
- # Note that a bug in some versions of Zsh prevents us from resetting $0
- # in a sourced script, so the use of $argv0. For more info see:
- # <http://www.zsh.org/mla/workers/2009/msg01140.html>
- # The apparently useless 'eval' here is needed by at least dash 0.5.2,
- # to prevent it from bailing out with an error like:
- # "Syntax error: Bad substitution".
- eval 'argv0=${functrace[-1]%:*}' && test -f "$argv0" || {
- echo "Cannot determine the path of running test script." >&2
- echo "Your Zsh (version $ZSH_VERSION) is probably too old." >&2
- exit 99
- }
-else
- argv0=$0
- # Avoid command substitution failure, for Tru64 sh -e and instspc*.test.
- case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac
-fi
-
-# The name of the current test (without the '.sh' or '.tap' suffix).
-me=${argv0##*/} # Strip all directory components.
-case $me in # Strip test suffix.
- *.tap) me=${me%.tap};;
- *.sh) me=${me%.sh} ;;
- esac
-
-# Check that the environment is properly sanitized.
-# Having variables exported to the empty string is OK, since our code
-# treats such variables as if they were unset.
-for var in \
- required \
- am_using_tap \
- am_serial_tests \
- am_create_testdir \
- am_tap_implementation \
- am_test_prefer_config_shell \
- am_original_AUTOMAKE \
- am_original_ACLOCAL \
-; do
- if eval "test x\"\$$var\" != x" && env | grep "^$var=" >/dev/null; then
- echo "$me: variable '$var' is set in the environment:" \
- "this is unsafe" >&2
- exit 99
- fi
-done
-unset var
# See whether the current test script is expected to use TAP or not.
# Use a sensible default, while allowing the scripts to override this
# check.
-if test -z "$am_using_tap"; then
- case $argv0 in *.tap) am_using_tap=yes;; *) am_using_tap=no;; esac
+if test -z "$am_test_protocol"; then
+ case $argv0 in
+ *.tap) am_test_protocol=tap;;
+ *) am_test_protocol=none;;
+ esac
fi
am_rel_srcdir='@srcdir@'
# Tests who want complete control over aclocal or automake command-line
# options should use $am_original_ACLOCAL or $am_original_AUTOMAKE. The
-# "test -z" tests take care not to re-initialize them if defs-static
-# is re-sourced, as we want defs-static to remain really idempotent.
+# "test -z" tests take care not to re-initialize them if 'test-defs.sh'
+# is re-sourced, as we want that file to remain really idempotent.
if test -z "$am_original_AUTOMAKE"; then
am_original_AUTOMAKE=${AM_TESTSUITE_AUTOMAKE-${AUTOMAKE-"automake-$APIVERSION"}}
fi
*) PATH=$am_bindir$PATH_SEPARATOR$PATH;;
esac
-# Make our helper script accessible by default.
-PATH=$am_testauxdir$PATH_SEPARATOR$PATH
-
export PATH
--- /dev/null
+# -*- shell-script -*-
+#
+# Copyright (C) 1996-2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+########################################################
+### IMPORTANT NOTE: keep this file 'set -e' clean. ###
+########################################################
+
+# Do not source several times.
+test ${test_lib_sourced-no} = yes && return 0
+test_lib_sourced=yes
+
+# CDPATH is evil if used in non-interactive scripts (and even more
+# evil if exported in the environment).
+CDPATH=; unset CDPATH
+
+# Be more Bourne compatible.
+# (Snippet inspired to configure's initialization in Autoconf 2.64)
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ setopt NO_GLOB_SUBST
+ # If Zsh is not started directly in POSIX-compatibility mode, it has some
+ # incompatibilities in the handling of $0 that conflict with our usage;
+ # i.e., $0 inside a file sourced with the '.' builtin is temporarily set
+ # to the name of the sourced file. Work around that.
+ # Note that a bug in some versions of Zsh prevents us from resetting $0
+ # in a sourced script, so the use of $argv0. For more info see:
+ # <http://www.zsh.org/mla/workers/2009/msg01140.html>
+ # The apparently useless 'eval' here is needed by at least dash 0.5.2,
+ # to prevent it from bailing out with an error like:
+ # "Syntax error: Bad substitution".
+ eval 'argv0=${functrace[-1]%:*}' && test -f "$argv0" || {
+ echo "Cannot determine the path of running test script." >&2
+ echo "Your Zsh (version $ZSH_VERSION) is probably too old." >&2
+ exit 99
+ }
+else
+ argv0=$0
+ # Avoid command substitution failure, for it might cause problems with
+ # "set -e" on some shells.
+ case `(set -o) 2>/dev/null || :` in *posix*) set -o posix;; esac
+fi
+
+# 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
+
+# The name of the current test (without the '.sh' or '.tap' suffix).
+me=${argv0##*/} # Strip all directory components.
+case $me in # Strip test suffix.
+ *.tap) me=${me%.tap};;
+ *.sh) me=${me%.sh} ;;
+ esac
+
+# Source extra package-specific configuration.
+. test-defs.sh
+# And fail hard if something went wrong.
+test $? -eq 0 || exit 99
+
+# We use a trap below for cleanup. This requires us to go through
+# hoops to get the right exit status transported through the signal.
+# Turn off errexit here so that we don't trip the bug with OSF1/Tru64
+# sh inside this function (FIXME: is this still relevant now that we
+# require a POSIX shell?).
+_am_exit ()
+{
+ set +e
+ # See comments in the exit trap for the reason we do this.
+ test 77 = $1 && am__test_skipped=yes
+ # Spurious escaping to ensure we do not call our 'exit' alias.
+ (\exit $1); \exit $1
+}
+# Avoid interferences from the environment
+am__test_skipped=no
+# This alias must actually be placed before any use if 'exit' -- even
+# just inside a function definition. Weird, but real.
+alias exit=_am_exit
+
+## ------------------------------------ ##
+## General testsuite shell functions. ##
+## ------------------------------------ ##
+
+# Print warnings (e.g., about skipped and failed tests) to this file
+# number. Override by putting, say:
+# AM_TESTS_ENVIRONMENT = stderr_fileno_=9; export stderr_fileno_;
+# AM_TESTS_FD_REDIRECT = 9>&2
+# in your Makefile.am.
+# This is useful when using automake's parallel tests mode, to print the
+# reason for skip/failure to console, rather than to the *.log files.
+: ${stderr_fileno_=2}
+
+# Helper functions used by "plain" tests of the Automake testsuite
+# (i.e., tests that don't use any test protocol).
+# TAP tests will override these functions with their TAP-enhanced
+# equivalents later (see sourcing of 'tap-functions.sh' below).
+# These are copied from Gnulib's 'tests/init.sh'.
+warn_ () { echo "$@" 1>&$stderr_fileno_; }
+fail_ () { warn_ "$me: failed test: $@"; exit 1; }
+skip_ () { warn_ "$me: skipped test: $@"; exit 77; }
+fatal_ () { warn_ "$me: hard error: $@"; exit 99; }
+framework_failure_ () { warn_ "$me: set-up failure: $@"; exit 99; }
+# For compatibility with TAP functions.
+skip_all_ () { skip_ "$@"; }
+
+if test $am_test_protocol = tap; then
+ . tap-functions.sh
+fi
+
+## ---------------------------- ##
+## 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
+}
+
+# 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 "$@"
+}
+
+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.
+
+## ---------------------------------------------------------------- ##
+## Create and set up of the temporary directory used by the test. ##
+## Set up of the exit trap for cleanup of said directory. ##
+## ---------------------------------------------------------------- ##
+
+# Set up the exit trap.
+am_exit_trap ()
+{
+ exit_status=$1
+ set +e
+ cd "$am_top_builddir"
+ if test $am_test_protocol = tap; 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_ $am_test_subdir
+ set +x
+ echo "$me: exit $exit_status"
+ # Spurious escaping to ensure we do not call our "exit" alias.
+ \exit $exit_status
+}
+
+am_set_exit_traps ()
+{
+ trap 'am_exit_trap $?' 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
+ # - 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
+}
+
+am_test_setup ()
+{
+ process_requirements $required
+ am_set_exit_traps
+ # Create and populate the temporary directory, if required.
+ if test x"$am_create_testdir" = x"no"; then
+ am_test_subdir=
+ else
+ am_setup_testdir
+ fi
+ am_extra_info
+ set -x
+ pwd
+}
# Forced colorization should take place also with non-ANSI
# terminals; hence this setting.
TERM=dumb; export TERM
- am_opts='color-tests'
;;
no)
- am_opts=''
;;
*)
fatal_ "invalid use_colors='$use_colors'";;
cat > configure.ac <<END
AC_INIT([GNU AutoFoo], [7.1], [bug-automake@gnu.org])
-AM_INIT_AUTOMAKE([$am_opts])
+AM_INIT_AUTOMAKE
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
END
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2007-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/>.
+
+# Check that the 'color-tests' option, now active by default, is
+# nonetheless still silently accepted, for backward compatibility.
+
+. ./defs || exit 1
+
+cat >configure.ac <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE([color-tests])
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
+END
+
+cat >Makefile.am <<END
+AUTOMAKE_OPTIONS = color-tests
+TESTS = foo.test
+END
+
+: > test-driver
+
+$ACLOCAL
+$AUTOMAKE
+
+:
END
cat >Makefile.am <<'END'
-AUTOMAKE_OPTIONS = color-tests
TESTS = $(check_SCRIPTS)
check_SCRIPTS = pass fail skip xpass xfail error
XFAIL_TESTS = xpass xfail
# Do the tests.
-cat >>configure.ac <<END
+cat >>configure.ac << 'END'
+if $testsuite_colorized; then :; else
+ AC_SUBST([AM_COLOR_TESTS], [no])
+fi
AC_OUTPUT
END
cat >Makefile.am <<'END'
-AUTOMAKE_OPTIONS = color-tests
TESTS = $(check_SCRIPTS)
check_SCRIPTS = pass fail skip xpass xfail error
XFAIL_TESTS = xpass xfail
cat stdout
test_no_color
+ $srcdir/configure testsuite_colorized=false
+
+ TERM=ansi MAKE=$MAKE expect -f $srcdir/expect-make >stdout \
+ || { cat stdout; exit 1; }
+ cat stdout
+ test_no_color
+
+ TERM=ansi MAKE="env AM_COLOR_TESTS=always $MAKE" \
+ expect -f $srcdir/expect-make >stdout || { cat stdout; exit 1; }
+ cat stdout
+ test_color
+
$MAKE distclean
cd $srcdir
return 1
;;
*)
+ case $1 in
+ # Do not use --version, or older versions bzip2 would try to
+ # compress stdin. This would cause binary output in the test
+ # logs, with potential breakage of our testsuite harness.
+ bzip2) o=--help;;
+ # OpenSolaris zip do not support the '--version' option, but
+ # accepts the '-v' one with a similar meaning (if no further
+ # arguments are given).
+ zip) o=-v;;
+ # Assume the other compressors we care about support the
+ # '--version' option.
+ *) o=--version;;
+ esac
# Redirect to stderr to avoid polluting the output, in case this
# function is used in a command substitution (as it is, below).
- if $1 --version </dev/null >&2; then
+ if $1 $o </dev/null >&2; then
return 0
else
return 1
;;
dest)
build=build-$test_name
- dest=$ocwd/$test_string
+ # Also use $test_name in the definition of $dest, to avoid
+ # interferences among different tests in case $test_string
+ # is strangely munged (which is not unexpected, considering
+ # how tricky its characters are). With some shells, this
+ # has already happened (at least on OpenIndiana 11 and on
+ # Solaris 10).
+ dest=$ocwd/dest-$test_name/$test_string
mkdir "$build" || fatal_ "cannot create '$build'"
;;
*)
XFAIL_TESTS = \
t/all.sh \
-t/yacc-bison-skeleton-cxx.sh \
-t/yacc-bison-skeleton.sh \
t/cond17.sh \
t/gcj6.sh \
t/override-conditional-2.sh \
t/instdir-cond2.sh \
t/java-nobase.sh \
t/objext-pr10128.sh \
-t/parallel-tests-many.sh \
t/pr8365-remake-timing.sh \
t/lex-subobj-nodep.sh \
t/remake-am-pr10111.sh \
handwritten_TESTS = \
t/get-sysconf.sh \
$(perl_TESTS) \
-$(perf_TESTS) \
t/instspc.tap \
t/aclocal.sh \
t/aclocal3.sh \
t/colon5.sh \
t/colon6.sh \
t/colon7.sh \
-t/color.sh \
-t/color2.sh \
+t/color-tests.sh \
+t/color-tests2.sh \
+t/color-tests-opt.sh \
t/comment.sh \
t/comment2.sh \
t/comment3.sh \
t/parallel-tests-console-output.sh \
t/parallel-tests-once.sh \
t/parallel-tests-trailing-bslash.sh \
-t/parallel-tests-many.sh \
t/tests-environment.sh \
t/am-tests-environment.sh \
t/tests-environment-backcompat.sh \
t/rulepat.sh \
t/self-check-configure-help.sh \
t/self-check-dir.tap \
-t/self-check-env-sanitize.tap \
t/self-check-exit.tap \
t/self-check-explicit-skips.sh \
t/self-check-is_newest.tap \
t/self-check-report.sh \
t/self-check-seq.tap \
t/self-check-is-blocked-signal.tap \
-t/self-check-tap.sh \
t/self-check-unindent.tap \
t/sanity.sh \
t/scripts.sh \
# special target, the output from make is sufficiently complete.
#
# This test exercises the GCS-mandated targets (except for dist)
-# as well as tags, TAGS.
+# as well as tags.
# For gen-testsuite-part: ==> try-with-serial-tests <==
. ./defs || exit 1
@: > stamp-installcheck-sub
tags:
@: > stamp-tags-sub
-TAGS:
- @: > stamp-TAGS-sub
mostlyclean-local:
@: > stamp-mostlyclean-sub
maintainer-clean-local:
@: > sub2-$@-should-not-be-executed
install-info install-html install-dvi install-pdf install-ps:
@: > sub2-$@-should-not-be-executed
-installcheck installdirs tags TAGS mostlyclean:
+installcheck installdirs tags mostlyclean:
@: > sub2-$@-should-not-be-executed
## These targets cannot be overridden like this:
## install-strip distclean maintainer-clean
all install install-strip uninstall clean distclean check \
info html dvi pdf ps \
install-info install-html install-dvi install-pdf install-ps \
- installcheck installdirs tags TAGS mostlyclean maintainer-clean
+ installcheck installdirs tags mostlyclean maintainer-clean
do
$MAKE -n $target >stdout || { cat stdout; exit 1; }
cat stdout
case $target in
- install-* | installdirs | tags | TAGS ) ;;
+ install-* | installdirs | tags ) ;;
*)
if $have_dotmake; then
grep "stamp-$target$" stdout || exit 1
return $st
}
-./missing b7cb8259 --version && exit 1
+run_cmd ./missing b7cb8259 --version && exit 1
grep WARNING stderr && exit 1
run_cmd ./missing b7cb8259 --grep && exit 1
-grep 'WARNING:.*missing on your system' stderr
+
+if test x"$am_test_prefer_config_shell" != x"yes"; then
+ # The /bin/sh from Solaris 10 is a spectacular failure. After a failure
+ # due to a "command not found", it sets '$?' to '1'.
+ if (st=0; /bin/sh -c 'no--such--command' || st=$?; test $st -eq 127); then
+ grep 'WARNING:.*missing on your system' stderr
+ fi
+fi
# missing itself it known to exist :)
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Check that the parallel testsuite harness does not hit errors due
-# to an exceeded command line length when there are many tests.
-# For automake bug#7868. This test is currently expected to fail.
-
-. ./defs || exit 1
-
-cat >> configure.ac << 'END'
-AC_OUTPUT
-END
-
-cat > Makefile.am <<'END'
-# Sanity check that the $(TESTS) is going to exceed the system
-# command line length.
-# Extra quoting and indirections below are required to ensure the
-# various make implementations (e.g, GNU make or Sun Distributed Make)
-# will truly spawn a shell to execute this command, instead of relying
-# on optimizations that might mask the "Argument list too long" error
-# we expect.
-this-will-fail:
- @":" && ":" $(TEST_LOGS)
-TEST_LOG_COMPILER = true
-include list-of-tests.am
-# So that we won't have to create a ton of dummy test cases.
-$(TESTS):
-END
-
-# The real instance will be dynamically created later.
-echo TESTS = foo.test > list-of-tests.am
-
-$ACLOCAL && $AUTOCONF && $AUTOMAKE -a \
- || framework_failure_ "unexpected autotools failure"
-./configure \
- || framework_failure_ "unexpected configure failure"
-
-# We want to hit the system command-line length limit without hitting
-# the filename length limit or the PATHMAX limit; so we use longish
-# (but not too long) names for the testcase, and place them in a nested
-# (but not too deeply) directory.
-# We also prefer to use the minimal(ish) number of test cases that can
-# make us hit the command-line length limit, since the more the test
-# cases are, the more time "automake" and "make check" will take to run
-# (especially on Cygwin and MinGW/MSYS).
-
-tname="wow-this-is-a-very-long-name-for-a-simple-dummy-test-case"
-dname="and-this-too-is-a-very-long-name-for-a-dummy-directory"
-
-deepdir=.
-depth=0
-for i in 1 2 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 29 21 22 23 24; do
- new_deepdir=$deepdir/$dname.d$i
- mkdir $new_deepdir || break
- tmpfile=$new_deepdir/$tname-some-more-chars-for-good-measure
- if touch $tmpfile; then
- rm -f $tmpfile || exit 99
- else
- rmdir $new_deepdir || exit 99
- fi
- deepdir=$new_deepdir
- unset tmpfile new_deepdir
- depth=$i
-done
-
-cat <<END
-*********************************************************************
-Our tests will be in the following directory (depth = $depth)
-*********************************************************************
-$deepdir
-*********************************************************************
-END
-
-setup_data ()
-{
- # Use perl, not awk, to avoid errors like "awk: string too long"
- # (seen e.g. with Solaris 10 /usr/bin/awk).
- count=$count deepdir=$deepdir tname=$tname $PERL -e '
- use warnings FATAL => "all";
- use strict;
- print "TESTS = \\\n";
- my $i = 0;
- while (++$i)
- {
- print " $ENV{deepdir}/$ENV{tname}-$i.test";
- if ($i >= $ENV{count})
- {
- print "\n";
- last;
- }
- else
- {
- print " \\\n";
- }
- }
- ' > list-of-tests.am || exit 99
- sed 20q list-of-tests.am || exit 99 # For debugging.
- $AUTOMAKE Makefile \
- || framework_failure_ "unexpected automake failure"
- ./config.status Makefile \
- || framework_failure_ "unexpected config.status failure"
-}
-
-for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
- test $count = E_HUGE && break
- count=$(($count * 100))
- setup_data
- if $MAKE this-will-fail; then
- continue
- else
- # We have managed to find a number of test cases large enough to
- # hit the system command-line limits; we can stop. But first, for
- # good measure, increase the number of tests of some 20%, to be
- # "even more sure" of really tickling command line length limits.
- count=$(($count * 12))
- count=$(($count / 10))
- setup_data
- break
- fi
-done
-
-if test $count = E_HUGE; then
- framework_failure_ "system has a too-high limit on command line length"
-else
- cat <<END
-*********************************************************************
- Number of tests we will use: $count
-*********************************************************************
-END
-fi
-
-env TESTS=$deepdir/$tname-1.test $MAKE -e check \
- && test -f $deepdir/$tname-1.log \
- || framework_failure_ "\"make check\" with one single tests"
-
-rm -f $deepdir/* || exit 99
-
-$MAKE check > stdout || { cat stdout; exit 1; }
-cat stdout
-
-grep "^# TOTAL: $count$" stdout
-grep "^# PASS: $count$" stdout
-
-grep "^PASS: .*$tname-[0-9][0-9]*\.test" stdout > grp
-ls -1 $deepdir | grep '\.log$' > lst
-
-sed 20q lst # For debugging.
-sed 20q grp # Likewise.
-
-test $(cat <grp | wc -l) -eq $count
-test $(cat <lst | wc -l) -eq $count
-
-# We need to simulate a failure of two tests.
-st=0
-env TESTS="$deepdir/$tname-1.test $deepdir/$tname-2.test" \
- TEST_LOG_COMPILER=false $MAKE -e check > stdout && st=1
-cat stdout
-test $(grep -c '^FAIL:' stdout) -eq 2 || st=1
-test $st -eq 0 || fatal_ "couldn't simulate failure of two tests"
-unset st
-
-$MAKE recheck > stdout || { cat stdout; exit 1; }
-cat stdout
-grep "^PASS: .*$tname-1\.test" stdout
-grep "^PASS: .*$tname-2\.test" stdout
-test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 2
-grep "^# TOTAL: 2$" stdout
-grep "^# PASS: 2$" stdout
-
-# "make clean" might ignore some failures, so we prefer to also grep its
-# output to ensure that no "Argument list too long" error was encountered.
-$MAKE clean >output 2>&1 || { cat output; exit 1; }
-cat output
-grep -i 'list.* too long' output && exit 1
-ls $deepdir | grep '\.log$' && exit 1
-
-:
test -f '$(bindir)/libquux.a'
ls -l '$(libexecdir)/bar.h'
test -f '$(libexecdir)/bar.h'
- test ! -x '$(libexecdir)/bar.h'
+## If this test is run as root, "test -x" could suceed also for
+## non-executable files, so we need to protect the next check.
+## See automake bug#12041.
+ if test -x Makefile; then echo SKIP THIS; else \
+ test ! -x '$(libexecdir)/bar.h'; \
+ fi;
END
cat > foo.c <<'END'
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Sanity check for the automake testsuite.
-# Make sure that the testsuite initialization code complains when
-# some testsuite-influential variables are set in the environment.
-
-am_create_testdir=no
-. ./defs || exit 1
-
-set -x
-exec 5>&1
-
-plan_ 16 # Two times the number of variable names in $vars.
-
-vars='
- required
- am_serial_tests
- am_using_tap
- am_create_testdir
- am_tap_implementation
- am_test_prefer_config_shell
- am_original_AUTOMAKE
- am_original_ACLOCAL
-'
-
-do_run ()
-{
- env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test
-}
-
-do_grep ()
-{
- env "$1=foo" $AM_TEST_RUNNER_SHELL -c '. ./defs' foo.test 2>&1 1>&5 \
- | grep "foo\.test:.* variable '$1'.* in the environment.*unsafe"
-}
-
-for var in $vars; do
- command_ok_ "$var [err status]" not do_run $var
- command_ok_ "$var [err message]" do_grep $var
-done
-
-:
" dummy.sh
}
-run_dummy_test '(exit 77); exit 77'
+run_dummy_test 'exit 77'
test $? -eq 77 || exit 1
run_dummy_test 'sh -c "exit 77"' am_explicit_skips=no
test $? -eq 77 || exit 1
-run_dummy_test '(exit 77); exit 77' am_explicit_skips=yes
+run_dummy_test '$PERL -e "exit 77"; true' am_explicit_skips=yes
test $? -eq 78 || exit 1
-run_dummy_test 'sh -c "exit 77"' am_explicit_skips=y
+run_dummy_test 'sh -c "exit 77"; exit 0' am_explicit_skips=y
test $? -eq 78 || exit 1
-run_dummy_test 'exit 77' am_explicit_skips=yes
-test $? -eq 77 || exit 1
-
-run_dummy_test 'skip_ "foo"' am_explicit_skips=y
+run_dummy_test 'skip_ "foo"; :' am_explicit_skips=y
test $? -eq 77 || exit 1
:
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Sanity check for the automake testsuite.
-# Make sure that $am_using_tap gets automatically defined by
-# './defs-static', but can be overridden by the individual tests.
-
-. ./defs-static || exit 1
-
-set -ex
-
-$AM_TEST_RUNNER_SHELL -c \
- '. ./defs-static && test $am_using_tap = yes' foo.tap
-
-for name in foo.test tap tap.test foo-tap; do
- $AM_TEST_RUNNER_SHELL -c \
- '. ./defs-static && test $am_using_tap = no' $name
-done
-
-$AM_TEST_RUNNER_SHELL -c '
- am_using_tap=no
- . ./defs-static
- test $am_using_tap = no
-' foo.tap
-
-$AM_TEST_RUNNER_SHELL -c '
- am_using_tap=yes
- . ./defs-static
- test $am_using_tap = yes
-' foo.test
-
-:
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..6
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..14
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
First line
am_tap_implementation=shell
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test <<END
1..1
TESTS = $tests
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > exit.test << 'END'
#!/bin/sh
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo AM_TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# Various errors that can all be squashed into a single test script.
cat > foo.test << 'END'
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
: > exp
few.test many.test order.test afterlate.test
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test << 'END'
1..5
c.log: b.log
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test << 'END'
#!/bin/sh
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
metacharacters=\''"\$!&()[]<>#;^?*'
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
sed 's/\$$//' > all.test <<END
1..1$
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# Empty TAP input.
: > empty.test
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..8
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..2
chmod a+x *.test
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
$MAKE check >stdout && { cat stdout; exit 1; }
cat stdout
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
#
# From manpage Test::Harness::TAP(3):
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
#
# From manpage Test::Harness::TAP(3):
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > ok.test << 'END'
1..5
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > ok.test <<END
1..3
TEST_SUITE_LOG = global.log
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# Custom markers, for use in grepping checks.
cmarker=::: # comment marker
TESTS = all.test
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
#!/bin/sh
chmod a+x foo.test
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
$MAKE check >stdout && { cat stdout; exit 1; }
cat stdout
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo 'Bail out! 0' > a.test
echo 'Bail out! 0.0' > b.test
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test << 'END'
1..3
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test << 'END'
1..14
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo '1..0 # SKIP 0' > a.test
echo '1..0 # SKIP 0.0' > b.test
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test << 'END'
1..10
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..7
TESTS = bail.test few.test noplan.test
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > bail.test <<END
1..1
TESTS = all.test
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
#!/bin/sh
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > prefixes <<'END'
A
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..1
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo 1..5 > all.test
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..4
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..5
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
do_checks ()
{
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# Some random numbers to be used as test names. The definitions below are
# selected so that $x<n> != <n> for every n >= 1. We can't use positional
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test <<END
1..3
echo TESTS += exit-$e.test >> Makefile.am
done
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
st=0
$MAKE check || st=$?
weirdchars=\''"\$@!&()[]<>#;,:.^?*/'
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
#
# Only successful tests.
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# -------------------------------------------------------------------------
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
my_check ()
{
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test <<END
1..01
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test <<END
1..1 foo
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > top1.test <<END
non-TAP line, ignored
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
sed 's/\$$//' > foo.test <<END
1..2 $
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > top.test <<END
1..3
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo TEST_LOG_DRIVER_FLAGS = --comments >> Makefile
echo TESTS = one.test two.test > Makefile.am
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > one.test <<'END'
#!/bin/sh
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..0 # SKIP
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# These nested loops below are clearer without indentation.
i=0
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > foo.test <<END
some non-TAP text, will be copied in the global log
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..0
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > foo.test <<END
1..0 # SKIP
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
ok 1
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > foo.test <<END
1..0${tab}${tab} #${tab}SKIP ${tab}Strip leading & trailing ${tab}${tab}
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
weirdchars=\''"$!&()[]<>#;^?*/@%=,.:'
cat > Makefile.am << 'END'
TESTS = all.test
+AM_COLOR_TESTS= no
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+
+. tap-setup.sh
cat > all.test <<'END'
#! /bin/sh
baz.log: zardoz
END
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
: > zardoz
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..5
# TAP support:
# - colorized testsuite summary
-. ./defs-static
+. test-lib.sh
use_colors=yes
-. "$am_testauxdir"/tap-summary-aux.sh
+. tap-summary-aux.sh
# TAP support:
# - colorized testsuite summary
-. ./defs-static
+. test-lib.sh
use_colors=no
-. "$am_testauxdir"/tap-summary-aux.sh
+. tap-summary-aux.sh
fi
fi
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > a.test <<END
1..1
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..2
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > stub.tap <<END
1 # TODO
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# ----------------------------------------------------- #
# Check all possible combinations of: #
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<END
1..1
chmod a+x *.test
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
# Don't care about exit status or number of test results, they should be
# checked for in many other tests.
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
cat > all.test <<'END'
1..7
. ./defs || exit 1
-. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
+. tap-setup.sh
echo 'XFAIL_TESTS = $(TESTS)' >> Makefile
# Check coloring of the testsuite summary.
-. ./defs-static || exit 1
+. test-lib.sh
-use_colors=yes
-use_vpath=no
-
-. "$am_testauxdir"/testsuite-summary-checks.sh || exit 99
+use_colors=yes; use_vpath=no
+. testsuite-summary-checks.sh
./configure
# Check test counts in the testsuite summary.
-. ./defs-static || exit 1
+. test-lib.sh
-use_colors=no
-use_vpath=no
-
-. "$am_testauxdir"/testsuite-summary-checks.sh || exit 99
+use_colors=no; use_vpath=no
+. testsuite-summary-checks.sh
./configure
# On Solaris 10, if '/bin/rm' is run with the '-f' option, it doesn't
# print any error message when failing to remove a file (due to e.g.,
-# "Permission denied"). Yikes. We'll cater to this incompatibility
-# by relaxing a test below if a faulty 'rm' is detected.
-st=0; rm -f d/f 2>stderr || st=$?
+# "Permission denied"). And it gets weirder. On OpenIndiana 11, the
+# /bin/sh shell (in many respects a decent POSIX shell) seems to somehow
+# "eat" the error message from 'rm' in some situation, although the 'rm'
+# utility itself correctly prints it when invoked from (say) 'env' or
+# 'bash'. Yikes.
+# We'll cater to these incompatibilities by relaxing a test below if
+# a faulty shell or 'rm' program is detected.
+st=0; $SHELL -c 'rm -f d/f' 2>stderr || st=$?
cat stderr >&2
test $st -gt 0 || skip_ "can delete files from unwritable directories"
if grep 'rm:' stderr; then
$AUTOMAKE
$AUTOCONF
-# Make it harder to experience false postives when grepping error messages.
+# Weird name, to make it harder to experience false positives when
+# grepping error messages.
inst=__inst-dir__
./configure --prefix="$(pwd)/$inst"
}
END
-echo '#define BARBAR "Zardoz!\n"' > foo.h
+# Use printf, not echo, to avoid '\n' being considered and escape
+# sequence and printed as a newline in 'foo.h'.
+printf '%s\n' '#define BARBAR "Zardoz!\n"' > foo.h
cat > foo.vapi <<'END'
[CCode (cprefix="", lower_case_cprefix="", cheader_filename="foo.h")]
# Simple check on remake rules.
$sleep
-echo '#define BAZBAZ "Quux!\n"' > foo.h
+# Use printf, not echo, to avoid '\n' being considered and escape
+# sequence and printed as a newline in 'foo.h'.
+printf '%s\n' '#define BAZBAZ "Quux!\n"' > foo.h
sed 's/BARBAR/BAZBAZ/' zardoz.vala > t && mv -f t zardoz.vala || exit 99
$MAKE && exit 1
sed 's/BARBAR/BAZBAZ/' foo.vapi > t && mv -f t foo.vapi || exit 99
-#!/bin/sh
+#!@PERL@ -w
# @configure_input@
# Copyright (C) 2012 Free Software Foundation, Inc.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-fi
-
-perllibdir="@abs_top_builddir@/lib@PATH_SEPARATOR@@abs_top_srcdir@/lib"
-export perllibdir
-
-exec "@abs_top_builddir@/aclocal" "--automake-acdir=@abs_top_srcdir@/m4" \
- "--system-acdir=@abs_top_srcdir@/m4/acdir" ${1+"$@"}
+BEGIN
+{
+ use strict;
+ my $libdir;
+ $libdir = '@abs_top_srcdir@/lib';
+ $libdir = '@abs_top_builddir@/lib' . '@PATH_SEPARATOR@' . $libdir
+ if '@srcdir@' ne '.';
+ $ENV{perllibdir} = $libdir;
+ unshift @ARGV,
+ '--automake-acdir=@abs_top_srcdir@/m4',
+ '--system-acdir=@abs_top_srcdir@/m4/acdir';
+}
+require '@abs_top_builddir@/aclocal';
-#!/bin/sh
+#!@PERL@ -w
# @configure_input@
# Copyright (C) 2012 Free Software Foundation, Inc.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
-fi
-
-perllibdir="@abs_top_builddir@/lib@PATH_SEPARATOR@@abs_top_srcdir@/lib"
-export perllibdir
-exec "@abs_top_builddir@/automake" "--libdir=@abs_top_srcdir@/lib" ${1+"$@"}
+BEGIN
+{
+ use strict;
+ my $libdir;
+ $libdir = '@abs_top_srcdir@/lib';
+ $libdir = '@abs_top_builddir@/lib' . '@PATH_SEPARATOR@' . $libdir
+ if '@srcdir@' ne '.';
+ $ENV{perllibdir} = $libdir;
+ unshift @ARGV, '--libdir=@abs_top_srcdir@/lib';
+}
+require '@abs_top_builddir@/automake';
cat > zardoz.yy << 'END'
%skeleton "lalr1.cc"
%defines
+%locations
+%union
+{
+ int ival;
+};
%{
-#define YYSTYPE int
-int yylex(YYSTYPE* yylval_param);
+int yylex (yy::parser::semantic_type *yylval,
+ yy::parser::location_type *yylloc);
%}
%%
%%
int
-yylex(YYSTYPE*)
+yylex (yy::parser::semantic_type *yylval,
+ yy::parser::location_type *yylloc)
{
- return 0;
+ return 0;
}
void
-yy::parser::error(const yy::parser::location_type&, const std::string& m)
+yy::parser::error(const yy::parser::location_type&, const std::string&)
{
- return;
+ return;
}
END
cat > foo.cc << 'END'
#include "zardoz.hh"
-using namespace std;
-
int
main(int argc, char** argv)
{
bin_PROGRAMS = zardoz
zardoz_SOURCES = zardoz.y foo.c
AM_YFLAGS = -d --skeleton glr.c
+BUILT_SOURCES = zardoz.h
END
# Parser.
cat > zardoz.y << 'END'
%{
-int yylex () { return 0; }
-void yyerror (const char *s) { return; }
+int yylex ();
+void yyerror (const char *s);
%}
%%
foobar : 'f' 'o' 'o' 'b' 'a' 'r' {};
+%%
+int yylex () { return 0; }
+void yyerror (const char *s) { return; }
END
cat > foo.c << 'END'
x : 'x' {};
%%
END
-cp foo/parse.y bar/parse.y
+# Using ylwrap, we actually generate y.tab.[ch]. Unfortunately, we
+# forgot to rename #include "y.tab.h" into #include "parse.h" during
+# the conversion from y.tab.c to parse.c. This was OK when Bison was
+# not issuing such an #include (up to 2.6).
+#
+# To make sure that we perform this conversion, in bar/parse.y, use
+# y.tab.h instead of parse.c.
+sed -e 's/parse\.h/y.tab.h/' <foo/parse.y >bar/parse.y
cat > foo/main.c << 'END'
#include "parse.h"