$(sc_obsolete_requirements_rules) \
sc_tests_obsolete_variables \
sc_tests_here_document_format \
+sc_tests_command_subst \
sc_tests_Exit_not_exit \
sc_tests_automake_fails \
sc_tests_required_after_defs \
exit 1; \
fi
+## Our test case should use the $(...) POSIX form for command substitution,
+## rather than the older `...` form.
+## The point of ignoring text on here-documents is that we want to exempt
+## Makefile.am rules, configure.ac code and helper shell script created and
+## used by out shell scripts, because Autoconf (as of version 2.69) does not
+## yet ensure that $CONFIG_SHELL will be set to a proper POSIX shell.
+sc_tests_command_subst:
+ @found=false; \
+ scan () { \
+ sed -n -e '/^#/d' \
+ -e '/<<.*END/,/^END/b' -e '/<<.*EOF/,/^EOF/b' \
+ -e 's/\\`/\\{backtick}/' \
+ -e "s/[^\\]'\([^']*\`[^']*\)*'/'{quoted-text}'/g" \
+ -e '/`/p' $$*; \
+ }; \
+ for file in $(xtests); do \
+ res=`scan $$file`; \
+ if test -n "$$res"; then \
+ echo "$$file:$$res"; \
+ found=true; \
+ fi; \
+ done; \
+ if $$found; then \
+ echo 'Use $$(...), not `...`, for command substitutions.' >&2; \
+ exit 1; \
+ fi
+
## Tests should never call exit directly, but use Exit.
## This is so that the exit status is transported correctly across the 0 trap.
## Ignore comments and our testsuite's own self tests.
Writing test cases
==================
-
-Do
---
-
- If you plan to fix a bug, write the test case first. This way you'll
+* If you plan to fix a bug, write the test case first. This way you'll
make sure the test catches the bug, and that it succeeds once you have
fixed the bug.
- Add a copyright/license paragraph.
+* Add a copyright/license paragraph.
- Explain what the test does.
+* Explain what the test does, i.e., which features it checks, which
+ invariants it verifies, or what bugs/issues it guard against.
- Cite the PR number (if any), and the original reporter (if any), so
+* Cite the PR number (if any), and the original reporter (if any), so
we can find or ask for information if needed.
- If a test checks examples or idioms given in the documentation, make
- sure the documentation reference them appropriately in comments, as in:
+* If a test checks examples or idioms given in the documentation, make
+ sure the documentation reference them appropriately in comments, as
+ with:
+
@c Keep in sync with autodist-config-headers.sh
@example
...
@end example
- Use "required=..." for required tools. Do not explicitly require
+* Use "required=..." for required tools. Do not explicitly require
tools which can be taken for granted because they're listed in the
GNU Coding Standards (for example, 'gzip').
- Include ./defs in every test script (see existing tests for examples
+* Include ./defs in every test script (see existing tests for examples
of how to do this).
- Use the 'skip_' function to skip tests, with a meaningful message if
+* Use the 'skip_' function to skip tests, with a meaningful message if
possible. Where convenient, use the 'warn_' function to print generic
warnings, the 'fail_' function for test failures, and the 'fatal_'
function for hard errors. In case a hard error is due to a failed
set-up of a test scenario, you can use the 'framework_fail_' function
instead.
- For those tests checking the Automake-provided test harnesses that are
- expected to work also when the 'serial-tests' Automake option is used
- (thus causing the serial testsuite harness to be used in the generated
- Makefile), place a line containing "try-with-serial-tests" somewhere
- in the file. That will ensure that the 'gen-testsuite-part' script
- generates a sibling of that test which uses the serial harness instead
- of the parallel one. For those tests that are *not* meant to work with
- the parallel testsuite harness at all (these should be very very few),
+* For those tests checking the Automake-provided test harnesses that
+ are expected to work also when the 'serial-tests' Automake option
+ is used (thus causing the serial testsuite harness to be used in the
+ generated Makefile), place a line containing "try-with-serial-tests"
+ somewhere in the file (usually in a comment).
+ That will ensure that the 'gen-testsuite-part' script generates a
+ sibling of that test which uses the serial harness instead of the
+ parallel one. For those tests that are *not* meant to work with the
+ parallel testsuite harness at all (these should be very very few),
set the shell variable 'am_serial_tests' to "yes" before including
./defs.
- Some tests in the Automake testsuite are auto-generated; those tests
+* Some tests in the Automake testsuite are auto-generated; those tests
might have custom extensions, but their basename (that is, with such
extension stripped) is expected to end with "-w" string, optionally
followed by decimal digits. For example, the name of a valid
to be confused with auto-generated tests; for example, 'u-v-w.sh'
or 'option-w0.tap' are *not* valid name for hand-written tests.
- ./defs brings in some commonly required files, and sets a skeleton
+* ./defs brings in some commonly required files, and sets a skeleton
configure.ac. If possible, append to this file. In some cases
you'll have to overwrite it, but this should be the exception. Note
that configure.ac registers Makefile.in but do not output anything by
test directory (which is a rare occurrence), set the 'am_create_testdir'
shell variable to "empty" before sourcing ./defs.
- By default, the testcases are run with the errexit shell flag on,
+* By default, the testcases are run with the errexit shell flag on,
to make it easier to catch failures you might not have thought of.
If this is undesirable in some testcase, you can use "set +e" to
disable the errexit flag (but please do so only if you have a very
good reason).
- End the test script with a ":" or "Exit 0". Otherwise, when somebody
+* End the test script with a ':' command. Otherwise, when somebody
changes the test by adding a failing command after the last command,
- the test will spuriously fail because $? is nonzero at the end. Note
- that this is relevant even if the errexit shell flag is on, in case
- the test contains commands like "grep ... Makefile.in && Exit 1" (and
- there are indeed a lot of such tests).
+ the test will spuriously fail because '$?' is nonzero at the end.
+ Note that this is relevant even if the errexit shell flag is on, in
+ case the test contains commands like "grep ... Makefile.in && Exit 1"
+ (and there are indeed a lot of such tests).
- Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER,
+* Use $ACLOCAL, $AUTOMAKE, $AUTOCONF, $AUTOUPDATE, $AUTOHEADER,
$PERL, $MAKE, $EGREP, and $FGREP, instead of the corresponding
commands.
- Use $sleep when you have to make sure that some file is newer
+* Use '$sleep' when you have to make sure that some file is newer
than another.
- Use cat or grep or similar commands to display (part of) files that
+* Use cat or grep or similar commands to display (part of) files that
may be interesting for debugging, so that when a user send a verbose
output we don't have to ask him for more details. Display stderr
output on the stderr file descriptor. If some redirected command is
likely to fail, display its output even in the failure case, before
exiting.
- Use 'Exit' rather than 'exit' to abort for leave early from a test
+* Use 'Exit' rather than 'exit' to abort for leave early from a test
case.
- Use '$PATH_SEPARATOR', not hard-coded ':', as the separator of
+* Use '$PATH_SEPARATOR', not hard-coded ':', as the separator of
PATH's entries.
- It's more important to make sure that a feature works, than make
+* It's more important to make sure that a feature works, than make
sure that Automake's output looks correct. It might look correct
and still fail to work. In other words, prefer running 'make' over
grepping Makefile.in (or do both).
- If you run $ACLOCAL, $AUTOMAKE or $AUTOCONF several times in the
+* If you run $ACLOCAL, $AUTOMAKE or $AUTOCONF several times in the
same test and change configure.ac by the meantime, do
+
rm -rf autom4te*.cache
+
before the following runs. On fast machines the new configure.ac
could otherwise have the same timestamp as the old autom4te.cache.
- Use filenames with two consecutive spaces when testing that some
+* Use filenames with two consecutive spaces when testing that some
code preserves filenames with spaces. This will catch errors like
`echo $filename | ...`.
- Make sure your test script can be used to faithfully check an
+* Make sure your test script can be used to faithfully check an
installed version of automake (as with "make installcheck"). For
example, if you need to copy or grep an automake-provided script,
do not assume that they can be found in the '$top_srcdir/lib'
such "$am_...dir" variables can be found in the 'defs-static.in'
file.
- When writing input for lex, include the following in the definitions
+* When writing input for lex, include the following in the definitions
section:
+
%{
#define YY_NO_UNISTD_H 1
%}
+
to accommodate non-ANSI systems, since GNU flex generates code that
includes unistd.h otherwise. Also add:
+
int isatty (int fd) { return 0; }
+
to the definitions section if the generated code is to be compiled
by a C++ compiler, for similar reasons (i.e., the isatty(3) function
from that same unistd.h header would be required otherwise).
- Before commit: make sure the test is executable, add the tests to
+* Before commit: make sure the test is executable, add the tests to
TESTS in Makefile.am, add it to XFAIL_TESTS in addition if needed,
write a ChangeLog entry, send the diff to <automake-patches@gnu.org>.
-
-Do not
-------
-
- In test scripts, prefer using POSIX constructs over their old
+* In test scripts, prefer using POSIX constructs over their old
Bourne-only equivalents:
- use $(...), not `...`, for command substitution;
paraphrases like "if CMD; then :; else ...".
- prefer use of ${param%pattern} and ${param#pattern} parameter
expansions over processing by 'sed' or 'expr'.
-
- Note however that, when writing Makefile recipes or shell code in a
+
+* Note however that, when writing Makefile recipes or shell code in a
configure.ac, you should still use `...` instead, because the Autoconf
generated configure scripts do not ensure they will find a truly POSIX
shell (even though they will prefer and use it *if* it's found).
- Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
+* Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
years we'll discover that this test failed for some other bogus reason.
This happened many times. Better use something like
+
AUTOMAKE_fails
grep 'expected diagnostic' stderr
- (Note this doesn't prevent the test from failing for another reason,
- but at least it makes sure the original error is still here).
- Do not override Makefile variables using make arguments, as in e.g.:
+ Note this doesn't prevent the test from failing for another reason,
+ but at least it makes sure the original error is still here.
+
+* Do not override Makefile variables using make arguments, as in e.g.:
+
$MAKE prefix=/opt install
+
This is not portable for recursive targets (targets that call a
sub-make may not pass "prefix=/opt" along). Use the following
instead:
+
prefix=/opt $MAKE -e install
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Check verbose messages by `aclocal --install'.
+# Check verbose messages by 'aclocal --install'.
am_create_testdir=empty
. ./defs || Exit 1
for f in $files; do
command_ok_ \
"$pfx warn about missing file $f" \
- grep "required file ['\`]$build_aux/$f' not found" stderr
+ $FGREP "required file '$build_aux/$f' not found" stderr
# Suggest the user to use '--add-missing'.
command_ok_ \
"$pfx suggest --add-missing for $f" \
- grep ".*--add-missing.* install .*$f" stderr
+ grep ".*--add-missing.* install .*'$f'" stderr
done
# No files should be automatically installed by automake if it
# is not told to.
for f in $files; do
command_ok_ \
"$pfx report installation of $f" \
- grep ": installing ['\`]$build_aux/$f'$" stderr
+ $FGREP ": installing '$build_aux/$f'" stderr
done
# Only the expected files should be installed. But automake always
# require 'missing' and 'install-sh', so account for them.
AUTOMAKE_fails -Wnone
grep "^Makefile\.am:1:.*$warn_rx" stderr
# ansi2knr option in configure.ac
- echo > Makefile.am # `echo', not `:', for Solaris /bin/sh.
+ echo > Makefile.am # 'echo', not ':', for Solaris /bin/sh.
sed "s|^\\(AM_INIT_AUTOMAKE\\).*|\1([$opt])|" configure.sav >configure.ac
cat configure.ac # For debugging.
rm -rf autom4te*.cache
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list1=`$AUTOMAKE --help \
- | sed -n "/^$re.*always/,/^ *$/p" \
- | sed 1d`
+list1=$($AUTOMAKE --help \
+ | sed -n "/^$re.*always/,/^ *$/p" \
+ | sed 1d)
list1=$(echo $list1)
-list2=`$AUTOMAKE --help \
- | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
- | sed 1d`
+list2=$($AUTOMAKE --help \
+ | sed -n "/^$re.*under certain conditions/,/^ *$/p" \
+ | sed 1d)
list2=$(echo $list2)
test -n "$list1"
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list=`$AUTOMAKE --help \
- | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
- | sed 1d`
+list=$($AUTOMAKE --help \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
+ | sed 1d)
# Normalize whitespace, just in case.
list=$(echo $list)
# The automake manual states that the list of automatically-distributed
# files should be given by 'automake --help'.
-list=`$AUTOMAKE --help \
- | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
- | sed 1d`
+list=$($AUTOMAKE --help \
+ | sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
+ | sed 1d)
# Normalize whitespace, just in case.
list=$(echo $list)
AC_PROG_CC
AM_PROG_CC_C_O
AM_PROG_AR
-`if test $depcomp_with_libtool = yes; then
- echo AC_PROG_LIBTOOL
-else
- echo AC_PROG_RANLIB
-fi`
+$(if test $depcomp_with_libtool = yes; then
+ echo AC_PROG_LIBTOOL
+ else
+ echo AC_PROG_RANLIB
+ fi)
AC_CONFIG_FILES([Makefile src/Makefile])
AC_OUTPUT
END
}
if test $use_colors = yes; then
- red='\e[0;31m'
- grn='\e[0;32m'
- lgn='\e[1;32m'
- blu='\e[1;34m'
- mgn='\e[0;35m'
- brg='\e[1m'
- std='\e[m'
+ red="$esc[0;31m"
+ grn="$esc[0;32m"
+ lgn="$esc[1;32m"
+ blu="$esc[1;34m"
+ mgn="$esc[0;35m"
+ brg="$esc[1m"
+ std="$esc[m"
echo AUTOMAKE_OPTIONS = color-tests >> Makefile.am
else
red= grn= lgn= blu= mgn= brg= std=
# Test scripts can override it if they need to (but this should
# be done carefully).
if test -z "$me"; then
- # Guard against failure to spawn sed (seen on MSYS), or empty $argv0.
- me=`echo "$argv0" | sed -e 's,.*[\\/],,;s/\.sh$//;s/\.tap$//'` \
- && test -n "$me" \
- || { echo "$argv0: failed to define \$me" >&2; exit 99; }
+ # Strip all directory components.
+ me=${argv0##*/}
+ # Strip test suffix.
+ case $me in
+ *.tap) me=${me%.tap};;
+ *.sh) me=${me%.sh} ;;
+ esac
fi
# 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.
*) FC=$F77 FCFLAGS=$FFLAGS; export FC FCFLAGS;;
esac
;;
+ grep-nonprint)
+ # Check that grep can parse nonprinting characters correctly.
+ # BSD 'grep' works from a pipe, but not a seekable file.
+ # GNU or BSD 'grep -a' works on files, but is not portable.
+ case $(echo "$esc" | grep .)$(echo "$esc" | grep "$esc") in
+ "$esc$esc") ;;
+ *) skip_ "grep can't handle nonprinting characters correctly";;
+ esac
+ ;;
javac)
# The Java compiler from JDK 1.5 (and presumably earlier versions)
# cannot handle the '-version' option by itself: it bails out
# Test Automake TESTS color output, by forcing it.
# Keep this in sync with the sister test 'color2.test'.
+required='grep-nonprint'
# For gen-testsuite-part: ==> try-with-serial-tests <==
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case $(echo "$std" | grep .) in
- "$std") ;;
- *) skip_ "grep can't parse nonprinting characters";;
-esac
-
cat >>configure.ac <<END
AC_OUTPUT
END
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: .*pass"
cat stdout | grep "^${red}FAIL${std}: .*fail"
cat stdout | grep "^${blu}SKIP${std}: .*skip"
# not unduly colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
# Test Automake TESTS color output, using the expect(1) program.
# Keep this in sync with the sister test 'color.test'.
+required='grep-nonprint'
# For gen-testsuite-part: ==> try-with-serial-tests <==
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case $(echo "$std" | grep .) in
- "$std") ;;
- *) skip_ "grep can't parse nonprinting characters";;
-esac
-
# This test requires a working a working 'expect' program.
# Creative quoting required to avoid spurious maintainer-check failure.
(set +e; expect -c 'exit ''77'; test $? -eq 77) \
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: .*pass"
cat stdout | grep "^${red}FAIL${std}: .*fail"
cat stdout | grep "^${blu}SKIP${std}: .*skip"
# not unduly colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
# Colorized output from the testsuite report shouldn't end up in log files.
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e'
-
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$esc" | $FGREP "$esc"` in
- "$esc") ;;
-# Creative quoting below to please maintainer-check.
- *) echo "$me: f""grep can't parse nonprinting characters" >&2; Exit 77;;
-esac
-
TERM=ansi; export TERM
cat >>configure.ac <<END
./configure
mv config.log config-log # Avoid possible false positives below.
AM_COLOR_TESTS=always $MAKE -e check && Exit 1
-$FGREP "$esc" *.log && Exit 1
+# Not a useless use of cat; see above comments "grep-nonprinting"
+# requirement in 'test-init.sh'.
+cat *.log | grep "$esc" && Exit 1
:
# Check that the testsuite harness correctly handle overrides of the
# TERM variable by either TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT.
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e['
-
TERM=ansi; export TERM
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$esc" | $FGREP "$esc"` in
- "$esc") ;;
- *) skip_ "$FGREP can't parse nonprinting characters" ;;
-esac
-
cat >> configure.ac << 'END'
AC_OUTPUT
END
./configure
mkcheck TESTS_ENVIRONMENT='TERM=dumb'
-cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
+cat stdout | grep "PASS.*foobar" | grep "$esc\\["
mkcheck AM_TESTS_ENVIRONMENT='TERM=dumb'
-cat stdout | grep "PASS.*foobar" | $FGREP "$esc"
+cat stdout | grep "PASS.*foobar" | grep "$esc\\["
:
# Temporarily disable shell traces, to avoid bloating the log file.
set +x
-for i in `seq_ 1 $count`; do
+for i in $(seq_ 1 $count); do
echo dummy $i > $i.log
echo :global-test-result: PASS > $i.trs
echo :test-result: PASS >> $i.trs
# Temporarily disable shell traces, to avoid bloating the log file.
set +x
-for i in `seq_ 1 $count`; do
+for i in $(seq_ 1 $count); do
echo false > $i.t
echo dummy $i > $i.log
echo :global-test-result: PASS > $i.trs
cd "$ocwd"
-makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
-makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
-bar_in_list=`find . -name bar.in | LC_ALL=C sort`
-bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
+makefiles_am_list=$(find . -name Makefile.am | LC_ALL=C sort)
+makefiles_list=$(echo "$makefiles_am_list" | sed 's/\.am$//')
+bar_in_list=$(find . -name bar.in | LC_ALL=C sort)
+bar_list=$(echo "$bar_in_list" | sed 's/\.in$//')
cat configure.ac # For debugging.
unset r
# Overriding $me after sourcing ./defs-static should work.
-s=`$AM_TEST_RUNNER_SHELL -c '. ./defs-static && me=zardoz &&
- . ./defs && echo me=$me' bad.sh`
+s=$($AM_TEST_RUNNER_SHELL -c '. ./defs-static && me=zardoz &&
+ . ./defs && echo me=$me' bad.sh)
command_ok_ "override of \$me after ./defs-static causes no error" \
test $? -eq 0
# TAP support:
# - colorization of TAP results and diagnostic messages
+required='grep-nonprint'
. ./defs || Exit 1
-esc='\e'
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
mgn="$esc\[0;35m"
std="$esc\[m"
-# Check that grep can parse nonprinting characters.
-# BSD 'grep' works from a pipe, but not a seekable file.
-# GNU or BSD 'grep -a' works on files, but is not portable.
-case `echo "$std" | grep .` in
- "$std") ;;
- *) echo "$me: grep can't parse nonprinting characters" >&2; Exit 77;;
-esac
-
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = color-tests
AM_TEST_LOG_DRIVER_FLAGS = --comments
test_color ()
{
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "^${grn}PASS${std}: all\.test 1 - foo$"
cat stdout | grep "^${lgn}XFAIL${std}: all\.test 2 - bar # TODO td$"
cat stdout | grep "^${blu}SKIP${std}: all\.test 3 - baz # SKIP sk$"
# colorized.
(
set +e # In case some grepped regex below isn't matched.
- # Not a useless use of cat; see above comments about grep.
+ # Not a useless use of cat; see above comments "grep-nonprinting"
+ # requirement in 'test-init.sh'.
cat stdout | grep "TOTAL.*:"
cat stdout | grep "PASS.*:"
cat stdout | grep "FAIL.*:"
grep '^1\.\.0 # SKIP all$' test-suite.log
-case `cat test-suite.log` in
- *"`cat hodgepodge`"*) ;;
+test_suite_contents=$(cat test-suite.log)
+hodgepodge_contents=$(cat hodgepodge)
+case $test_suite_contents in
+ *"$hodgepodge_contents"*) ;;
*) Exit 1;;
esac
AUTOMAKE_fails --add-missing
# The expected diagnostic is:
# automake: warnings are treated as errors
-# Makefile.am:3: warning: variable `EXTRA_libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:3: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:1: warning: variable `libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:1: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:2: warning: variable `nodist_libfoo_la_SOURCES' is defined but no program or
-# Makefile.am:2: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:4: warning: variable `libfoo_la_LIBADD' is defined but no program or
-# Makefile.am:4: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:6: warning: variable `EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
-# Makefile.am:6: library has `libfoo_la' as canonical name (possible typo)
-# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
-# Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
+# Makefile.am:3: warning: variable 'EXTRA_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:3: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:1: warning: variable 'libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:1: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:2: warning: variable 'nodist_libfoo_la_SOURCES' is defined but no program or
+# Makefile.am:2: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:4: warning: variable 'libfoo_la_LIBADD' is defined but no program or
+# Makefile.am:4: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:6: warning: variable 'EXTRA_libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:6: library has 'libfoo_la' as canonical name (possible typo)
+# Makefile.am:5: warning: variable 'libfoo_la_DEPENDENCIES' is defined but no program or
+# Makefile.am:5: library has 'libfoo_la' as canonical name (possible typo)
grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
test $(grep -c 'variable.*is defined but' stderr) -eq 6
# for more vers*.texi files, and does not require makeinfo, tex and
# texi2dvi.
-required='makeinfo tex texi2dvi'
+required='makeinfo tex texi2dvi grep-nonprint'
. ./defs || Exit 1
test $(LC_ALL=C date '+%u') -gt 0 && test $(LC_ALL=C date '+%u') -lt 8 \
|| skip_ "'date' is not POSIX-compliant enough"
day=$(echo "$day" | sed 's/^0//')
-(echo '\ex\a' | grep x) \
- || skip_ "grep doesn't work on input that is not pure text"
-
cat > configure.ac << END
AC_INIT([$me], [123.456])
AM_INIT_AUTOMAKE
include defs.am
info_TEXINFOS = foo.texi
test-grepinfo:
-## Not useless uses of cat: we only tested that grep worked on
+## Not useless uses of cat: we only tested that grep works on
## non-text input when that's given from a pipe.
cat $(srcdir)/foo.info | grep 'GREPVERSION=$(my_version_rx)='
cat $(srcdir)/foo.info | grep 'GREPEDITION=$(my_version_rx)='