[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12.1-12
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12.1-121-gedbcd8f |
Date: |
Fri, 22 Jun 2012 22:29:17 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".
http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=edbcd8f1948b35f956bba1586d7cc2e628b98338
The branch, master has been updated
via edbcd8f1948b35f956bba1586d7cc2e628b98338 (commit)
via 5898641fb97b63ff62d84eed90ea7e1b2329bfe8 (commit)
via e5343765c216cd8bff74da01986e61c3fe093eb1 (commit)
via 465111cdfd1b92feaf9c6fd679cf1845c4e53083 (commit)
via d1490b591601685d3fd6313475ac5a58940d5f6b (commit)
via ca744ade0bacef9333d0ef88ef3d6e858a09d15b (commit)
via f4a04f21eededc6e0c4f621926fc7ab796680de2 (commit)
via 91251075fe9dc9e36ccad3155602d2360d192a9c (commit)
via 19c56b1d1295120cc33503dd90d218d486656d5d (commit)
via c94da9924b88684bf839d402e17ff232cbbb1c4e (commit)
via 24c1056fdb668e2076981c2250bbf6d7c8bf8f48 (commit)
from 3b83966e81cd038e79be4225225787d3766c54ec (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit edbcd8f1948b35f956bba1586d7cc2e628b98338
Merge: 3b83966 5898641
Author: Stefano Lattarini <address@hidden>
Date: Sat Jun 23 00:16:26 2012 +0200
Merge branch 'maint'
* maint:
tests: avoid one last `...` command substitution in 'test-init.sh'
maintcheck: guard against `...` for command substitution in test cases
tests: more uses of $(...) over `...` for command substitution
cosmetics: quote `like this', not 'like this', in a couple of tests
readme: clarify/extend few entries in 't/README'
readme: better separation of entries in 't/README'
readme: subsections "Do" and "Do not" in 't/README' merged
tests: new requirement 'grep-nonprint'
cosmetics: fix description of an expected error message in a test
tests: assume automake quotes 'like this', not `like this'
Signed-off-by: Stefano Lattarini <address@hidden>
-----------------------------------------------------------------------
Summary of changes:
syntax-checks.mk | 28 +++++++++
t/README | 109 ++++++++++++++++++----------------
t/aclocal-verbose-install.sh | 2 +-
t/add-missing.tap | 6 +-
t/ansi2knr-no-more.sh | 2 +-
t/autodist-no-duplicate.sh | 12 ++--
t/autodist-subdir.sh | 6 +-
t/autodist.sh | 6 +-
t/ax/depcomp.sh | 10 ++--
t/ax/tap-summary-aux.sh | 14 ++--
t/ax/test-init.sh | 22 ++++++-
t/color.sh | 16 ++----
t/color2.sh | 16 ++----
t/parallel-tests-no-color-in-log.sh | 16 +----
t/parallel-tests-reset-term.sh | 15 +----
t/perf/testsuite-recheck.sh | 2 +-
t/perf/testsuite-summary.sh | 2 +-
t/remake11.sh | 8 +-
t/self-check-me.tap | 4 +-
t/tap-color.sh | 16 ++----
t/tap-global-log.sh | 6 +-
t/vartypo2.sh | 24 ++++----
t/vtexi4.sh | 7 +--
23 files changed, 181 insertions(+), 168 deletions(-)
diff --git a/syntax-checks.mk b/syntax-checks.mk
index d9302da..77d2f42 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -58,6 +58,7 @@ sc_tests_make_without_am_makeflags \
$(sc_obsolete_requirements_rules) \
sc_tests_obsolete_variables \
sc_tests_here_document_format \
+sc_tests_command_subst \
sc_tests_Exit_not_exit \
sc_tests_automake_fails \
sc_tests_required_after_defs \
@@ -291,6 +292,33 @@ sc_tests_here_document_format:
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.
diff --git a/t/README b/t/README
index 57cab89..3f56400 100644
--- a/t/README
+++ b/t/README
@@ -137,54 +137,54 @@ Reporting failures
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
@@ -193,7 +193,7 @@ Do
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
@@ -202,55 +202,57 @@ Do
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'
@@ -258,27 +260,27 @@ Do
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 <address@hidden>.
-
-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;
@@ -288,23 +290,28 @@ Do not
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
diff --git a/t/aclocal-verbose-install.sh b/t/aclocal-verbose-install.sh
index 594c607..095a3f7 100755
--- a/t/aclocal-verbose-install.sh
+++ b/t/aclocal-verbose-install.sh
@@ -14,7 +14,7 @@
# 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
diff --git a/t/add-missing.tap b/t/add-missing.tap
index 6f16a0a..902ff3b 100755
--- a/t/add-missing.tap
+++ b/t/add-missing.tap
@@ -169,11 +169,11 @@ check_ ()
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.
@@ -192,7 +192,7 @@ check_ ()
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.
diff --git a/t/ansi2knr-no-more.sh b/t/ansi2knr-no-more.sh
index fb2e2a5..99f2e92 100755
--- a/t/ansi2knr-no-more.sh
+++ b/t/ansi2knr-no-more.sh
@@ -45,7 +45,7 @@ for opt in ansi2knr lib/ansi2knr; do
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
diff --git a/t/autodist-no-duplicate.sh b/t/autodist-no-duplicate.sh
index 2e610ae..0055e4c 100755
--- a/t/autodist-no-duplicate.sh
+++ b/t/autodist-no-duplicate.sh
@@ -24,14 +24,14 @@ re='Files .*automatically distributed.*if found'
# 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"
diff --git a/t/autodist-subdir.sh b/t/autodist-subdir.sh
index 19d22dc..1454edd 100755
--- a/t/autodist-subdir.sh
+++ b/t/autodist-subdir.sh
@@ -36,9 +36,9 @@ $AUTOCONF
# 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)
diff --git a/t/autodist.sh b/t/autodist.sh
index f8f68ad..952df4a 100755
--- a/t/autodist.sh
+++ b/t/autodist.sh
@@ -35,9 +35,9 @@ $AUTOCONF
# 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)
diff --git a/t/ax/depcomp.sh b/t/ax/depcomp.sh
index 7a60229..f8e372f 100644
--- a/t/ax/depcomp.sh
+++ b/t/ax/depcomp.sh
@@ -134,11 +134,11 @@ AM_INIT_AUTOMAKE
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
diff --git a/t/ax/tap-summary-aux.sh b/t/ax/tap-summary-aux.sh
index e74438d..8f38e53 100644
--- a/t/ax/tap-summary-aux.sh
+++ b/t/ax/tap-summary-aux.sh
@@ -82,13 +82,13 @@ do_check ()
}
if test $use_colors = yes; then
- red='[0;31m'
- grn='[0;32m'
- lgn='[1;32m'
- blu='[1;34m'
- mgn='[0;35m'
- brg='[1m'
- std='[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=
diff --git a/t/ax/test-init.sh b/t/ax/test-init.sh
index 9d19621..eb76446 100644
--- a/t/ax/test-init.sh
+++ b/t/ax/test-init.sh
@@ -26,10 +26,13 @@ set -e
# 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
@@ -63,6 +66,8 @@ tab=' '
# A newline character.
nl='
'
+# A literal escape character. Used by test checking colored output.
+esc=''
# As autoconf-generated configure scripts do, ensure that IFS
# is defined initially, so that saving and restoring $IFS works.
@@ -754,6 +759,15 @@ do
*) 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
diff --git a/t/color.sh b/t/color.sh
index 18c6e23..5726ac1 100755
--- a/t/color.sh
+++ b/t/color.sh
@@ -17,10 +17,10 @@
# 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=''
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
@@ -29,14 +29,6 @@ blu="$esc\[1;34m"
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
@@ -78,7 +70,8 @@ $AUTOMAKE --add-missing
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"
@@ -106,7 +99,8 @@ test_no_color ()
# 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.*:"
diff --git a/t/color2.sh b/t/color2.sh
index 041ffe6..72087a0 100755
--- a/t/color2.sh
+++ b/t/color2.sh
@@ -17,10 +17,10 @@
# 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=''
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
@@ -29,14 +29,6 @@ blu="$esc\[1;34m"
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) \
@@ -108,7 +100,8 @@ $AUTOMAKE --add-missing
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"
@@ -136,7 +129,8 @@ test_no_color ()
# 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.*:"
diff --git a/t/parallel-tests-no-color-in-log.sh
b/t/parallel-tests-no-color-in-log.sh
index 16c0ed7..01e1bdd 100755
--- a/t/parallel-tests-no-color-in-log.sh
+++ b/t/parallel-tests-no-color-in-log.sh
@@ -16,19 +16,9 @@
# Colorized output from the testsuite report shouldn't end up in log files.
+required='grep-nonprint'
. ./defs || Exit 1
-esc=''
-
-# 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
@@ -57,6 +47,8 @@ $AUTOMAKE --add-missing
./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
:
diff --git a/t/parallel-tests-reset-term.sh b/t/parallel-tests-reset-term.sh
index 4cd8086..52e15c0 100755
--- a/t/parallel-tests-reset-term.sh
+++ b/t/parallel-tests-reset-term.sh
@@ -17,20 +17,11 @@
# 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='['
-
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
@@ -67,9 +58,9 @@ $AUTOMAKE -a
./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\\["
:
diff --git a/t/perf/testsuite-recheck.sh b/t/perf/testsuite-recheck.sh
index 50cc03b..6fd793b 100755
--- a/t/perf/testsuite-recheck.sh
+++ b/t/perf/testsuite-recheck.sh
@@ -69,7 +69,7 @@ END
# 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
diff --git a/t/perf/testsuite-summary.sh b/t/perf/testsuite-summary.sh
index a11bb8e..cefef17 100755
--- a/t/perf/testsuite-summary.sh
+++ b/t/perf/testsuite-summary.sh
@@ -38,7 +38,7 @@ END
# 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
diff --git a/t/remake11.sh b/t/remake11.sh
index 93ef224..3b97df9 100755
--- a/t/remake11.sh
+++ b/t/remake11.sh
@@ -48,10 +48,10 @@ bottom=$(pwd) || fatal_ "getting current working directory"
cd "$ocwd"
-makefiles_am_list=`find . -name Makefile.am | LC_ALL=C sort`
-makefiles_list=`echo "$makefiles_am_list" | sed 's/\.am$//'`
-bar_in_list=`find . -name bar.in | LC_ALL=C sort`
-bar_list=`echo "$bar_in_list" | sed 's/\.in$//'`
+makefiles_am_list=$(find . -name Makefile.am | LC_ALL=C sort)
+makefiles_list=$(echo "$makefiles_am_list" | sed 's/\.am$//')
+bar_in_list=$(find . -name bar.in | LC_ALL=C sort)
+bar_list=$(echo "$bar_in_list" | sed 's/\.in$//')
cat configure.ac # For debugging.
diff --git a/t/self-check-me.tap b/t/self-check-me.tap
index 2b720fa..0ac8e20 100755
--- a/t/self-check-me.tap
+++ b/t/self-check-me.tap
@@ -59,8 +59,8 @@ result_ "$r" "override of \$me before ./defs is honored"
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
diff --git a/t/tap-color.sh b/t/tap-color.sh
index 6a91f06..5a8e1bc 100755
--- a/t/tap-color.sh
+++ b/t/tap-color.sh
@@ -17,9 +17,9 @@
# TAP support:
# - colorization of TAP results and diagnostic messages
+required='grep-nonprint'
. ./defs || Exit 1
-esc=''
# Escape '[' for grep, below.
red="$esc\[0;31m"
grn="$esc\[0;32m"
@@ -28,14 +28,6 @@ blu="$esc\[1;34m"
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
@@ -101,7 +93,8 @@ 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}: 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$"
@@ -134,7 +127,8 @@ test_no_color ()
# 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.*:"
diff --git a/t/tap-global-log.sh b/t/tap-global-log.sh
index 493a5a4..8267a3d 100755
--- a/t/tap-global-log.sh
+++ b/t/tap-global-log.sh
@@ -113,8 +113,10 @@ done
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
diff --git a/t/vartypo2.sh b/t/vartypo2.sh
index cc9f4dd..7941fbb 100755
--- a/t/vartypo2.sh
+++ b/t/vartypo2.sh
@@ -40,18 +40,18 @@ $ACLOCAL
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
diff --git a/t/vtexi4.sh b/t/vtexi4.sh
index ee9d078..975bf0e 100755
--- a/t/vtexi4.sh
+++ b/t/vtexi4.sh
@@ -21,7 +21,7 @@
# 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 \
@@ -31,9 +31,6 @@ 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 'x' | 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
@@ -51,7 +48,7 @@ cat > Makefile.am << 'END'
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)='
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.12.1-121-gedbcd8f,
Stefano Lattarini <=