# Resolve ties in favor of FILE.
is_newest ()
{
- is_newest_files=`find "$@" -prune -newer "$1"`
+ is_newest_files=$(find "$@" -prune -newer "$1")
test -z "$is_newest_files"
}
am__opt_re='' am__var_re=''
case $1 in
--*'=') am__opt_re="^ $1";;
- --*'[=]') am__opt_re='^ '`printf '%s\n' "$1" | sed 's/...$//'`'\[=';;
+ --*'[=]') am__opt_re='^ '$(printf '%s\n' "$1" | sed 's/...$//')'\[=';;
--*) am__opt_re="^ $1( .*|$)";;
*) am__var_re="^ $1( .*|$)";;
esac
3) seq_first=$1 seq_incr=$2 seq_last=$3;;
*) fatal_ "seq_: too many arguments";;
esac
- # Try to avoid forks if possible.
- case "$BASH_VERSION" in
- ""|[12].*)
- : Not bash, or a too old bash version. ;;
- *)
- # Use eval to protect dumber shells from parsing errors.
- eval 'for ((i = seq_first; i <= seq_last; i += seq_incr)); do
- echo $i
- done'
- return 0;;
- esac
- # Else, use GNU seq if available.
- seq "$@" && return 0
- # Otherwise revert to a slower loop using expr(1).
i=$seq_first
while test $i -le $seq_last; do
echo $i
- i=`expr $i + $seq_incr`
+ i=$(($i + $seq_incr))
done
}
# Avoid spurious failures with shells with "overly sensible"
# errexit shell flag, such as e.g., Solaris /bin/sh.
set +e
- test `grep -c '^PASS:' stdout` -eq $pass || rc=1
- test `grep -c '^XFAIL:' stdout` -eq $xfail || rc=1
- test `grep -c '^SKIP:' stdout` -eq $skip || rc=1
- test `grep -c '^FAIL:' stdout` -eq $fail || rc=1
- test `grep -c '^XPASS:' stdout` -eq $xpass || rc=1
- test `grep -c '^ERROR:' stdout` -eq $error || rc=1
+ test $(grep -c '^PASS:' stdout) -eq $pass || rc=1
+ test $(grep -c '^XFAIL:' stdout) -eq $xfail || rc=1
+ test $(grep -c '^SKIP:' stdout) -eq $skip || rc=1
+ test $(grep -c '^FAIL:' stdout) -eq $fail || rc=1
+ test $(grep -c '^XPASS:' stdout) -eq $xpass || rc=1
+ test $(grep -c '^ERROR:' stdout) -eq $error || rc=1
grep "^# TOTAL: *$total$" stdout || rc=1
grep "^# PASS: *$pass$" stdout || rc=1
grep "^# XFAIL: *$xfail$" stdout || rc=1
unindent ()
{
if test x"$sed_unindent_prog" = x; then
- sed_unindent_prog=`printf '%s\n' "$commented_sed_unindent_prog" | sed -e "s/ *# .*//"`
+ sed_unindent_prog=$(printf '%s\n' "$commented_sed_unindent_prog" \
+ | sed -e "s/ *# .*//")
fi
sed "$sed_unindent_prog" ${1+"$@"}
}
MAKE=$make_ am__using_gmake=''
test "$MAKE" = : && break
echo "$me: determine whether $MAKE is GNU make"
- # Don't use "&&" here, or a bug of 'set -e' present in some
- # versions of the BSD shell will be triggered. We add the
- # dummy "else" branch for extra safety.
- if using_gmake; then break; else :; fi
+ using_gmake && break
+ : For shells with busted 'set -e'.
done
test "$MAKE" = : && skip_all_ "this test requires GNU make"
export MAKE
"the '--html' option"
;;
mingw)
- uname_s=`uname -s || echo UNKNOWN`
+ uname_s=$(uname -s || echo UNKNOWN)
echo "$me: system name: $uname_s"
case $uname_s in
MINGW*) ;;
*) skip_all_ "this test requires MSYS in MinGW mode" ;;
esac
+ unset uname_s
;;
non-root)
# Skip this test case if the user is root.
# Don't use "&&" here, to avoid a bug of 'set -e' present in
# some (even relatively recent) versions of the BSD shell.
# We add the dummy "else" branch for extra safety.
- if cross_compiling; then
- skip_all_ "doesn't work in cross-compile mode"
- else :; fi
+ ! cross_compiling || skip_all_ "doesn't work in cross-compile mode"
;;
python)
# Python doesn't support --version, it has -V
Do not
------
+ In test scripts, prefer using POSIX constructs over their old
+ Bourne-only equivalents:
+
+ - use $(...), not `...`, for command substitution;
+ - use $((...), not `expr ...`, for arithmetic processing;
+ - liberally use '!' to invert the exit status of a command, e.g.,
+ in idioms like "if ! CMD; then ...", instead of relying on clumsy
+ paraphrases like "if CMD; then :; else ...".
+ - prefer use of ${param%pattern} and ${param#pattern} parameter
+ expansions over processing by 'sed' or 'expr'.
+
+ Note however that, when writing Makefile recipes or shell code in a
+ configure.ac, you should still use `...` instead, because the Autoconf
+ generated configure scripts do not ensure they will find a truly POSIX
+ shell (even though they will prefer and use it *if* it's found).
+
Do not test an Automake error with "$AUTOMAKE && Exit 1", or in three
years we'll discover that this test failed for some other bogus reason.
This happened many times. Better use something like
command_ok_ "aclocal and AC_OUTPUT ($cur)" $ACLOCAL
command_ok_ "automake and AC_OUTPUT ($cur)" $AUTOMAKE
command_ok_ "foo.in mentioned two times in Makefile.in ($cur)" \
- test `$FGREP foo.in Makefile.in | wc -l` -eq 2
+ test $($FGREP -c 'foo.in' Makefile.in) -eq 2
# This ought to work as well.
command_ok_ "'automake -a -f' and AC_OUTPUT ($cur)" \
touch m4/otherfile.m4
$sleep
$ACLOCAL -I m4
-test `ls -1t aclocal.m4 m4/otherfile.m4 | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 m4/otherfile.m4 | sed 1q) = aclocal.m4
$AUTOCONF
$AUTOMAKE
./configure
$MAKE distcheck
+
+:
$MAKE
# Because c.m4 has changed, aclocal.m4 must have been rebuilt.
-test `ls -1t aclocal.m4 stamp | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 stamp | sed 1q) = aclocal.m4
# However, since FOO is not used, f.m4 should not be included
# and the contents of aclocal.m4 should remain the same
diff aclocal.m4 stamp
$FGREP AM_SOME_MACRO aclocal.m4 && Exit 1
$FGREP AM_MORE_MACRO aclocal.m4 && Exit 1
$FGREP 'm4_include([m4/more.m4])' aclocal.m4
-test 1 = `grep m4_include aclocal.m4 | wc -l`
+test 1 = $(grep m4_include aclocal.m4 | wc -l)
:
$ACLOCAL -I 5 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
-test `grep -c 'ill-formed serial' stderr` -eq 3
+test $(grep -c 'ill-formed serial' stderr) -eq 3
$ACLOCAL -I 6 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
echo 'AM_DUMMY_MACRO' >> configure.ac
echo 'AC_DEFUN([AM_DUMMY_MACRO], [:])' >> sys/foo.m4
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
env ACLOCAL_PATH="$cwd/sys" $ACLOCAL --verbose --install -I "$cwd/loc"
diff sys/foo.m4 loc/foo.m4
$ACLOCAL -I foo --install
test -f foo/my-defs.m4
-$ACLOCAL --install -I "`pwd`/bar"
+$ACLOCAL --install -I "$(pwd)/bar"
test -f bar/my-defs.m4
$ACLOCAL --install -I baz/sub/sub2
# Directories in ACLOCAL_PATH should never be created if they don't
# exist.
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install && Exit 1
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install && Exit 1
test ! -d none
test ! -d none2
-ACLOCAL_PATH="`pwd`/none:`pwd`/none2" $ACLOCAL --install -I x
+ACLOCAL_PATH="$(pwd)/none:$(pwd)/none2" $ACLOCAL --install -I x
test -f x/my-defs.m4
test ! -d none
test ! -d none2
mkdir sdir pdir m4
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/sdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/sdir"
ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
cat > sdir/foo.m4 << 'END'
mkdir acdir pdir ldir
-ACLOCAL="$ACLOCAL --system-acdir=`pwd`/acdir"
+ACLOCAL="$ACLOCAL --system-acdir=$(pwd)/acdir"
ACLOCAL_PATH=./pdir; export ACLOCAL_PATH
cat > acdir/foo.m4 << 'END'
mkdir mdir
echo 'AC_DEFUN([AM_FOO], [am--foo])' > mdir/foo.m4
-ACLOCAL_PATH=./nonesuch:./mdir:`pwd`/nonesuch2:nonesuch3 $ACLOCAL
+ACLOCAL_PATH=./nonesuch:./mdir:$(pwd)/nonesuch2:nonesuch3 $ACLOCAL
$AUTOCONF
$FGREP 'am--foo' configure
AC_DEFUN([AM_BAZ_MACRO], [am--baz])
END
-ACLOCAL_PATH=mdir1:./mdir2:`pwd`/mdir3 $ACLOCAL
+ACLOCAL_PATH=mdir1:./mdir2:$(pwd)/mdir3 $ACLOCAL
$AUTOCONF
# there should be no m4_include in aclocal.m4, even though ACLOCAL_PATH
. ./defs || Exit 1
$ACLOCAL --print-ac-dir
-test "`$ACLOCAL --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --print-ac-dir)" = "$am_system_acdir"
$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir
-test "`$ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir`" = foo
+test "$($ACLOCAL -Wno-obsolete --acdir foo --print-ac-dir)" = foo
$ACLOCAL --system-acdir /bar --print-ac-dir
-test "`$ACLOCAL --system-acdir /bar --print-ac-dir`" = /bar
+test "$($ACLOCAL --system-acdir /bar --print-ac-dir)" = /bar
$ACLOCAL --automake-acdir /bar --print-ac-dir
-test "`$ACLOCAL --automake-acdir /bar --print-ac-dir`" = "$am_system_acdir"
+test "$($ACLOCAL --automake-acdir /bar --print-ac-dir)" = "$am_system_acdir"
:
# aclocal.m4 and Makefile.in should not have been updated, so 'foo'
# should be younger
-test `ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t aclocal.m4 Makefile.in sub/Makefile.in foo | sed 1q) = foo
$sleep
$ACLOCAL -I m4 --force
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
+test $(ls -1t aclocal.m4 foo | sed 1q) = aclocal.m4
# We still use --no-force for automake, but since aclocal.m4 has
# changed all Makefile.ins should be updated.
$sleep
$AUTOMAKE --no-force
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
touch m4/somedefs.m4
$sleep
$AUTOMAKE --no-force
# aclocal.m4 should have been updated, although its contents haven't changed.
-test `ls -1t aclocal.m4 foo | sed 1q` = aclocal.m4
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t aclocal.m4 foo | sed 1q) = aclocal.m4
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
touch fragment.inc
$sleep
$ACLOCAL -I m4
$AUTOMAKE --no-force
# Only ./Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t aclocal.m4 foo | sed 1q) = foo
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = foo
grep README Makefile.in && Exit 1
$sleep
$AUTOMAKE --no-force
# Even if no dependency change, the content changed.
-test `ls -1t Makefile.in foo | sed 1q` = Makefile.in
-test `ls -1t sub/Makefile.in foo | sed 1q` = foo
+test $(ls -1t Makefile.in foo | sed 1q) = Makefile.in
+test $(ls -1t sub/Makefile.in foo | sed 1q) = foo
grep README Makefile.in
$ACLOCAL -I m4
$AUTOMAKE --no-force
# Only sub/Makefile.in should change.
-test `ls -1t aclocal.m4 foo | sed 1q` = foo
-test `ls -1t Makefile.in foo | sed 1q` = foo
-test `ls -1t sub/Makefile.in foo | sed 1q` = sub/Makefile.in
+test $(ls -1t aclocal.m4 foo | sed 1q) = foo
+test $(ls -1t Makefile.in foo | sed 1q) = foo
+test $(ls -1t sub/Makefile.in foo | sed 1q) = sub/Makefile.in
echo 'AC_DEFUN([MACRO2], [AC_REQUIRE([AM_UNUSED_MACRO])])' >m4/macro2.m4
$ACLOCAL -I m4 >output 2>&1 || { cat output; Exit 1; }
-test 0 = `wc -l <output`
+test 0 -eq $(wc -l <output)
grep macro1.m4 aclocal.m4
grep macro2.m4 aclocal.m4 && Exit 1
plan_ "later"
build_aux=build-aux
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Try to improve readability of displayed diffs.
if diff -u /dev/null /dev/null; then
check_ ()
{
set +x # Temporary disable shell traces to remove noise from log files.
- incr_ check_count
+ check_count=$(($check_count + 1))
echo check count: $check_count
override=no
run_aclocal=no
# For config.guess and config.sub.
for mach in build host target system; do
- MACH=`echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]'`
+ MACH=$(echo "$mach" | LC_ALL=C tr '[a-z]' '[A-Z]')
check_ <<END
== Name ==
cfg-$mach
./configure --prefix /usr
$MAKE
-$MAKE DESTDIR="`pwd`/inst" install
+$MAKE DESTDIR="$(pwd)/inst" install
cd inst
find . -type f -print > ../files.lst
-tar cvf amhello-1.0-i686.tar.gz `cat ../files.lst` > tar.got 2>&1
+tar cvf amhello-1.0-i686.tar.gz $(cat ../files.lst) > tar.got 2>&1
-EXEEXT=`sed -n -e 's/^EXEEXT *= *//p' < ../Makefile`
+EXEEXT=$(sed -n -e 's/^EXEEXT *= *//p' < ../Makefile)
if tar --version </dev/null | grep GNU; then
LC_ALL=C sort tar.got > t
|| fatal_ "cannot get amhello tarball"
host=i586-mingw32msvc
-build=`"$am_scriptdir"/config.guess` && test -n "$build" \
+build=$("$am_scriptdir"/config.guess) && test -n "$build" \
|| fatal_ "cannot guess build platform"
case $build in *mingw*) skip_ "build system is MinGW too";; esac
chmod +x ./lib
# Check if ar-lib can create an archive with "cr".
-opts=`./ar-lib ./lib cr foo.lib foo.obj`
+opts=$(./ar-lib ./lib cr foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.obj"
# Check if ar-lib can update an existing archive with "r".
touch foo.lib
-opts=`./ar-lib ./lib r foo.lib foo.obj`
+opts=$(./ar-lib ./lib r foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib can update an existing archive with "q".
-opts=`./ar-lib ./lib q foo.lib foo.obj`
+opts=$(./ar-lib ./lib q foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "u" as a modifier.
# NOTE: "u" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib ru foo.lib foo.obj`
+opts=$(./ar-lib ./lib ru foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "s" as a modifier.
-opts=`./ar-lib ./lib rs foo.lib foo.obj`
+opts=$(./ar-lib ./lib rs foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib accepts "S" as a modifier.
-opts=`./ar-lib ./lib rS foo.lib foo.obj`
+opts=$(./ar-lib ./lib rS foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib foo.obj"
# Check if ar-lib passes on @FILE with "r"
-opts=`./ar-lib ./lib r foo.lib @list`
+opts=$(./ar-lib ./lib r foo.lib @list)
test x"$opts" = x"lib -NOLOGO -OUT:foo.lib foo.lib @list"
# Check if ar-lib can delete a member from an archive with "d".
-opts=`./ar-lib ./lib d foo.lib foo.obj`
+opts=$(./ar-lib ./lib d foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
# Check if ar-lib can delete members in an @FILE.
echo foo.obj > foolist
-opts=`./ar-lib ./lib d foo.lib @foolist`
+opts=$(./ar-lib ./lib d foo.lib @foolist)
test x"$opts" = x"lib -NOLOGO -REMOVE:foo.obj foo.lib"
# Check if ar-lib can list archive members with "t".
-opts=`./ar-lib ./lib t foo.lib`
+opts=$(./ar-lib ./lib t foo.lib)
test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
# Check if ar-lib accepts "v" as a modifier.
# NOTE: "v" should have an effect, but currently doesn't.
-opts=`./ar-lib ./lib tv foo.lib`
+opts=$(./ar-lib ./lib tv foo.lib)
test x"$opts" = x"lib -NOLOGO -LIST foo.lib"
# Check if ar-lib can extract archive members with "x".
touch fake.lib
-opts=`./ar-lib ./lib x fake.lib`
+opts=$(./ar-lib ./lib x fake.lib)
test x"$opts" = x"lib -NOLOGO -EXTRACT:fake.obj fake.lib"
# Check if ar-lib can extract specified archive members with "x".
-opts=`./ar-lib ./lib x foo.lib foo.obj`
+opts=$(./ar-lib ./lib x foo.lib foo.obj)
test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib can extract members in an @FILE.
-opts=`./ar-lib ./lib x foo.lib @foolist`
+opts=$(./ar-lib ./lib x foo.lib @foolist)
test x"$opts" = x"lib -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib passes -lib and -LTCG through to the wrappee.
-opts=`./ar-lib ./lib -lib -LTCG x foo.lib foo.obj`
+opts=$(./ar-lib ./lib -lib -LTCG x foo.lib foo.obj)
test x"$opts" = x"lib -lib -LTCG -NOLOGO -EXTRACT:foo.obj foo.lib"
# Check if ar-lib can extract backslashed members.
touch fake2.lib
-opts=`./ar-lib ./lib x fake2.lib`
+opts=$(./ar-lib ./lib x fake2.lib)
test x"$opts" = x"lib -NOLOGO -EXTRACT:dir\\fake2.obj fake2.lib"
# Check if ar-lib accepts "s" as an action.
-opts=`./ar-lib ./lib s foo.lib`
+opts=$(./ar-lib ./lib s foo.lib)
test x"$opts" = x
:
esac
END
chmod +x bin/lib
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
$ACLOCAL
$AUTOCONF
list1=`$AUTOMAKE --help \
| sed -n "/^$re.*always/,/^ *$/p" \
| sed 1d`
-list1=`echo $list1`
+list1=$(echo $list1)
list2=`$AUTOMAKE --help \
| sed -n "/^$re.*under certain conditions/,/^ *$/p" \
| sed 1d`
-list2=`echo $list2`
+list2=$(echo $list2)
test -n "$list1"
test -n "$list2"
| sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
| sed 1d`
# Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
test -n "$list"
| sed -n '/^Files.*automatically distributed.*if found.*always/,/^ *$/p' \
| sed 1d`
# Normalize whitespace, just in case.
-list=`echo $list`
+list=$(echo $list)
test -n "$list"
# This expects ./defs has already been included has already been included..
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
longpath=this-is/a-path/which-has/quite-a/definitely/truly/long_long_name
cachevar=am_cv_CC_dependencies_compiler_type
absolute)
mkdir -p vpath-abs/build
cd vpath-abs/build
- absdir="`(cd .. && pwd)`" || fatal_ "getting absolute directory"
+ absdir=$(cd .. && pwd) || fatal_ "getting absolute directory"
setup_srcdir "$absdir/vpath-abs"
unset absdir
;;
tap_xfail_count_=0
tap_xpass_count_=0
-# The first "test -n" tries to avoid extra forks when possible.
-if test -n "${ZSH_VERSION}${BASH_VERSION}" \
- || (eval 'test $((1 + 1)) = 2') >/dev/null 2>&1
-then
- # Outer use of 'eval' needed to protect dumber shells from parsing
- # errors.
- eval 'incr_ () { eval "$1=\$((\${$1} + 1))"; }'
-else
- incr_ () { eval "$1=\`expr \${$1} + 1\`"; }
-fi
-
# not COMMAND [ARGS...]
# ---------------------
# Run the given command and invert its exit status.
-not ()
-{
- if "$@"; then return 1; else return 0; fi
-}
+not () { ! "$@"; }
# plan_ [unknown|later|lazy|now|NUMBER-OF-PLANNED-TESTS]
# ------------------------------------------------------
""|TODO|SKIP) ;;
*) bailout_ "result_: invalid directive '$directive_'" ;;
esac
- incr_ tap_count_
+ tap_count_=$(($tap_count_ + 1))
case $tap_result_,$tap_directive_ in
- ok,) incr_ tap_pass_count_;; # Passed.
- not\ ok,TODO) incr_ tap_xfail_count_;; # Expected failure.
- not\ ok,*) incr_ tap_fail_count_ ;; # Failed.
- ok,TODO) incr_ tap_xpass_count_ ;; # Unexpected pass.
- ok,SKIP) incr_ tap_skip_count_ ;; # Skipped.
- *) bailout_ "internal error in 'result_'";; # Can't happen.
+ ok,) # Passed.
+ tap_pass_count_=$(($tap_pass_count_ + 1)) ;;
+ not\ ok,TODO) # Expected failure.
+ tap_xfail_count_=$(($tap_xfail_count_ + 1)) ;;
+ not\ ok,*) # Failed.
+ tap_fail_count_=$(($tap_fail_count_ + 1)) ;;
+ ok,TODO) # Unexpected pass.
+ tap_xpass_count_=$(($tap_xpass_count_ + 1)) ;;
+ ok,SKIP) # Skipped.
+ tap_skip_count_=$(($tap_skip_count_ + 1)) ;;
+ *) # Can't happen.
+ bailout_ "internal error in 'result_'" ;;
esac
tap_text_="$tap_result_ $tap_count_"
if test x"$*" != x; then
skip_row_ ()
{
skip_count_=$1; shift
- for i_ in `seq_ $skip_count_`; do skip_ ${1+"$@"}; done
+ for i_ in $(seq_ $skip_count_); do skip_ ${1+"$@"}; done
}
# skip_all_ [REASON ...]
# Lots of non-failures (300 per kind).
(cat tap && cat tap && cat tap) > all.test
-test `wc -l <all.test` -eq 900 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 900 || Exit 99 # Sanity check.
echo 1..900 >> all.test # Test plan.
do_check --pass <<END
$success_header
# 1 failure and lots of non-failures means failure.
(cat tap && echo "not ok" && cat tap) > all.test
-test `wc -l <all.test` -eq 601 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 601 || Exit 99 # Sanity check.
echo 1..601 >> all.test # Test plan.
do_check --fail <<END
$failure_header
# 1 error and lots of non-failures means failure.
(cat tap && sed 30q tap && echo 'Bail out!') > all.test
-test `wc -l <all.test` -eq 331 || Exit 99 # Sanity check.
+test $(wc -l <all.test) -eq 331 || Exit 99 # Sanity check.
echo 1..331 >> all.test # Test plan.
do_check --fail <<END
$failure_header
mv -f t lib/bar.h
$MAKE
./src/zardoz
- test "`./src/zardoz`" = 'Foo, Zap!'
+ test "$(./src/zardoz)" = 'Foo, Zap!'
fi
$MAKE clean
$ACLOCAL
AUTOMAKE_fails
-test 2 -eq `grep -c 'dist.*forbidden' stderr`
+test 2 -eq $(grep -c 'dist.*forbidden' stderr)
Exit 0
chmod +x Mycomp
# Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/Mycomp
+CC=$(pwd)/Mycomp
export CC
$ACLOCAL
chmod +x Mycomp
+# Make sure the compiler doesn't understand '-c -o'
+CC=$(pwd)/Mycomp
+export CC
+
$ACLOCAL
$AUTOCONF
$AUTOMAKE --copy --add-missing
mkdir build
cd build
-# Make sure the compiler doesn't understand '-c -o'
-CC=`pwd`/../Mycomp
-export CC
-
../configure
$MAKE 2>stderr || { cat stderr >&2; Exit 1; }
cat stderr >&2
test -f hammer.sum
test -f spanner.log
test -f spanner.sum
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
test -f test-suite.log
test -f a.log
test -f b.log
- else :; fi
+ fi
grep 'check-local succeeded :-)' local.log
cp -f config.status config-status.sav
grep 'FAIL:' spanner.sum && Exit 1
B_EXIT_STATUS=1 $MAKE check && Exit 1
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
cat test-suite.log
cat a.log
grep '^b\.test: exit status: 1$' test-suite.log
grep '^a\.test' test-suite.log && Exit 1
: For shells with busted 'set -e'.
- else :; fi
+ fi
CHECKLOCAL_EXIT_STATUS=1 $MAKE check && Exit 1
grep 'check-local failed :-(' local.log
test -f spanner.sum
grep 'FAIL: test_hammer' hammer.sum
grep 'FAIL:' spanner.sum && Exit 1
- # This checks will be run only by the autogenerated 'check12-p.test'.
if test x"$am_serial_tests" != x"yes"; then
cat test-suite.log
cat a.log
grep '^b\.test: exit status: 23$' test-suite.log
grep '^a\.test' test-suite.log && Exit 1
: For shells with busted 'set -e'.
- else :; fi
+ fi
grep 'check-local failed :-(' local.log
cd $srcdir
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
# 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
+case $(echo "$std" | grep .) in
"$std") ;;
*) skip_ "grep can't parse nonprinting characters";;
esac
# 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
+case $(echo "$std" | grep .) in
"$std") ;;
*) skip_ "grep can't parse nonprinting characters";;
esac
$ACLOCAL
$AUTOMAKE
-# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file
-test `sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' Makefile.in \
- | wc -l` -le 30
+# UnIqUe_COPYRIGHT_BOILERPLATE should appear near the top of the file.
+test $(sed -n -e '1,/UnIqUe_COPYRIGHT_BOILERPLATE/p' \
+ Makefile.in | wc -l) -le 30
# UnIqUe_MUMBLE_COMMENT should appear right before the mumble declaration.
-test `sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' Makefile.in \
- | wc -l` -eq 2
+test $(sed -n -e '/UnIqUe_MUMBLE_COMMENT/,/UnIqUe_MUMBLE_VALUE/p' \
+ Makefile.in | wc -l) -eq 2
+
+:
$ACLOCAL
$AUTOMAKE
+$FGREP '@COND' Makefile.in # For debugging, mostly.
+
# The VAR definition appears once for each condition.
-test `grep '@COND_TRUE@VAR' Makefile.in | wc -l` = 1
-test `grep '@COND_FALSE@VAR' Makefile.in | wc -l` = 1
+test $(grep -c '@COND_TRUE@VAR' Makefile.in) = 1
+test $(grep -c '@COND_FALSE@VAR' Makefile.in) = 1
# Make sure the right definition follows each comment.
sed -n '/^#.*VAR.*COND_TRUE/ {
p
}' Makefile.in |
grep '@COND_FALSE@VAR = bar'
+
+:
# -l and -L options and their respective arguments. Traditionally,
# this should work also without a space. Try both usages.
for sp in '' ' '; do
+
# Check if compile handles "-o foo", -I, -l, -L, -Xlinker -Wl,
- opts=`LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk -I${sp}baz -Xlinker foobar -Wl,-foo,bar`
- test x"$opts" = x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
+ opts=$(LIB= ./compile ./cl foo.c -o foo -l${sp}bar -L${sp}gazonk \
+ -I${sp}baz -Xlinker foobar -Wl,-foo,bar)
+ test x"$opts" = \
+ x"foo.c -Fefoo bar.lib -Ibaz -link -LIBPATH:gazonk foobar -foo bar"
# Check if compile handles "-o foo.obj"
- opts=`./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ opts=$(./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
# Check if compile handles "-o foo.o"
- opts=`./compile ./cl -c foo.c -o foo.o -I${sp}baz`
+ opts=$(./compile ./cl -c foo.c -o foo.o -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.o -Ibaz"
# Check if compile handles "foo.cc" as C++.
- opts=`./compile ./cl -c foo.cc -o foo.o -I${sp}baz`
+ opts=$(./compile ./cl -c foo.cc -o foo.o -I${sp}baz)
test x"$opts" = x"-c -Tpfoo.cc -Fofoo.o -Ibaz"
# Check if compile clears the "eat" variable properly.
- opts=`eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz`
+ opts=$(eat=1 ./compile ./cl -c foo.c -o foo.obj -I${sp}baz)
test x"$opts" = x"-c foo.c -Fofoo.obj -Ibaz"
+
done
:
mkdir sub
cat >sub/foo.c <<'EOF'
-int
-foo ()
+int foo (void)
{
return 0;
}
EOF
cat >main.c <<'EOF'
-extern int foo ();
-int
-main ()
+extern int foo (void);
+int main (void)
{
return foo ();
}
EOF
-absfoodir=`pwd`/sub
-absmainc=`pwd`/main.c
-absmainobj=`pwd`/main.obj
+cwd=$(pwd) || fatal_ "cannot get current directory"
+absfoodir=$cwd/sub
+absmainc=$cwd/main.c
+absmainobj=$cwd/main.obj
cat >> configure.ac << 'END'
AC_PROG_CC
# this should work also without a space. Try both usages.
for sp in '' ' '; do
rm -f main
-
- ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" -o main -l${sp}foo
-
+ ./compile cl $CFLAGS $LDFLAGS -L${sp}"$absfoodir" "$absmainobj" \
+ -o main -l${sp}foo
./main
done
./configure
. ./check_host
-pwd=`pwd`
+cwd=$(pwd) || fatal_ "cannot get current directory"
# POSIX mandates that the compiler accepts a space between the -I,
# -l and -L options and their respective arguments. Traditionally,
for sp in '' ' '; do
# Check if "compile cl" transforms absolute file names to
# host format (e.g /somewhere -> c:/msys/1.0/somewhere).
-
- res=`./compile ./cl -L${sp}"$pwd" | sed -e 's/-link -LIBPATH://'`
-
+ res=$(./compile ./cl -L${sp}"$cwd" | sed -e 's/-link -LIBPATH://')
case $res in
- ?:[\\/]*)
- ;;
- *)
- Exit 1
- ;;
+ ?:[\\/]*) ;;
+ *) Exit 1 ;;
esac
done
# -l and -L options and their respective arguments. Traditionally,
# this should work also without a space. Try both usages.
for sp in '' ' '; do
+
rm -rf lib lib2 syslib "sys lib2"
mkdir syslib
- :> syslib/foo.lib
+ : > syslib/foo.lib
- syslib=`pwd`/syslib
+ syslib=$(pwd)/syslib
LIB=$syslib
export LIB
mkdir lib
- :> lib/bar.lib
- :> lib/bar.dll.lib
+ : > lib/bar.lib
+ : > lib/bar.dll.lib
# Check if compile library search correctly
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
# Check if -static makes compile avoid bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -static -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.lib $syslib/foo.lib -link -LIBPATH:lib"
- :> syslib/bar.lib
- :> syslib/bar.dll.lib
+ : > syslib/bar.lib
+ : > syslib/bar.dll.lib
# Check if compile finds bar.dll.lib in syslib
- opts=`./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/bar.dll.lib $syslib/foo.lib"
# Check if compile prefers -L over $LIB
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib"
mkdir lib2
- :> lib2/bar.dll.lib
+ : > lib2/bar.dll.lib
# Check if compile avoids bar.dll.lib in lib2 when -static
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -static -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/bar.lib $syslib/foo.lib -link -LIBPATH:lib2"
# Check if compile gets two different bar libraries when -static
# is added in the middle
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -static -l${sp}bar)
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib lib/bar.lib -link -LIBPATH:lib2 -LIBPATH:lib"
# Check if compile gets the correct bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib -L${sp}lib2 -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib -LIBPATH:lib2"
# Check if compile gets the correct bar.dll.lib
- opts=`./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -L${sp}lib2 -L${sp}lib -l${sp}bar -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo lib2/bar.dll.lib $syslib/foo.lib -link -LIBPATH:lib2 -LIBPATH:lib"
mkdir "sys lib2"
- :> "sys lib2/foo.dll.lib"
+ : > "sys lib2/foo.dll.lib"
- syslib2="`pwd`/sys lib2"
+ syslib2="$(pwd)/sys lib2"
LIB="$syslib2;$LIB"
# Check if compile handles spaces in $LIB and that it prefers the order
# in a multi-component $LIB.
- opts=`./compile ./cl foo.c -o foo -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib2/foo.dll.lib"
# Check if compile handles the 2nd directory in a multi-component $LIB.
- opts=`./compile ./cl foo.c -o foo -static -l${sp}foo`
+ opts=$(./compile ./cl foo.c -o foo -static -l${sp}foo)
test x"$opts" = x"foo.c -Fefoo $syslib/foo.lib"
+
done
:
$AUTOMAKE
$FGREP helldl Makefile.in # For debugging.
-test `$FGREP -c 'helldl$(EXEEXT):' Makefile.in` -eq 2
+test $($FGREP -c 'helldl$(EXEEXT):' Makefile.in) -eq 2
:
$AUTOMAKE
$FGREP helldl Makefile.in # For debugging.
-num1=`$FGREP 'helldl$(EXEEXT):' Makefile.in | wc -l`
-num2=`$FGREP '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in | wc -l`
+num1=$($FGREP -c 'helldl$(EXEEXT):' Makefile.in)
+num2=$($FGREP -c '@COND1_FALSE@@COND2_TRUE@helldl$(EXEEXT):' Makefile.in)
test $num1 -eq 4
test $num2 -eq 1
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || fatal_ "cannot get current directory"
+cwd=$(pwd) || fatal_ "cannot get current directory"
mkdir nowhere
chmod a-w nowhere
$AUTOMAKE --add-missing
$FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 1
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 1
cat > tscan.l << 'END'
%{
# Still and all, it should generate two rules.
$FGREP 'tparse.h' Makefile.in # For debugging.
-test `$FGREP -c 'tparse.h:' Makefile.in` = 2
+test $($FGREP -c 'tparse.h:' Makefile.in) -eq 2
$FGREP '@CASE_A_TRUE@tparse.h:' Makefile.in
$FGREP '@CASE_A_FALSE@tparse.h:' Makefile.in
AUTOMAKE_fails
grep '^configure\.ac:7:.* not enough arguments.* _AM_COND_IF' stderr
grep '^configure\.ac:8:.* not enough arguments.* _AM_COND_ENDIF' stderr
-test 2 = `grep -c 'not enough arguments' stderr`
+test 2 -eq $($FGREP -c 'not enough arguments' stderr)
:
$AUTOMAKE 2>stderr &
pid=$!
-# MSYS bash seems to have a bug in kill, so don't try to kill too soon;
-# and avoid maintainer-check test.
+# MSYS bash seems to have a bug in kill, so don't try to kill too soon.
+# The extra quoting avoids a maintainer-check failure.
sleep '2'
# Make at most 30 tries, one every 10 seconds (= 300 seconds = 5 min).
if kill -0 $pid; then
: process $pid is still alive, wait and retry
sleep '10'
- try=`expr $try + 1`
+ try=$(($try + 1))
else
cat stderr >&2
# Automake must fail with a proper error message.
$AUTOCONF
$AUTOMAKE Makefile
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE test
cp x.c y.c
-instdir=`pwd`/_inst || fatal_ "cannot get current directory"
+instdir=$(pwd)/_inst || fatal_ "cannot get current directory"
# Skip the rest of the test in case of e.g. missing C compiler.
./configure --prefix="$instdir" x=yes || Exit $?
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f inst/etc/mumble
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f inst/etc/mumble
mkdir build
cd build
-../configure FOO=true --prefix="`pwd`/_inst"
+../configure FOO=true --prefix="$(pwd)/_inst"
$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
touch foo.1 6.man
$MAKE install
$MAKE test1
cd ..
-./configure FOO=false --prefix="`pwd`/_inst"
+./configure FOO=false --prefix="$(pwd)/_inst"
$EGREP 'MANS|\.([123456789]|man)' Makefile # For debugging.
touch bar.2 baz.1 zap.5
$MAKE install
is_symlink auxdir/install-sh
test -f auxdir/depcomp
is_not_symlink auxdir/depcomp
-test FAKE-DEPCOMP = `cat auxdir/depcomp`
+test FAKE-DEPCOMP = "$(cat auxdir/depcomp)"
# 'automake -a -c' should not create symlinks, even when there are
# already symlinked required auxiliary files.
plan_ 18
-ocwd=`pwd` || fatal_ "getting top-level directory"
+ocwd=$(pwd) || fatal_ "getting top-level directory"
cat >> configure.ac << 'END'
AC_CONFIG_FILES([sub/Makefile])
$AUTOMAKE --cygnus -Wno-override -Wno-obsolete
$AUTOCONF
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || Exit 1
./configure --prefix="$cwd"/_inst
$MAKE
$MAKE install
cat site.exp
is_newest site.exp Makefile # Sanity check.
grep '|objdir|' site.exp
-test `grep -c '|objdir|' site.exp` -eq 1
+test $($FGREP -c '|objdir|' site.exp) -eq 1
# We can do a "more semantic" check if DejaGnu is available.
if runtest SOMEPROGRAM=someprogram --version; then
$AUTOMAKE -Wno-override
grep 'site\.exp' Makefile.in
-test `grep -c '^site\.exp:' Makefile.in` -eq 1
+test $(grep -c '^site\.exp:' Makefile.in) -eq 1
./configure
$MAKE site.exp
# Check that the DejaGnu rules work for a simple program and test case.
# Also check PR 488: Failure of the first of several tools tested.
# From the original bug report:
-# ``If you use dejagnu for testing and have multiple tools (i.e.,
+# If you use dejagnu for testing and have multiple tools (i.e.,
# multiple entries in the DEJATOOL variable) then the success/failure
# of "make check" is only dependent on the success/failure of the
# tests on the final tool. Thus there may be failures in the tests on
-# previous tools, but at first glance "make check" has passed.''
+# previous tools, but at first glance "make check" has passed.
required=runtest
. ./defs || Exit 1
$ACLOCAL
$AUTOMAKE
-test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
+
+:
fred_SOURCES = fred1.c $headers
END
$AUTOMAKE
- test 1 = `grep '^@AMDEP_TRUE@@am__include@' Makefile.in | wc -l`
+ test 1 -eq $(grep -c '^@AMDEP_TRUE@@am__include@' Makefile.in)
done
:
. ./defs || Exit 1
mkdir acdir-more sub sub/acdir
-echo "`pwd`/acdir-more" > sub/acdir/dirlist
+echo "$(pwd)/acdir-more" > sub/acdir/dirlist
echo 'AC_DEFUN([AM_FOO], [foo-foo--foo])' > acdir-more/foo.m4
. ./defs || Exit 1
count=0
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Usage: do_check [--add-missing] [CONFIG-AUXDIR-PATH=.]
do_check ()
esac
auxdir=${1-.}
- count=`expr $count + 1`
+ count=$(($count + 1))
mkdir T$count.d
cd T$count.d
echo "*** Testing with auxdir '$auxdir' ***"
- i=`expr $i + 1`
+ i=$(($i + 1))
mkdir T$i.d
cd T$i.d
# Common and/or auxiliary subroutines and variables. #
# ---------------------------------------------------- #
-ocwd=`pwd` || fatal_ "obtaining current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
TAR='' && unset TAR
esac
}
+have_compressor ()
+{
+ test $# -eq 1 || fatal_ "have_compressor(): bad usage"
+ case $1 in
+ # Assume gzip(1) is available on every reasonable portability target.
+ gzip)
+ return 0;;
+ # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
+ # and is just a dummy script that is not able to actually compress
+ # (it can only decompress). So, check that the 'compress' program
+ # is actually able to compress input.
+ # Note that, at least on GNU/Linux, 'compress' does (and is
+ # documented to) exit with status 2 if the output is larger than
+ # the input after (attempted) compression; so we need to pass it
+ # an input that it can actually reduce in size when compressing.
+ compress)
+ for x in 1 2 3 4 5 6 7 8; do
+ echo aaaaaaaaaaaaaaaaaaaaa
+ done | compress -c >/dev/null && return 0
+ return 1
+ ;;
+ *)
+ # Redirect to stderr to avoid polluting the output, in case this
+ # function is used in a command substitution (as it is, below).
+ if $1 --version </dev/null >&2; then
+ return 0
+ else
+ return 1
+ fi
+ ;;
+ esac
+ fatal_ "have_compressor(): dead code reached"
+}
+
all_compression_formats='gzip tarZ lzip xz bzip2 zip shar'
-all_compressors=`
+all_compressors=$(
for x in $all_compression_formats; do
setup_vars_for_compression_format $x
echo $compressor
- done | tr "$nl" ' '`
+ done | tr "$nl" ' ')
echo All compressors: $all_compressors
-missing_compressors=`
+missing_compressors=$(
for c in $all_compressors; do
- case $c in
- # Assume gzip(1) is available on every reasonable portability target.
- gzip)
- continue
- ;;
- # On Cygwin, as of 9/2/2012, 'compress' is provided by sharutils
- # and is just a dummy script that is not able to actually compress
- # (it can only decompress). So, check that the 'compress' program
- # is actually able to compress input.
- # Note that, at least on GNU/Linux, 'compress' does (and is
- # documented to) exit with status 2 if the output is larger than
- # the input after (attempted) compression; so we need to pass it
- # an input that it can actually reduce in size when compressing.
- compress)
- for x in 1 2 3 4 5 6 7 8; do
- echo aaaaaaaaaaaaaaa
- done | $c -c >/dev/null && continue
- : For shells with busted 'set -e'.
- ;;
- *)
- $c --version </dev/null >&2 && continue
- : For shells with busted 'set -e'.
- ;;
- esac
- echo $c
- done | tr "$nl" ' '`
+ have_compressor $c || echo $c
+ done | tr "$nl" ' ')
echo Missing compressors: $missing_compressors
+# Redefine to avoid re-running the already executed checks.
have_compressor ()
{
case " $missing_compressors " in *\ $1\ *) false;; *) : ;; esac
if test $# -gt 0; then
eval "$@" || fatal_ "start_subtest: evaluating assignments"
fi
- ac_opts=`echo $ac_opts | tr ',' ' '`
- am_opts=`echo $am_opts | tr ',' ' '`
+ ac_opts=$(echo $ac_opts | tr ',' ' ')
+ am_opts=$(echo $am_opts | tr ',' ' ')
mkdir "$name"
cd "$name"
unindent > configure.ac <<END
&& $MAKE dist-$format \
&& test -f $tarname-1.0.$suffix \
&& ls -l *$tarname* \
- && test "`ls *$tarname*`" = $tarname-1.0.$suffix'
+ && test "$(echo *$tarname*)" = $tarname-1.0.$suffix'
unset suffix compressor format tarname
}
command_ok_ "default [make distcheck]" $MAKE distcheck
command_ok_ "'make dist' only builds *.tar.gz by default" \
- test "`ls *defaults*`" = defaults-1.0.tar.gz
+ test "$(ls *defaults*)" = defaults-1.0.tar.gz
rm -rf *defaults*
cd ..
oPATH=$PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
command_ok_ \
"$desc ['make dist-all', stubbed]" \
$AUTOMAKE
# Use --srcdir with an absolute path because it's harder
# to support in 'distdir'.
-./configure --srcdir "`pwd`"
+./configure --srcdir "$(pwd)"
$MAKE test
+
+:
# A faulty distribution tarball, with a required '.am' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/zardoz.am # Sanity check.
# A faulty distribution tarball, with a required '.m4' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/zardoz.m4 # Sanity check.
# A faulty distribution tarball, with a required '.m4' file missing.
# Building from it should fail, both for in-tree and VPATH builds.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
for vpath in false :; do
$MAKE distdir
test -f $distdir/m4/zardoz.m4 # Sanity check.
PYTHON = false
END
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
# Help to ensure cp won't see the same file twice.
mkdir bin
exec cp "\$@"
END
chmod a+x bin/cp
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH;
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH;
: > foo.c
: > bar.py
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
cp "$am_testauxdir"/distcheck-hook-m4.am . \
|| fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
cp "$am_testauxdir"/distcheck-hook-m4.am . \
|| fatal_ "cannot fetch makefile fragment 'distcheck-hook-m4.am'"
$MAKE
$MAKE distcheck
-infodir="`pwd`"/_info $MAKE -e distcheck
+infodir="$(pwd)/_info" $MAKE -e distcheck
test -f _info/dir || Exit 99 # Sanity check.
:
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
# Sanity checks.
$MAKE install
cat dc.txt # For debugging.
-test 1 = `grep tests dc.txt | wc -l`
+test 1 -eq $(grep -c tests dc.txt)
grep configure dc.txt
# README must come first.
grep 'DIST_COMMON = README' Makefile.in
cat top.txt
cat inner.txt
-test 0 = `grep tests top.txt | wc -l`
-test 1 = `grep wrapper inner.txt | wc -l`
+test 0 -eq $(grep -c tests top.txt)
+test 1 -eq $(grep -c wrapper inner.txt)
:
grep 'MKDIR_P.*\.' stdout && Exit 1
cd ..
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
$MAKE distcheck
:
$MAKE distdir
ls -l $distdir $distdir/doc
cd $distdir
-test "`cat write`" = "all is ok"
+test "$(cat write)" = "all is ok"
test ! -f removed
test ! -r removed
test -f doc/README
./execute | grep 'I run successfully'
cd ..
-
$MAKE distcheck
test -f distcheck-run
ln -s bar1 bar2
ln -s bar2 bar3
-ln -s "`pwd`/foo" quux
+ln -s "$(pwd)/foo" quux
cat >> configure.ac << 'END'
AC_OUTPUT
ln -s nonesuch $lnk1 || skip_ "cannot create broken symlinks"
-ln -s "`pwd`/nonesuch" $lnk2
+ln -s "$(pwd)/nonesuch" $lnk2
ln -s $lnk1 $lnka
ln -s $lnka $lnkb
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
test -f 'inst/my/hello$world'
$MAKE check-dist
+
+:
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE install
+
+:
grep '^maude3$(EXEEXT):' Makefile.in
grep '^mt$(EXEEXT):' Makefile.in
grep '^rmt$(EXEEXT):' Makefile.in
-test `grep '^bin_PROGRAMS =' Makefile.in | wc -l` = 1
+test $(grep -c '^bin_PROGRAMS =' Makefile.in) -eq 1
# Make sure $(EXEEXT) gets stripped before canonicalization.
grep 'maude3__EXEEXT__OBJECTS' Makefile.in && Exit 1
grep '2BEG: maude.static.foo :END2' stdout
grep '3BEG: maude3.foo :END3' stdout
grep '4BEG: :END4' stdout
+
+:
$AUTOMAKE -Wno-override
$FGREP 'maude$(EXEEXT):' Makefile.in
-test 1 = `grep 'maude.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c 'maude.*:' Makefile.in)
$FGREP '3dldf$(EXEEXT):' Makefile.in
-test 1 = `grep '3dldf.*:' Makefile.in | wc -l`
+test 1 -eq $(grep -c '3dldf.*:' Makefile.in)
+
+:
# Only two am__EXEEXT_* variables are needed here: one for BAR, and one
# BAZ. The latter must use the former.
-test 2 = `grep '__EXEEXT_. =' Makefile.in | wc -l`
+test 2 -eq $(grep -c '__EXEEXT_. =' Makefile.in)
grep 'am__EXEEXT_2 = .*am__EXEEXT_1' Makefile.in
:
$ACLOCAL
$AUTOMAKE
-for ext in f for f90 f95 F F90 F95 r m mm upc
-do
- # Some versions of the BSD shell wrongly exit when 'set -e' is active
- # if the last command within a compound statement fails and is guarded
- # by an && only. So we play safe and use the following idiom, instead
- # of the apparently simpler 'grep ... && Exit 1'.
- if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+for ext in f for f90 f95 F F90 F95 r m mm upc; do
grep "^\.$ext\.o:" Makefile.in
+ grep "^$ext\.o:" Makefile.in && Exit 1
+ : For shells with busted 'set -e'.
done
-Exit 0
+
+:
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
-test 2 = `grep 12345678 stderr | wc -l`
+test 2 -eq $(grep -c 12345678 stderr)
:
$MAKE dist 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep 'filenames are too long' stderr
-test 1 = `grep 12345678 stderr | wc -l`
+test 1 -eq $(grep -c 12345678 stderr)
:
# or if the compiler cannot compile Fortran 90 files).
./configure
$MAKE
-subobjs=`echo sub/*.o sub/*.obj`
+subobjs=$(echo sub/*.o sub/*.obj)
test "$subobjs" = 'sub/*.o sub/*.obj'
$MAKE distcheck
test ! -f goodbye-baz.o
test ! -f goodbye-baz.obj
$MAKE distcheck
+
+:
# or if the compiler cannot compile Fortran 90 files).
./configure
$MAKE
-subobjs=`echo sub/*.lo`
+subobjs=$(echo sub/*.lo)
test "$subobjs" = 'sub/*.lo'
$MAKE distcheck
test ! -f baz.lo
test ! -f libgoodbye_la-baz.lo
$MAKE distcheck
+
+:
$ACLOCAL
$AUTOMAKE
-num=`grep depcomp Makefile.in | wc -l`
-test $num -gt 1
+test $($FGREP -c depcomp Makefile.in) -gt 1
:
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure >stdout
+./configure >stdout || { cat stdout; Exit 1; }
cat stdout
# Configure must be checking the dependency style of gcj ...
cat filt
# ... only once.
-test `wc -l < filt` = 1
+test $(wc -l < filt) = 1
# Accept any outcome but 'none'
# (at the time of writing it should be gcc or gcc3).
# in the AM_GNU_GETTEXT_VERSION call in configure.ac if we want autopoint
# (or gettextize) to setup the correct infrastructure -- in particular,
# for what concerns us, to bring in all the required .m4 files.
-autopoint_version=`extract_program_version $am_gettextize_command` \
+autopoint_version=$(extract_program_version $am_gettextize_command) \
&& test -n "$autopoint_version" \
|| autopoint_version=0.10.35
END
if $am_gettextize_command --force && test -f m4/gettext.m4; then
- echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+ echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
echo "export ACLOCAL_PATH" >> get.sh
else
# Older versions of gettext might not have a gettextize program
# Remove any Makefile.in possibly created by gettextize/autopoint, to
# avoid spurious maintainer-check failures.
-rm -f `find . -name Makefile.in`
+rm -f $(find . -name Makefile.in)
# The file gettextize or autopoint might have copied in the 'm4'
# subdirectory of the test directory are going to be needed by
cd build
# Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
$MAKE all
$MAKE test-install
$MAKE -k installcheck 2>stderr || : # Never trust the exit status of make -k.
cd build
# Use --program-prefix to make sure the std-options check honors it.
-../configure "--prefix=`pwd`/../inst-dir" --program-prefix=p
+../configure "--prefix=$(pwd)/../inst-dir" --program-prefix=p
$MAKE
$MAKE install
$MAKE installcheck && Exit 1
$ACLOCAL
$AUTOMAKE
-len=`grep '^srcdir' Makefile.in | wc -l`
-test $len -eq 1
+test $(grep -c '^srcdir' Makefile.in) -eq 1
# Also make sure include file is distributed.
sed -n -e '/^DIST_COMMON =.*\\$/ {
mv -f configure.ac configure.tmpl
-q="[\`'\"]"
-
for args in '' '([])' '([yes])' '([no])'; do
sed "s/AM_SILENT_RULES.*/&$args/" configure.tmpl >configure.ac
cat configure.ac
$AUTOCONF --force
grep_configure_help --enable-silent-rules \
- " less verbose build.*\\(undo.*${q}make V=1${q}"
+ ' less verbose build.*\(undo.*"make V=1".*\)'
grep_configure_help --disable-silent-rules \
- " verbose build.*\\(undo.*${q}make V=0${q}"
+ ' verbose build.*\(undo.*"make V=0".*\)'
done
:
AUTOMAKE=$am_original_AUTOMAKE
escape_dots () { sed 's/\./\\./g'; } # Avoid issues with "\" in backquotes.
-apiversion_rx=`echo "$APIVERSION" | escape_dots`
+apiversion_rx=$(echo "$APIVERSION" | escape_dots)
$ACLOCAL --version --help >stdout || { cat stdout; Exit 1; }
cat stdout
$ACLOCAL
$AUTOMAKE
-for i in `grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'`; do
+for i in $(grep '^INFOS =' Makefile.in | sed -e 's/^INFOS = //'); do
echo $i
case "$i" in
foo*)
required=makeinfo
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir bin
saved_PATH=$PATH; export saved_PATH
$ACLOCAL
$AUTOMAKE
-test `grep installdirs-local Makefile.in | wc -l` -eq 4
+test $(grep -c installdirs-local Makefile.in) -eq 4
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
$AUTOCONF
./configure --prefix="$cwd/inst"
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE install
test ! -d inst/share/instdir-cond
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE installdirs
test ! -d inst || { find inst; Exit 1; }
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir" PYTHON="echo" \
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || fatal_ "getting current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
doinst ()
{
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir" PYTHON="echo" \
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
-destdir=`pwd`/dest
+cwd=$(pwd) || fatal_ "getting current working directory"
+instdir=$cwd/inst
+destdir=$cwd/dest
mkdir build
cd build
../configure --prefix="$instdir"
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
./configure --prefix="$instdir"
$MAKE
$MAKE install-exec && Exit 1
$MAKE readable-progn
-if grep "^EMACS = no" Makefile; then :; else
- for file in lisp1.el lisp1.elc
- do
+if ! grep "^EMACS = no" Makefile; then
+ for file in lisp1.el lisp1.elc; do
chmod a-r $file
$MAKE install-data && Exit 1
chmod u+r $file
# second version will overwrite 'foo'. Hopefully 'install' and 'install-sh'
# are smart enough to erase the 'foo' symlink before installing the new
# version.)
-./configure "--bindir=`pwd`/bin"
+./configure "--bindir=$(pwd)/bin"
$MAKE install
echo 2 > foo
VERSION=2.0 $MAKE -e install
$ACLOCAL
$AUTOMAKE
-grep '[^(/]MKDIR_P' Makefile.in > out
-test `wc -l < out` -eq 1
+grep 'MKDIR_P' Makefile.in # For debugging.
+test $(grep -c '[^(/]MKDIR_P' Makefile.in) -eq 1
+
+:
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
limit=2500
subdir=long_subdir_name_with_many_characters
nfiles=81
-list=`seq_ 1 $nfiles`
+list=$(seq_ 1 $nfiles)
sed "s|@limit@|$limit|g" >myinstall.in <<'END'
#! /bin/sh
$AUTOCONF
$AUTOMAKE --add-missing
-instdir=`pwd`/inst
+instdir=$(pwd)/inst
mkdir build
cd build
../configure --prefix="$instdir"
# Multiple uninstall should work, too.
$MAKE uninstall
$MAKE uninstall
-test `find "$instdir" -type f -print | wc -l` = 0
+test $(find "$instdir" -type f -print | wc -l) -eq 0
# Try whether we don't exceed the low limit.
INSTALL='$(SHELL) $(top_builddir)/myinstall' $MAKE -e install
-env save_PATH="$PATH" PATH="`pwd`/..$PATH_SEPARATOR$PATH" $MAKE uninstall
+env save_PATH="$PATH" PATH="$(pwd)/..$PATH_SEPARATOR$PATH" $MAKE uninstall
cd $subdir
srcdir=../../$subdir
esac
done
# We need to determine the TAP plan adaptively.
- n=`for t in $test_names_list; do echo $t; done | wc -l`
- plan_ `expr $n '*' 2` # Two tests per "problematic string".
+ n=$(for t in $test_names_list; do echo $t; done | wc -l)
+ plan_ $(($n * 2)) # Two tests per "problematic string".
unset n
else
test_names_list=$all_test_names_list
plan_ 94
fi
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
create_input_data
# the test directory not to be removed when the script terminates.
if not am_keeping_testdirs && test "$r" = ok; then
rm_rf_ "$build" "$dest" || fatal_ "removing temporary subdirectory"
- else
- : For lesser shells with broken 'set -e'.
fi
+ : For shells with busted 'set -e'.
+
done # $instspc_action
done # $test_name
$AUTOCONF
$AUTOMAKE
-inst=`pwd`/_inst
+inst=$(pwd)/_inst
./configure --prefix="$inst"
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
$MAKE
$MAKE test
$MAKE install
# To have the parallel testsuite more verbose.
VERBOSE=yes; export VERBOSE
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
cat PkgLocation.java # For debugging.
$MAKE check
$MAKE install
# To have the parallel testsuite more verbose.
VERBOSE=yes; export VERBOSE
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
cat jprog/PkgLocation.java # For debugging.
$MAKE check
$MAKE install
for var in JAVAC JAVAROOT CLASSPATH_ENV am__java_sources; do
grep "^$var =" Makefile.in
- test `grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in` = 1
+ test $(grep -c "^[$sp$tab]*$var[$sp$tab]*=" Makefile.in) -eq 1
done
grep '^classjava\.stamp:' Makefile.in
-test `grep -c "class.*java.*\.stamp.*:" Makefile.in` = 1
+test $(grep -c "class.*java.*\.stamp.*:" Makefile.in) -eq 1
:
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
$MAKE check
$MAKE install
$MAKE test-install
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
ls -l
$AUTOCONF
$AUTOMAKE
-./configure --prefix="`pwd`"/_inst
+./configure --prefix="$(pwd)"/_inst
javadir=_inst/java
check_uninstallation()
$EGREP '\.stamp|class' Makefile.in # For debugging.
grep '^all[-a-z]*:.*classjava\.stamp' Makefile.in
-test `grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in` -eq 1
+test $(grep -c '^all[-a-z]*:.*classjava\.stamp' Makefile.in) -eq 1
-cat >a.java <<EOF
-class a
-{
-}
-EOF
-
-cat >b.java <<EOF
-class b
-{
-}
-EOF
+echo 'class a { }' > a.java
+echo 'class b { }' > b.java
-./configure --prefix "`pwd`"
+./configure
$MAKE distcheck
+
+:
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
-./configure --prefix="$cwd/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
$MAKE install
ls -l .
# Program should build and run and distribute.
$MAKE all
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./lexer
echo BAD | ./lexer && Exit 1
: For shells with busted 'set -e'.
# Program should build and run.
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./foo
echo BAD | ./foo && Exit 1
: For shells with busted 'set -e'.
$sleep
$MAKE lexer.c lexer2.c
stat lexer.c lexer.l lexer2.c lexer2.l || : # For debugging.
-test `ls -t lexer.c lexer.l | sed 1q` = lexer.c
-test `ls -t lexer2.c lexer2.l | sed 1q` = lexer2.c
+test $(ls -t lexer.c lexer.l | sed 1q) = lexer.c
+test $(ls -t lexer2.c lexer2.l | sed 1q) = lexer2.c
:
# Program should build and run.
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo GOOD | ./foo
echo BAD | ./foo && Exit 1
: For shells with busted 'set -e'.
AUTOMAKE_fails
grep '^Makefile.am:.*: !A and !C and !D$' stderr
# Is there only one missing condition?
-test `grep ': !' stderr | wc -l` = 1 || Exit 1
+test $(grep -c ': !' stderr) -eq 1
+
+:
echo ACLOCAL_AMFLAGS = -I m4 > Makefile.am
if libtoolize --copy --install && test -f m4/libtool.m4; then
- echo "ACLOCAL_PATH='`pwd`/m4':\$ACLOCAL_PATH" >> get.sh
+ echo "ACLOCAL_PATH='$(pwd)/m4':\$ACLOCAL_PATH" >> get.sh
echo "export ACLOCAL_PATH" >> get.sh
else
# Libtoolize from libtool < 2.0 didn't support the '--install' option,
$ACLOCAL
$AUTOMAKE --add-missing
# am_liba_la_rpath is defined twice, and used once
-test 3 = `grep 'am_liba_la_rpath' Makefile.in | wc -l`
+test 3 -eq $(grep -c 'am_liba_la_rpath' Makefile.in)
+
+:
$AUTOCONF
$AUTOMAKE --add-missing --copy
-./configure "--prefix=`pwd`/_inst"
+./configure "--prefix=$(pwd)/_inst"
env LIBTOOLFLAGS=--silent $MAKE print >output 2>&1 || {
cat output
Exit 1
grep '1BEG: libmod1.la mod2.la :END1' output
grep '2BEG: mod2.la :END2' output
grep '3BEG: .*silent.*silent.* :END3' output
-test 2 -le `grep mod2_la_LIBTOOLFLAGS Makefile | wc -l`
+test 2 -le $(grep mod2_la_LIBTOOLFLAGS Makefile | wc -l)
$MAKE
env LIBTOOLFLAGS=--silent $MAKE install >output 2>&1 || {
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix="`pwd`/_inst"
+./configure --prefix="$(pwd)/_inst"
$MAKE
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
# Fake the absence of emacs.
# *.el files should not be installed, but "make install" and
# "make uninstall" should continue to work.
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
# Fake the absence of emacs.
# *.el files SHOULD be installed by "make install" (and uninstalled
# by "make uninstall").
-./configure EMACS=no --prefix "`pwd`"
+./configure EMACS=no --prefix "$cwd"
$MAKE
$MAKE test
$MAKE install-test
AC_OUTPUT
EOF
+# Avoid possible spurious influences from the environment.
+want_two=; unset want_two
+
echo "(provide 'am-one)" > am-one.el
echo "(require 'am-one)" > am-two.el
echo "(require 'am-one)" > am-three.el
$AUTOCONF
$AUTOMAKE --add-missing
-./configure "--with-lispdir=`pwd`/lisp"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --with-lispdir="$cwd/lisp"
$MAKE
test -f am-one.elc
test ! -f am-three.elc
test ! -f elc-stamp
-./configure "--with-lispdir=`pwd`/lisp" want_two=1
+./configure --with-lispdir="$cwd/lisp" want_two=1
$MAKE
test -f am-one.elc
$MAKE >stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test ! -f am-one.elc
test ! -f am-two.elc
$MAKE -j >>stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test -f am-one.elc
test -f am-two.elc
$MAKE -j >>stdout || { cat stdout; Exit 1; }
cat stdout
-test 1 -eq `grep 'Warnings can be ignored' stdout | wc -l`
+test 1 -eq $(grep -c 'Warnings can be ignored' stdout)
test -f am-one.elc
test -f am-two.elc
test -f am-three.elc
. ./defs || Exit 1
-n=1
-files=
-match=
+n=1 files= match=
while test $n -le 100
do
files="$files filename$n"
match="..........$match"
- n=`expr $n + 1`
+ n=$(($n + 1))
done
-files2=`echo "$files" | sed s/filename/filenameb/g`
+files2=$(echo "$files" | sed s/filename/filenameb/g)
cat >Makefile.am <<EOF
FOO = $files $files2 \
grep $match Makefile.in && Exit 1
grep 'filenameb100 grepme' Makefile.in
+
+:
$ACLOCAL
$AUTOMAKE
-test 80 -ge `grep DUMMY Makefile.in | wc -c`
+test 80 -ge $(grep DUMMY Makefile.in | wc -c)
+
+:
$AUTOCONF
$AUTOMAKE --add-missing
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Install libraries in lib/, and the rest in empty/.
# (in fact there is no "rest", so as the name imply empty/ is
# expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib"
$MAKE
test -f lib1foo.la
test -f lib/lib2foo.la
test ! -f lib/lib3foo.la
find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
$MAKE uninstall
find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
+test -s lib.lst && { cat lib.lst; Exit 1; }
test -f lib1foo.la
test -f lib1bar.la
test -f lib2foo.la
$AUTOCONF
$AUTOMAKE --add-missing
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Install libraries in lib/, programs in bin/, and the rest in empty/.
# (in fact there is no "rest", so as the name imply empty/ is
# expected to remain empty).
-./configure "--prefix=`pwd`/empty" "--libdir=`pwd`/lib" "--bindir=`pwd`/bin"
+./configure --prefix="$cwd/empty" --libdir="$cwd/lib" --bindir="$cwd/bin"
$MAKE
test -f libtop.la
rm -f installcheck-ok
find empty -type f -print > empty.lst
-cat empty.lst
-test 0 = `wc -l < empty.lst`
+test -s empty.lst && { cat empty.lst; Exit 1; }
$MAKE clean
test ! -f libtop.la
rm -f installcheck-ok
$MAKE uninstall
-find lib -type f -print > lib.lst
-test 0 = `wc -l < lib.lst`
-find bin -type f -print > bin.lst
-test 0 = `wc -l < bin.lst`
+for d in lib bin; do
+ find $d -type f -print > $d.lst
+ test -s $d.lst && { cat $d.lst; Exit 1; }
+ : For shells with busted 'set -e'.
+done
:
$EGREP 'LT_(INIT|PREREQ)' configure && Exit 1 # Sanity check.
$AUTOMAKE -a
-cwd=`pwd`
-./configure --prefix="$cwd/inst" >stdout || { cat stdout; Exit 1; }
+./configure --prefix="$(pwd)/inst" >stdout || { cat stdout; Exit 1; }
cat stdout
grep '^checking.*dlfcn\.h.* no$' stdout || grep '^checking.*dlopen' stdout
$AUTOCONF
$AUTOMAKE --add-missing
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE
$MAKE install 2>stderr || { cat stderr >&2; Exit 1; }
grep 'has not been installed' stderr && Exit 1
$MAKE uninstall
-test `find inst -type f -print | wc -l` -eq 0
+test $(find inst -type f -print | wc -l) -eq 0
:
./configure ${1+"$@"} >stdout || { cat stdout; Exit 1; }
cat stdout
grep "^checking whether to enable maintainer-specific.*\\.\\.\\. $answer$" stdout
- test `grep -c 'checking.*maint' stdout` -eq 1
- :
+ test $(grep -c 'checking.*maint' stdout) -eq 1
}
set_maintmode "DEFAULT"
check_no_dryrun ()
{
command_ok_ "dry-run ($cnt)" $MAKE notdry ${1+"$@"}
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
fi
result_ "$r" -D "$directive" -r "$reason" "not dry-run ($cnt)"
unset r directive reason
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
fi
result_ "$r" "dry-run, with shell metachars ($cnt)"
unset r
- cnt=`expr $cnt + 1`
+ cnt=$(($cnt + 1))
}
cnt=1
mkdir build
cd build
-../configure "--prefix=`pwd`/inst"
+../configure --prefix="$(pwd)/inst"
$MAKE -j2 || skip_ "$MAKE failed to run with two parallel jobs"
$MAKE -j2 distcheck
$MAKE test-distdir-removed
-Exit 0
+:
$MAKE -n $target | grep stamp-sub-dist-hook || Exit 1
fi
$MAKE test-no-distdir
- test `ls -1t | sed 1q` = stampfile
+ test $(ls -1t | sed 1q) = stampfile
done
-Exit 0
+:
$AUTOCONF
$AUTOMAKE
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Let's play with $DESTDIR too, it shouldn't hurt.
./configure --prefix='' --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
test -f ./_inst/man/man2/foo.2
test -f ./_inst/man/man4/foo.4
test -f ./_inst/man/man4/bar.4
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
test ! -f ./_inst/man/man2/foo.2
test ! -f ./_inst/man/man4/foo.4
exit 127
END
chmod +x bin/help2man
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
grep_error_messages()
{
$AUTOCONF
$AUTOMAKE
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Let's play with $DESTDIR too, it shouldn't hurt.
./configure --mandir=/man
-$MAKE DESTDIR="`pwd`/_inst" install
+$MAKE DESTDIR="$cwd/_inst" install
-test -f ./_inst/man/man2/foo.2
-test -f ./_inst/man/man2/nfoo.2
-test -f ./_inst/man/man2/baz-1.4.2
-test -f ./_inst/man/man2/nbaz-1.4.2
-test -f ./_inst/man/man3/bar.3
-test -f ./_inst/man/man3/nbar.3
+test -f _inst/man/man2/foo.2
+test -f _inst/man/man2/nfoo.2
+test -f _inst/man/man2/baz-1.4.2
+test -f _inst/man/man2/nbaz-1.4.2
+test -f _inst/man/man3/bar.3
+test -f _inst/man/man3/nbar.3
-test ! -d ./_inst/man/man1
-test ! -d ./_inst/man/man4
-test ! -d ./_inst/man/man5
+test ! -d _inst/man/man1
+test ! -d _inst/man/man4
+test ! -d _inst/man/man5
-$MAKE DESTDIR="`pwd`/_inst" uninstall
+$MAKE DESTDIR="$cwd/_inst" uninstall
-test ! -f ./_inst/man/man2/foo.2
-test ! -f ./_inst/man/man2/nfoo.2
-test ! -f ./_inst/man/man2/baz-1.4.2
-test ! -f ./_inst/man/man2/nbaz-1.4.2
-test ! -f ./_inst/man/man3/bar.3
-test ! -f ./_inst/man/man3/nbar.3
+test ! -f _inst/man/man2/foo.2
+test ! -f _inst/man/man2/nfoo.2
+test ! -f _inst/man/man2/baz-1.4.2
+test ! -f _inst/man/man2/nbaz-1.4.2
+test ! -f _inst/man/man3/bar.3
+test ! -f _inst/man/man3/nbar.3
:
get_shell_script mdate-sh
-set x `./mdate-sh mdate-sh`
+set x $(./mdate-sh mdate-sh)
shift
echo "$*" # For debugging.
esac
# Stricter checks on the year required a POSIX date(1) command.
-if year=`date +%Y` && test $year -gt 2010; then
+if year=$(date +%Y) && test $year -gt 2010; then
test $year = $3 || Exit 1
fi
# These programs may be invoked by 'missing'.
needed_tools='chmod find sed test touch'
-needed_tools_csep=`echo $needed_tools | sed 's/ /, /g'`
+needed_tools_csep=$(echo $needed_tools | sed 's/ /, /g')
cat >configure.ac <<EOF
AC_INIT([missing4], [1.0])
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure --prefix "`pwd`/sub"
+./configure --prefix "$(pwd)/sub"
$MAKE installdirs
test ! -d sub/man
+$MAKE install
+test ! -d sub/man
+
+:
am_create_testdir=empty
. ./defs || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
+
# Make sure the directory we will create can be created...
mkdir '~a b' && mkdir '~a b/-x y' \
|| skip_ "directory names with spaces and metacharacters not accepted"
EOF
chmod +x bin/mkdir
-AM_PATH=$PATH
-export AM_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
-export PATH
+
+AM_PATH=$PATH; export AM_PATH
+PATH=$cwd/bin$PATH_SEPARATOR$PATH; export PATH
# Test mkinstalldirs without mkdir -p.
test -d '~a b/-x y'
rm -rf '~a b'
-./mkinstalldirs "`pwd`///~a b//-x y"
-test -d "`pwd`/~a b/-x y"
+./mkinstalldirs "$cwd///~a b//-x y"
+test -d "$cwd/~a b/-x y"
rm -rf '~a b'
+
+:
echo "$@" >lex.yy.c
END
chmod +x myyacc.sh mylex.sh
-PATH="`pwd`$PATH_SEPARATOR$PATH"
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
# "make maintainer-clean; ./configure; make" should always work,
# per GNU Standard.
./configure
YACC="myyacc.sh" LEX="mylex.sh" \
LEX_OUTPUT_ROOT='lex.yy' $MAKE -e zardoz.c joe.c
-grep zardoz.y zardoz.c
-grep joe.l joe.c
+$FGREP zardoz.y zardoz.c
+$FGREP joe.l joe.c
+
+:
cp "$mldir"/config-ml.in "$mldir"/symlink-tree .
cp "$mldir"/multi.m4 m4
-ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}`pwd`/m4
+ACLOCAL_PATH=${ACLOCAL_PATH+"$ACLOCAL_PATH:"}$(pwd)/m4
export ACLOCAL_PATH
cat >configure.ac <<'END'
END
chmod +x mycc
-PATH=`pwd`$PATH_SEPARATOR$PATH
+PATH=$(pwd)$PATH_SEPARATOR$PATH; export PATH
cat >Makefile.am <<'EOF'
SUBDIRS = @subdirs@
mkdir sub
cat >source.c <<'EOF'
-int
-main (int argc, char *argv[])
+int main (int argc, char *argv[])
{
return 0;
}
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
$MAKE install-strip
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
:
mkdir sub
-for file in one.py sub/base.py two.py sub/nobase.py
-do
+for file in one.py sub/base.py two.py sub/nobase.py; do
echo 'def one(): return 1' >$file
done
$AUTOCONF
$AUTOMAKE --add-missing
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE uninstall
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p
+./configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
$MAKE install-strip
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p
+../configure --prefix "$(pwd)/inst" --program-prefix=p
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
:
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure --prefix "`pwd`/install"
+./configure --prefix "$(pwd)/install"
$MAKE install-data
:
test -f inst/man/man2/z-bar2.2
test -f inst/man/man1/z-baz.1
test -f inst/man/man1/z-baz2.1
- if test -d inst/man/man8; then (exit 1); else :; fi
- if test -d inst/man/man9; then (exit 1); else :; fi
+ test ! -d inst/man/man8
+ test ! -d inst/man/man9
EOF
: > foo.1
grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
+grep '^install-man8:' Makefile.in && Exit 1
+grep '^install-man9:' Makefile.in && Exit 1
-if grep '^install-man8:' Makefile.in; then Exit 1; else :; fi
-if grep '^install-man9:' Makefile.in; then Exit 1; else :; fi
+cwd=$(pwd) || fatal_ "getting current working directory"
-./configure --program-prefix=gnu- --prefix "`pwd`"/inst --mandir "`pwd`"/inst/man
+./configure --program-prefix=gnu- --prefix "$cwd"/inst \
+ --mandir "$cwd"/inst/man
$MAKE
$MAKE test-install
-test `find inst/man -type f -print | wc -l` = 24
+test $(find inst/man -type f -print | wc -l) -eq 24
$MAKE uninstall
-test `find inst/man -type f -print | wc -l` = 0
+test $(find inst/man -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
test -d inst/man/man5
test -d inst/man/man6
test -d inst/man/man7
-if test -d inst/man/man8; then Exit 1; else :; fi
-if test -d inst/man/man9; then Exit 1; else :; fi
+test -d inst/man/man8 && Exit 1
+test -d inst/man/man9 && Exit 1
+
+:
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Test to make sure _OBJECTS only generated once. Bug reported by
+# Test to make sure _OBJECTS is only generated once. Bug reported by
# Joerg-Martin Schwarz.
. ./defs || Exit 1
$AUTOMAKE
grep '^zardoz_OBJECTS' Makefile.in
-count=`grep -c '^zardoz_OBJECTS' Makefile.in`
-test $count -eq 1
+test $(grep -c '^zardoz_OBJECTS' Makefile.in) -eq 1
:
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent > exp << 'END'
[Hello C, world C]
[Hello C++, world C++]
$MAKE all
cat foo
cat zardoz
-test "`cat foo`" = "Linked foo from foo.fasl"
-test "`cat zardoz`" = "Linked zardoz from mu1.fasl mu2.fasl"
+test "$(cat foo)" = "Linked foo from foo.fasl"
+test "$(cat zardoz)" = "Linked zardoz from mu1.fasl mu2.fasl"
:
cat obs.2 # Likewise.
# Sanity check. Make sure we have added something to configure.ac.
-test `wc -l <configure.ac` -gt 1
+test $(wc -l <configure.ac) -gt 1
$ACLOCAL
$ACLOCAL
AUTOMAKE_fails
-test `grep -c anachronism stderr` -eq 8
+test $(grep -c anachronism stderr) -eq 8
+
+:
./configure
$MAKE
-test "`cat a/foo.sh`" = foo
+test "$(cat a/foo.sh)" = foo
$sleep
echo 'bar' >a/foo.sh.in
cd a
$MAKE foo.sh
-test "`cat foo.sh`" = bar
+test "$(cat foo.sh)" = bar
+
+:
$AUTOMAKE -Wno-override
# "ps:" should be output in two conditions
-test `grep '[^-]ps:' Makefile.in | wc -l` = 2
+test $(grep -c '[^-]ps:' Makefile.in) -eq 2
grep '@COND_TRUE@ps: *foobar' Makefile.in
grep '@COND_FALSE@ps: *ps-am' Makefile.in
$AUTOMAKE -Wno-override
# Overriding 'html' should cause only one "html:" rule to be output.
-test `grep '^html:' Makefile.in | wc -l` = 1
+test $(grep -c '^html:' Makefile.in) -eq 1
:
unset AUTOMAKE_JOBS || :
AUTOMAKE_run --add-missing
mv stderr expected
-Makefile_ins=`find . -name Makefile.in`
+Makefile_ins=$(find . -name Makefile.in)
for file in $Makefile_ins; do
mv $file $file.exp
done
# $failure_statuses should be defined to the list of all integers between
# 1 and 255 (inclusive), excluded 77 and 99.
-failure_statuses=`seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' '`
+failure_statuses=$(seq_ 1 255 | $EGREP -v '^(77|99)$' | tr "$nl" ' ')
# For debugging.
echo "failure_statuses: $failure_statuses"
# Sanity check.
-test `for st in $failure_statuses; do echo $st; done | wc -l` -eq 253 \
+test $(for st in $failure_statuses; do echo $st; done | wc -l) -eq 253 \
|| fatal_ "initializing list of exit statuses for simple failures"
cat > Makefile.am <<END
-LOG_COMPILER = ./do-exit
+LOG_COMPILER = $AM_TEST_RUNNER_SHELL ./do-exit
fail_tests = $failure_statuses
TESTS = 0 77 99 $failure_statuses
\$(TESTS):
echo "$0: $1"
case $1 in
[0-9]|[0-9][0-9]|[0-9][0-9][0-9]) st=$1;;
- */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=`echo x"$1" | sed 's|.*/||'`;;
+ */[0-9]|*/[0-9][0-9]|*/[0-9][0-9][0-9]) st=${1##*/};;
*) st=99;;
esac
exit $st
cat > Makefile.am << 'END'
TESTS = foo.test
## Provide more debugging info.
-TEST_LOG_COMPILER = $(SHELL) -x
+TEST_LOG_COMPILER = $(SHELL) -ex
## Required by foo.test; see below.
AM_TESTS_FD_REDIRECT = 9>&1
END
sed 's/--chk/--am-test/' chk-compiler > test-compiler
mkdir bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
cat > bin/t-compiler <<'END'
#! /bin/sh
for count in 1 2 4 8 12 16 20 24 28 32 48 64 96 128 E_HUGE; do
test $count = E_HUGE && break
- count=`expr $count '*' 100` || Exit 99
+ count=$(($count * 100))
setup_data
if $MAKE this-will-fail; then
continue
# hit the system command-line limits; we can stop. But first, for
# good measure, increase the number of tests of some 20%, to be
# "even more sure" of really tickling command line length limits.
- count=`expr '(' $count '*' 12 ')' / 10` || Exit 99
+ count=$(($count * 12))
+ count=$(($count / 10))
setup_data
break
fi
sed 20q lst # For debugging.
sed 20q grp # Likewise.
-test `cat <grp | wc -l` -eq $count
-test `cat <lst | wc -l` -eq $count
+test $(cat <grp | wc -l) -eq $count
+test $(cat <lst | wc -l) -eq $count
# We need to simulate a failure of two tests.
st=0
env TESTS="$deepdir/$tname-1.test $deepdir/$tname-2.test" \
TEST_LOG_COMPILER=false $MAKE -e check > stdout && st=1
cat stdout
-test `grep -c '^FAIL:' stdout` -eq 2 || st=1
+test $(grep -c '^FAIL:' stdout) -eq 2 || st=1
test $st -eq 0 || fatal_ "couldn't simulate failure of two tests"
unset st
cat stdout
grep "^PASS: .*$tname-1\.test" stdout
grep "^PASS: .*$tname-2\.test" stdout
-test `LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout` -eq 2
+test $(LC_ALL=C grep -c "^[A-Z][A-Z]*:" stdout) -eq 2
grep "^# TOTAL: 2$" stdout
grep "^# PASS: 2$" stdout
cat my-shell
-CONFIG_SHELL=`pwd`/my-shell; export CONFIG_SHELL
+CONFIG_SHELL=$(pwd)/my-shell; export CONFIG_SHELL
$ACLOCAL
$AUTOCONF
count_test_results total=3 pass=1 fail=1 skip=0 xfail=0 xpass=0 error=1
test -f test-suite.log
cat test-suite.log
-test `grep -c '^FAIL:' test-suite.log` -eq 1
-test `grep -c '^ERROR:' test-suite.log` -eq 1
+test $(grep -c '^FAIL:' test-suite.log) -eq 1
+test $(grep -c '^ERROR:' test-suite.log) -eq 1
$EGREP '^(X?PASS|XFAIL|SKIP)' test-suite.log && Exit 1
test -f baz.log
test -f bar.log
while :; do
for r2h in $RST2HTML rst2html rst2html.py; do
echo "$me: running $r2h --version"
- # Don't use "&&" here, or a bug of 'set -e' present in some
- # versions of the BSD shell will be triggered. We add the
- # dummy "else" branch for extra safety.
- if $r2h --version; then break 2; else :; fi
+ $r2h --version && break 2
+ : For shells with busted 'set -e'.
done
skip_all_ "no proper rst2html program found"
done
# still be ongoing when the parallel one has terminated.
kill -0 $!
cat parallel/stdout
-test `grep -c '^PASS:' parallel/stdout` -eq 12
+test $(grep -c '^PASS:' parallel/stdout) -eq 12
# Wait long enough so that there are no open files any more when the
# post-test cleanup runs. But exit after we've waited for two minutes
# already happened).
i=1
while test ! -f serial/test-suite.log && test $i -le 120; do
- i=`expr $i + 1`
+ i=$(($i + 1))
sleep '1' # Extra quoting to please maintainer-check.
done
$sleep
$ACLOCAL
$AUTOMAKE
-test `$FGREP .PHONY: Makefile.in | wc -l` = 3
+test $($FGREP -c '.PHONY:' Makefile.in) -eq 3
+
+:
# Is !CHECK mentioned?
grep ':.*!CHECK$' stderr
# Is there only one missing condition?
-test `grep ': ' stderr | wc -l` = 1
+test $(grep -c ': ' stderr) -eq 1
# By the way, Automake should suggest using AM_CPPFLAGS,
# because INCLUDES is an obsolete name.
$ACLOCAL
$AUTOMAKE
-$FGREP '@mandir@ foo' Makefile.in
-num=`grep '^mandir =' Makefile.in | wc -l`
-test $num -eq 1
+$FGREP 'mandir' Makefile.in # For debugging.
+$FGREP '@mandir@ foo' Makefile.in
+test $(grep -c '^mandir =' Makefile.in) -eq 1
:
$ACLOCAL
AUTOMAKE_fails -Wno-portability
-q="[\`'\"]"
-grep "^Makefile\.am:3:.* AR .* with $q=$q before .*$q+=$q" stderr
+grep "^Makefile\.am:3:.* AR .* with '=' before .*'+='" stderr
:
grep '[cC]annot apply.*+=' stderr
grep ': !COND1 and !COND3$' stderr
# Make sure there is exactly one missing condition.
-test `grep ': ' stderr | wc -l` = 1
+test $(grep -c ': ' stderr) -eq 1
:
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE install
test -f bar.data
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
test -f libfoo2.c
$AUTOCONF
$AUTOMAKE -a
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
test -f libfoo2.c
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
$MAKE install
$AUTOCONF
$AUTOMAKE
-cwd=`pwd` || Exit 1
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE
$MAKE test1 test2
#! /bin/sh
echo Maude
END
-
chmod +x foo
mkdir install
$AUTOCONF
$AUTOMAKE -a
-./configure "--prefix=`cd install && pwd`"
+./configure "--prefix=$(cd install && pwd)"
$MAKE
$MAKE distdir
# or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
# file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
# as is the case with openSUSE 12.1). See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
$MAKE
# or distributions possibly overriding '${libdir}' in their $CONFIG_SITE
# file (for example, defining it to '${prefix}/lib64' on 64-bit systems,
# as is the case with openSUSE 12.1). See automake bug#10426.
-cwd=`pwd` || Exit 99
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix "$cwd/inst" --libdir "$cwd/inst/lib"
# A rule in the Makefile should create subdir.
$AUTOCONF
$AUTOMAKE --copy --add-missing
-./configure --prefix "`pwd`/inst"
+./configure --prefix "$(pwd)/inst"
$MAKE test-all
$MAKE test-install
AM_INIT_AUTOMAKE
AC_PROG_CC
AC_CONFIG_FILES([Makefile])
-AC_CONFIG_FILES([`echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g'`])
+AC_CONFIG_FILES([$(echo $subdirs | sed 's|\([a-z][a-z]*\)|\1/Makefile|g')])
AC_OUTPUT
EOF
$AUTOMAKE -a
$AUTOCONF
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
./configure --prefix="$cwd/_inst"
$MAKE install
am_create_testdir=empty
. ./defs || Exit 1
-libdir=`$AUTOMAKE --print-libdir` || Exit 1
+libdir=$($AUTOMAKE --print-libdir) || Exit 1
case $libdir in /*);; *) Exit 1;; esac
test -d "$libdir"
test "$libdir" = "$am_pkgvdatadir"
|| fatal_ "failed to fetch auxiliary script py-compile"
f=__init__
-for d in foo foo/bar "`pwd`/foo" . .. ../foo ''; do
+for d in foo foo/bar "$(pwd)/foo" . .. ../foo ''; do
if test -z "$d"; then
d2=.
else
required=python
. ./defs || Exit 1
-ocwd=`pwd` || Exit 99
+ocwd=$(pwd) || fatal_ "getting current working directory"
pyfiles="
foo.py
day='([012][0-9]|3[01])'
hour='([01][0-9]|2[0123])'
LC_ALL=C $EGREP "^py-compile $year-$month-$day\.$hour" stdout
-test `wc -l <stdout` -eq 1
+test $(wc -l <stdout) -eq 1
# Unknown option.
for opt in -b -d --foo; do
./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
- grep "^py-compile: unrecognized option ['\`]$opt'" stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^py-compile: unrecognized option '$opt'" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
# Missing option argument.
for opt in --basedir --destdir; do
./py-compile $opt 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
- grep "^py-compile: option ['\`]$opt' requires an argument" stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^py-compile: option '$opt' requires an argument" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
# Missing files.
./py-compile $args 2>stderr && { cat stderr >&2; Exit 1; }
cat stderr >&2
grep '^py-compile: no files given' stderr
- grep "^Try [\`']py-compile --help' for more information" stderr
+ grep "^Try 'py-compile --help' for more information" stderr
done
:
$AUTOMAKE --add-missing
test -f py-compile
-inst=`pwd`/inst
-
-./configure --prefix="$inst"
+./configure --prefix="$(pwd)/inst"
$MAKE install
-test -f "$inst/py/yes.py"
-test -f "$inst/py/yes.pyc"
-test ! -f "$inst/py/no.py"
-test ! -f "$inst/py/no.pyc"
+test -f inst/py/yes.py
+test -f inst/py/yes.pyc
+test ! -f inst/py/no.py
+test ! -f inst/py/no.pyc
$MAKE disttest
# vary among different python installations, so we need more relaxed
# and ad-hoc checks for them. Also, more proper "functional" checks
# on them should be done in the 'python-virtualenv.test' test.
-PYTHON_VERSION=`$PYTHON -c 'import sys; print(sys.version[:3])'` || Exit 1
-PYTHON_PLATFORM=`$PYTHON -c 'import sys; print(sys.platform)'` || Exit 1
+PYTHON_VERSION=$($PYTHON -c 'import sys; print(sys.version[:3])') || Exit 1
+PYTHON_PLATFORM=$($PYTHON -c 'import sys; print(sys.platform)') || Exit 1
PYTHON_EXEC_PREFIX='${exec_prefix}'
PYTHON_PREFIX='${prefix}'
pkgpythondir="\${pythondir}/$me"
framework_failure_ "can't activate python virtual environment"
fi
-cwd=`pwd`
-py_version=`python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))'`
+cwd=$(pwd) || fatal_ "getting current working directory"
+py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))')
py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages
# We need control over the package name.
grep "py" Makefile.in Makefile2.in Makefile3.in # For debugging.
for f in Makefile.in Makefile2.in Makefile3.in; do
- test `grep -c '^py_compile =' $f` -eq 1
- test `grep -c '^am__py_compile =' $f` -eq 1
+ test $(grep -c '^py_compile =' $f) -eq 1
+ test $(grep -c '^am__py_compile =' $f) -eq 1
done
:
$AUTOCONF
$AUTOMAKE --add-missing
-mkdir inst
-inst=`pwd`/inst
-mkdir build
-cd build
-../configure --prefix="$inst"
+inst=inst_
+mkdir inst_ build_
+cd build_
+
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+../configure --prefix="$cwd/$inst" one=0
$MAKE install
test -f "$inst/your/two.py"
test -f "$inst/your/two.pyc"
test ! -f "$inst/your/two.pyc"
test ! -f "$inst/your/two.pyo"
-../configure --prefix="$inst" one=1
+../configure --prefix=$cwd/"$inst" one=1
$MAKE install
test ! -f "$inst/your/two.py"
test ! -f "$inst/your/two.pyc"
$AUTOCONF
$AUTOMAKE --add-missing
-rm -rf inst build
-mkdir inst
-instdir=`pwd`/inst
-mkdir build
+instdir=$(pwd)/inst
+mkdir inst build
cd build
../configure --prefix="/usr"
$MAKE install DESTDIR=$instdir
$AUTOCONF
$AUTOMAKE --add-missing
-mkdir inst
-inst=`pwd`/inst
mkdir build
cd build
-../configure --prefix="$inst"
+../configure --prefix="$(pwd)/inst"
$MAKE install
-test -f "$inst/my/one.py"
-test -f "$inst/my/one.pyc"
-test -f "$inst/my/one.pyo"
+test -f inst/my/one.py
+test -f inst/my/one.pyc
+test -f inst/my/one.pyo
:
exec python ${1+"$@"}
END
chmod a+x bin/my-python
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
: > Makefile.am
# Simulate no Python.
./configure PYTHON=:
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
:
$AUTOMAKE --add-missing
./configure
-test x"`cat py`" = x:
+test x"$(cat py)" = x:
:
$AUTOMAKE --add-missing
./configure
-test x"`cat py.out`" = x0:1
+test x"$(cat py.out)" = x0:1
:
# Both aclocal and automake are expected to run one and just one time.
# Create and use wrappers that will verify that.
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir bin
. ./defs || Exit 1
-ocwd=`pwd` || Exit 1
+ocwd=$(pwd) || fatal_ "getting current working directory"
magic1=::MagicStringOne::
magic2=__MagicStringTwo__
echo AC_OUTPUT >> "$ocwd"/configure.ac
: > Makefile.am
unset d i
-bottom=`pwd`
+
+bottom=$(pwd) || fatal_ "getting current working directory"
cd "$ocwd"
./configure
$MAKE
+do_check ()
+{
+ $MAKE >stdout || { cat stdout; Exit 1; }
+ cat stdout
+ test $(grep -c " --run " stdout) -eq 1
+}
+
# Now, we are set up. Ensure that, for either missing Makefile.in,
# or updated Makefile.am, rebuild rules are run, and run exactly once
# only.
rm -f Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
rm -f sub/Makefile.in
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
$sleep # Let touched files appear newer.
touch Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
touch sub/Makefile.am
-$MAKE >stdout || { cat stdout; Exit 1; }
-cat stdout
-test `grep -c " --run " stdout` -eq 1
+do_check
:
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\)=.*/\\1='$magic2'/"' \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-configure-in # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo 'sed "s/^\\(FINGERPRINT\\) *=.*/\\1 = '$magic2'/"' \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-makefile-am # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo "echo 'AC_DEFUN([my_fingerprint], [$magic2])'" \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo : > $srcdir/tweak-acinclude-m4 # Make it a no-op again.
remake_
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile
- test x"`./foo.sh`" = x"$magic1"
+ test x"$(./foo.sh)" = x"$magic1"
$sleep
echo "sed 's/.*dnl *%%%.*/AC_DEFUN([my_fingerprint], [$magic2])/'" \
$FGREP FINGERPRINT Makefile # For debugging.
$FGREP $magic1 Makefile && Exit 1
$FGREP $magic2 Makefile
- test x"`./foo.sh`" = x"$magic2"
+ test x"$(./foo.sh)" = x"$magic2"
$sleep
echo cat > $srcdir/tweak-aclocal-m4 # Make it a no-op again.
# We still need a little hack to make ./defs work outside automake's
# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
"$am_top_builddir"/defs-static >defs-static
diff "$am_top_builddir"/defs-static defs-static \
&& fatal_ "failed to edit defs-static"
env keep_testdirs=yes \
$AM_TEST_RUNNER_SHELL -c ". ./defs && echo okok >foo" t/dummy.sh \
&& test -f t/dummy.dir/foo \
- && test okok = `cat t/dummy.dir/foo`'
+ && test okok = $(cat t/dummy.dir/foo)'
do_clean
command_ok_ "post-cleanup with testdir with zero-perms symlinks" \
$AM_TEST_RUNNER_SHELL -c '
- ocwd=`pwd` || exit 1
+ ocwd=$(pwd) || exit 1
stderr_fileno_=2
. ./defs || Exit 1
ln -s "$ocwd/dir" "$ocwd/file" .
# This needs to be consistent with what $AM_TEST_RUNNER_SHELL
# deems to be the current working directory.
-cwd=`$AM_TEST_RUNNER_SHELL -c 'pwd'` \
+cwd=$($AM_TEST_RUNNER_SHELL -c 'pwd') \
|| fatal_ "can't get current working directory"
echo "$cwd"
do_check 'testdir has the expected path' \
'unset am_create_testdir' \
- 'case `pwd` in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
+ 'case $(pwd) in '"$cwd"'/t/_self.dir);; *) Exit 1;; esac'
do_check 'fully pre-populated testdir' \
'unset am_create_testdir' \
'test -f install-sh || Exit 1
test -f configure.ac || Exit 1
- case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+ case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
do_check 'testdir has the expected path' \
'am_create_testdir=empty' \
- 'case `pwd` in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
+ 'case $(pwd) in '"$cwd"'/t/_self.dir) : ;; *) Exit 1;; esac'
do_check 'do not pre-populate testdir' \
'am_create_testdir=empty' \
test ! -f t/_self.dir || Exit 1
test ! -r t/_self.dir || Exit 1
grep "self-check-dir\.tap" Makefile || Exit 1
- case `pwd` in '"$cwd"') : ;; *) Exit 1;; esac'
+ case $(pwd) in '"$cwd"') : ;; *) Exit 1;; esac'
:
# We still need a little hack to make ./defs work outside automake's
# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
"$am_top_builddir"/defs-static > defs-static
diff "$am_top_builddir"/defs-static defs-static \
&& fatal_ "failed to edit defs-static"
# If we override $me, ./defs should not modify it.
-s=`$AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh`
+s=$($AM_TEST_RUNNER_SHELL -c 'me=foo.sh && . ./defs && echo me=$me' bad.sh)
command_ok_ "override of \$me before ./defs causes no error" \
test $? -eq 0
unset AM_TESTS_REEXEC BASH_VERSION || :
-cwd=`pwd` || fatal_ "cannot get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
cp "$am_top_builddir"/defs . || fatal_ "fetching 'defs' from top_builddir"
#
# We still need a little hack to make ./defs work outside automake's
# tree 'tests' subdirectory. Not a big deal.
-sed "s|^am_top_builddir=.*|am_top_builddir='`pwd`'|" \
+sed "s|^am_top_builddir=.*|am_top_builddir='$(pwd)'|" \
"$am_top_builddir"/defs-static > defs-static
# Redefining *srcdir and *builddir variables in the environment shouldn't
# cause problems
check_work ()
{
desc=$1 args=$2 exp=$3
- st=0; got=`seq_ $args` || st=$?
+ st=0; got=$(seq_ $args) || st=$?
command_ok_ "$desc [exit status = 0]" test $st -eq 0
command_ok_ "$desc [output]" test x"$exp" = x"$got"
}
grep 'CXXLD .*baz' stdout
grep 'CCLD .*bla' stdout
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'YACC .*foo6\.' stdout
grep 'YACC .*baz6\.' stdout
grep 'LEX .*foo5\.' stdout
$EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'ylwrap ' stdout
$EGREP '(LEX|YACC) ' stdout && Exit 1
fi
grep 'CXXLD .*baz' stdout
grep 'CCLD .*bla' stdout
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'YACC .*foo6\.' stdout
grep 'YACC .*baz6\.' stdout
grep 'LEX .*foo5\.' stdout
$EGREP '(CC|CXX|FC|F77|LD) ' stdout && Exit 1
- if $rebuild; then :; else
+ if ! $rebuild; then
grep 'ylwrap ' stdout
$EGREP '(LEX|YACC) ' stdout && Exit 1
fi
mkdir bin
saved_PATH=$PATH; export saved_PATH
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
$ACLOCAL
$AUTOMAKE --add-missing
$ACLOCAL
$AUTOMAKE
-uncondval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+uncondval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
cat >> Makefile.am << 'END'
foo_SOURCES += $(BAR_SRCS)
$AUTOMAKE
-condval=`$FGREP 'foo-foo.o: foo.c' Makefile.in`
+condval=$($FGREP 'foo-foo.o: foo.c' Makefile.in)
test "x$uncondval" = "x$condval"
./true | grep true
./false | grep false
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
test -f ./t-false.$objext
test -f ./f-false.$objext
./true
./false && Exit 1
-objext=`sed -n -e 's/^OBJEXT = //p' < Makefile`
+objext=$(sed -n -e 's/^OBJEXT = //p' < Makefile)
test -f ./true-true.$objext
test -f ./false-true.$objext
$sleep
: > a
$MAKE
-test "`cat a`" = ''
+test x"$(cat a)" = x
$sleep
touch b
$MAKE
-test "`cat a`" = rule1
+test "$(cat a)" = "rule1"
# Ensure a is strictly newer than b, so HP-UX make does not execute rule2.
$sleep
: > a
$sleep
touch c
$MAKE
-test "`cat a`" = rule2
+test "$(cat a)" = "rule2"
# Unfortunately, the following is not portable to FreeBSD/NetBSD/OpenBSD
# make, see explanation above.
$ACLOCAL
AUTOMAKE_fails
-q="[\`'\"]"
badname='not a standard library name'
# We're specifically testing for line-number information.
-grep "^Makefile\\.am:1:.*${q}sub/foo${q}.*$badname" stderr
+grep "^Makefile\\.am:1:.*'sub/foo'.*$badname" stderr
grep "^Makefile\\.am:1:.*sub/libfoo\\.a" stderr
-grep "^foo\\.mk:5:.*${q}zardoz\\.a${q}.*$badname" stderr
+grep "^foo\\.mk:5:.*'zardoz\\.a'.*$badname" stderr
grep "^foo\\.mk:5:.*libzardoz\\.a" stderr
:
$AUTOCONF
$AUTOMAKE -a
-prefix=`cd install && pwd` || Exit 1
+prefix=$(cd install && pwd) || Exit 99
./configure --prefix="$prefix"
$MAKE
$MAKE install-strip
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip. See sister test strip3.
+# This test needs GNU binutils strip. See sister test 'strip3.sh'.
required='cc strip'
. ./defs || Exit 1
lib_LIBRARIES = libfoo.a
END
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
-
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
$MAKE
$MAKE install-strip
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Ensure install-strip works when STRIP consists of more than one word.
-# This test needs GNU binutils strip. Libtool variant.
+# This test needs GNU binutils strip. Libtool variant. See sister
+# test 'strip2.sh'.
required='cc libtoolize strip'
. ./defs || Exit 1
lib_LTLIBRARIES = libfoo.la
END
-cat > foo.c << 'END'
-int main () { return 0; }
-END
-
-cat > libfoo.c << 'END'
-int foo () { return 0; }
-END
+echo 'int main (void) { return 0; }' > foo.c
+echo 'int foo (void) { return 0; }' > libfoo.c
libtoolize
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-prefix=`pwd`/inst
-./configure --prefix="$prefix" STRIP='strip --verbose'
+./configure --prefix="$(pwd)/inst" STRIP='strip --verbose'
$MAKE
$MAKE install-strip
END
oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
# An rm(1) wrapper that fails when invoked too many times.
mkdir rm-wrap
max_rm_invocations=6
count_file=$ocwd/rm-wrap/count
cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+if ! test \$count -le $max_rm_invocations; then
echo "rm invoked more than $max_rm_invocations times" >&2
exit 1
fi
echo "OBJEXT='@OBJEXT@'" > get-objext.in
oPATH=$PATH
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
# An rm(1) wrapper that fails when invoked too many times.
mkdir rm-wrap
max_rm_invocations=3
count_file=$ocwd/rm-wrap/count
cat > rm-wrap/rm <<END
-#!/bin/sh
-set -e
-count=\`cat '$count_file'\`
-count=\`expr \$count + 1\`
-if test \$count -le $max_rm_invocations; then :; else
+#!$AM_TEST_RUNNER_SHELL -e
+count=\$((\$(cat '$count_file') + 1))
+test \$count -le $max_rm_invocations || {
echo "rm invoked more than $max_rm_invocations times" >&2
exit 1
-fi
+}
echo "\$count" > '$count_file'
PATH='$oPATH'; export PATH
exec rm "\$@"
./configure --enable-dependency-tracking
-depdir=`sed -n 's/^ *DEPDIR *= *//p' Makefile`
+depdir=$(sed -n 's/^ *DEPDIR *= *//p' Makefile)
if test x"$depdir" != x; then
depdir=src/$depdir
else
# internals are changed.
for x in zardoz0 zardoz1 path/to/zardoz2 another/path/to/zardoz3; do
case $x in
- */*) d=`echo $x | sed 's,[^/]*$,,'`; b=`echo $x | sed 's,^.*/,,'`;;
+ */*) d=$(echo $x | sed 's,[^/]*$,,'); b=$(echo $x | sed 's,^.*/,,');;
*) d=''; b=$x;;
esac
# Be a little lax in the regexp, to account for automake conditionals,
cat > Makefile.am << 'END'
noinst_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # The `.//' is meant.
+libfoo_la_SOURCES = src/foo.cc .//src/bar.cc # The './/' is meant.
.PHONY: print
print:
@echo BEG1: "$(LTCXXCOMPILE)" :1END
grep '^am_d_OBJECTS = ' Makefile.in
# Now the actual test. Are both values equal?
-cobj=`sed -n '/^am_c_OBJECTS = / {
- s/.* = \(.*\)$/\1/
- p
- }' Makefile.in`
-dobj=`sed -n '/^am_d_OBJECTS = / {
- s/^.* = \(.*\)$/\1/
- p
- }' Makefile.in`
+cobj=$(sed -n '/^am_c_OBJECTS = / {
+ s/.* = \(.*\)$/\1/
+ p
+ }' Makefile.in)
+dobj=$(sed -n '/^am_d_OBJECTS = / {
+ s/^.* = \(.*\)$/\1/
+ p
+ }' Makefile.in)
test "$cobj" = "$dobj"
:
# For debugging.
$EGREP -n 'ABCD|am__empty' Makefile.in
# Sanity check.
-test `$EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in` -eq 3
+test $($EGREP -c "^[ $tab]*@$v2@ @$v3@[ $tab]*$bs?$" Makefile.in) -eq 3
./configure
{
AC_PROG_CC
AM_PROG_AR
AC_PROG_RANLIB
-if test -n "$doit"; then
+if test x"$doit" = x"yes"; then
AC_SUBST([basehdr], [sub/base.h])
AC_SUBST([nobasehdr], [sub/nobase.h])
AC_SUBST([basedata], [sub/base.dat])
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a --copy
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
$MAKE
$MAKE test-install-data
$MAKE uninstall
$MAKE clean
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
-./configure --prefix "`pwd`/inst" --program-prefix=p doit=
+./configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
$MAKE
$MAKE test-install-nothing-data
$MAKE distclean
mkdir build
cd build
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=yes
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=yes
$MAKE
$MAKE test-install-data
$MAKE test-install-exec
$MAKE uninstall
-test `find inst/foo -type f -print | wc -l` = 0
+test $(find inst/foo -type f -print | wc -l) -eq 0
-../configure --prefix "`pwd`/inst" --program-prefix=p doit=
+../configure --prefix "$(pwd)/inst" --program-prefix=p doit=no
$MAKE
$MAKE test-install-nothing-data
$MAKE test-install-nothing-exec
AUTOMAKE_fails
grep 'overrid.*libfake@SUBST@.a' stderr
$AUTOMAKE -Wno-override
-num=`grep '^libfake@SUBST@.a:' Makefile.in | wc -l`
-test $num -eq 1
+test $(grep -c '^libfake@SUBST@.a:' Makefile.in) -eq 1
+
+:
$AUTOMAKE $am_warns -i
grep '^ *\.c' Makefile.in # For debugging.
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+ test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+ test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
$AUTOMAKE $am_warns
grep '^ *\.c' Makefile.in # For debugging.
- test `grep -c '^\.c\.o:' Makefile.in` -eq 1
- test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+ test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+ test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
done
$AUTOMAKE -a
grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
$AUTOMAKE -i
grep '^ *\.c' Makefile.in # For debugging.
-test `grep -c '^\.c\.o:' Makefile.in` -eq 1
-test `grep -c '^\.c\.obj:' Makefile.in` -eq 1
+test $(grep -c '^\.c\.o:' Makefile.in) -eq 1
+test $(grep -c '^\.c\.obj:' Makefile.in) -eq 1
:
grep '^configure\.ac:3: .*missing.*error while making link' stderr
grep '^configure\.ac:3: .*install-sh.*error while making link' stderr
-test `$FGREP -c 'error while making link' stderr` -eq 2
+test $(grep -c 'error while making link' stderr) -eq 2
:
$FGREP 'Not seen' stdout && Exit 1
-test `$FGREP -c ': foo.test' stdout` -eq 1
-test `$FGREP -c ': bar.test' stdout` -eq 2
-test `$FGREP -c ': baz.test' stdout` -eq 2
+test $($FGREP -c ': foo.test' stdout) -eq 1
+test $($FGREP -c ': bar.test' stdout) -eq 2
+test $($FGREP -c ': baz.test' stdout) -eq 2
:
grep '^ERROR: bail\.test - Bail out!' stdout
grep '^PASS:' stdout && Exit 1
-test `$FGREP -c ': bail.test' stdout` -eq 1
+test $($FGREP -c ': bail.test' stdout) -eq 1
$FGREP 'success.test' stdout && Exit 1
# Override TEST_LOGS from the command line, making it point to a test
'## leave its behaviour in this context undefined for the moment.'
do
case $string in '##'*) continue;; esac
- i=`expr $i + 1`
+ i=$(($i + 1))
unindent >> Makefile.am << END
TEST_EXTENSIONS += .t$i
TESTS += foo$i.t$i
grep "^# all.test:${ws1p}zardoz${ws0p}$" stdout
grep "^# all.test:${ws1p}foo bar${tab}baz${ws0p}$" stdout
-test `grep -c '^# all\.test:' stdout` -eq 4
+test $(grep -c '^# all\.test:' stdout) -eq 4
:
#
# From manpage Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+# Lines written to standard output matching /^(not )?ok\b/ must be
# interpreted as test lines. All other lines must not be considered
-# test output.''
+# test output.
#
# Unfortunately, the exact format of TODO and SKIP directives is not as
# clearly described in that manpage; but a simple reverse-engineering of
#
# From manpage Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/ must be
+# Lines written to standard output matching /^(not )?ok\b/ must be
# interpreted as test lines. All other lines must not be considered
-# test output.''
+# test output.
#
# Unfortunately, the exact format of TODO and SKIP directives is not as
# clearly described in that manpage; but a simple reverse-engineering of
xpass=130 # = 4 * 34 - 6
skip=130 # = 4 * 34 - 6
error=0
-total=`expr $pass + $fail + $xfail + $xpass + $skip`
+total=$(($pass + $fail + $xfail + $xpass + $skip))
# Even nastier! But accordingly to the specifics, it should still work.
for result in 'ok' 'not ok'; do
echo "ok{[(<#${tab}SKIP>)]}" >> all.test
# We have to update some test counts.
-xfail=`expr $xfail + 1`
-xpass=`expr $xpass + 1`
-skip=`expr $skip + 1`
-total=`expr $total + 3`
+xfail=$(($xfail + 1))
+xpass=$(($xpass + 1))
+skip=$(($skip + 1))
+total=$(($total + 3))
# And add the test plan!
echo 1..$total >> all.test
END
# We don't care about the exit status of "make check" here.
-TESTS="`echo *.test`" $MAKE -e check || :
+TESTS="$(echo *.test)" $MAKE -e check || :
cat test-suite.log
grep ':.*ok|not seen' test-suite.log && Exit 1
Bail out!
END
-tests=`echo *.test` # Also required later.
+tests=$(echo *.test) # Also required later.
TESTS="$tests" $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
# Dirty trick required here.
-for tst in `echo " $tests " | sed 's/.test / /'`; do
+for tst in $(echo " $tests " | sed 's/\.test / /'); do
echo :copy-in-global-log: yes >> $tst.trs
done
have_rst_section ()
{
- eqeq=`echo "$1" | sed 's/./=/g'`
+ eqeq=$(echo "$1" | sed 's/./=/g')
# Assume $1 contains no RE metacharacters.
sed -n "/^$1$/,/^$eqeq$/p" test-suite.log > got
(echo "$1" && echo "$eqeq") > exp
$FGREP "$pmarker $result $pmarker" my.log || st=1
$FGREP "$cmarker $result $cmarker" my.log || st=1
done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
# Passed test scripts shouldn't be mentioned in the global log.
$EGREP '(^pass|[^x]pass)\.test' my.log && Exit 1
test ! -f test-suite.log
# Check that VERBOSE causes the global testsuite log to be
# emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
case $out in *"$log"*) ;; *) Exit 1;; esac
touch error2.log test-suite.log my.log
count_test_results total=6 pass=4 fail=0 xpass=0 xfail=1 skip=1 error=0
grep '^PASS: 1\.test 1 - mu$' stdout
grep '^SKIP: 1\.test 2 zardoz # SKIP$' stdout
- test `$FGREP -c '1.test' stdout` -eq 2
+ test $(grep -c '1\.test' stdout) -eq 2
grep '^PASS: 2\.test 1$' stdout
grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
grep '^PASS: 2\.test 3$' stdout
- test `$FGREP -c '2.test' stdout` -eq 3
+ test $(grep -c '2\.test' stdout) -eq 3
grep '^PASS: 3\.test 1 - blah blah blah$' stdout
grep '^# 3\.test: Some diagnostic$' stdout
- test `$FGREP -c '3.test' stdout` -eq 2
+ test $(grep -c '3\.test' stdout) -eq 2
# Failure.
count_test_results total=7 pass=4 fail=1 xpass=0 xfail=1 skip=0 error=1
grep '^PASS: 1\.test 1 - mu$' stdout
grep '^FAIL: 1\.test 2 zardoz$' stdout
- test `$FGREP -c '1.test' stdout` -eq 2
+ test $(grep -c '1\.test' stdout) -eq 2
grep '^PASS: 2\.test 1$' stdout
grep '^XFAIL: 2\.test 2 # TODO not implemented$' stdout
grep '^PASS: 2\.test 3$' stdout
- test `$FGREP -c '2.test' stdout` -eq 3
+ test $(grep -c '2\.test' stdout) -eq 3
grep '^PASS: 3\.test 1 - blah blah blah$' stdout
grep '^# 3\.test: Some diagnostic$' stdout
grep '^ERROR: 3\.test - Bail out! Kernel Panic$' stdout
- test `$FGREP -c '3.test' stdout` -eq 3
+ test $(grep -c '3\.test' stdout) -eq 3
cd $srcdir
>
END
-n=`wc -l <prefixes`
+n=$(wc -l <prefixes)
# See the loop below to understand this initialization.
-pass=`expr $n '*' 3`
+pass=$(($n * 3))
fail=$pass
-skip=`expr $pass - 3`
+skip=$(($pass - 3))
xfail=$skip
xpass=$xfail
error=0
-total=`expr $pass + $fail + $skip + $xfail + $xpass`
+total=$(($pass + $fail + $skip + $xfail + $xpass))
echo 1..$total > all.test
cat all.test # For debugging.
# Sanity checks.
-grep '#.*#' all.test && framework_failure_ "creating all.test"
-test `wc -l <all.test` -lt $highno || framework_failure_ "creating all.test"
+grep '#.*#' all.test \
+ && framework_failure_ "creating all.test"
+test $(wc -l <all.test) -lt $highno \
+ || framework_failure_ "creating all.test"
$MAKE check >stdout || :
cat stdout
# According to documentation of Test::Harness::TAP(3):
#
-# ``Lines written to standard output matching /^(not )?ok\b/
+# Lines written to standard output matching /^(not )?ok\b/
# must be interpreted as test lines. All other lines must
-# not be considered test output.''
+# not be considered test output.
cat >> all.test <<END
ok
# Bail out!
END
-cat all.test # For debugging.
-# Minor sanity check.
-test `grep -c '^ok1$' all.test` -eq 1 \
- && test `grep -c '^not ok1$' all.test` -eq 1 \
+# Debugging info and minor sanity check.
+cat all.test \
+ && test $(grep -c '^ok1$' all.test) -eq 1 \
+ && test $(grep -c '^not ok1$' all.test) -eq 1 \
|| framework_failure_ "creating all.test"
$MAKE check >stdout || { cat stdout; Exit 1; }
END
# Strip any extra whitespace, for Solaris' wc.
-planned=`wc -l <punctuation | tr -d " $tab"`
+planned=$(wc -l <punctuation | tr -d " $tab")
echo 1..$planned > all.test
awk '{print "ok " NR $0 }' punctuation >> all.test
count_test_results total=17 pass=8 fail=0 xpass=0 xfail=1 skip=0 error=8
-test `$FGREP -c ': a.test' stdout` -eq 3
-test `$FGREP -c ': b.test' stdout` -eq 5
-test `$FGREP -c ': c.test' stdout` -eq 4
-test `$FGREP -c ': d.test' stdout` -eq 5
+test $($FGREP -c ': a.test' stdout) -eq 3
+test $($FGREP -c ': b.test' stdout) -eq 5
+test $($FGREP -c ': c.test' stdout) -eq 4
+test $($FGREP -c ': d.test' stdout) -eq 5
grep '^ERROR: a\.test 71 # OUT-OF-ORDER (expecting 3)$' stdout
grep '^ERROR: b\.test 4 foo # OUT-OF-ORDER (expecting 3)$' stdout
0..0
END
-tests_list=`echo *.test`
+tests_list=$(echo *.test)
TESTS="$tests_list" $MAKE -e check >stdout && { cat stdout; Exit 1; }
cat stdout
END
-tests=`echo *.test`
+tests=$(echo *.test)
for tap_flags in "" "--comments"; do
env TEST_LOG_DRIVER_FLAGS="$tap_flags" TESTS="$tests" \
. "$am_testauxdir"/tap-setup.sh || fatal_ "sourcing tap-setup.sh"
-# These nested loops are clearer without indentation.
-
+# These nested loops below are clearer without indentation.
i=0
for c1 in s S; do
for c2 in k K; do
for c3 in i I; do
for c4 in p P; do
- i=`expr $i + 1`
- case $i in ?) i=0$i; esac
- echo "1..0 # $c1$c2$c3$c4 foobar" > $i.test
+ i=$(($i + 1))
+ case $i in ?) j=0$i;; *) j=$i;; esac
+ echo "1..0 # $c1$c2$c3$c4 foobar" > $j.test
done; done; done; done
-TESTS="`echo *.test`" $MAKE -e check >stdout || { cat stdout; Exit 1; }
+TESTS="$(echo *.test)" $MAKE -e check >stdout || { cat stdout; Exit 1; }
cat stdout
count_test_results total=16 pass=0 fail=0 xpass=0 xfail=0 skip=16 error=0
grep '^SKIP: foo\.test .* from the last line$' stdout
grep '^SKIP: bar\.test$' stdout
-test `grep -c ': .*\.test' stdout` -eq 2
+test $(grep -c ': .*\.test' stdout) -eq 2
count_test_results total=2 pass=0 fail=0 xpass=0 xfail=0 skip=2 error=0
:
cat stdout
count_test_results total=4 pass=0 fail=0 xpass=0 xfail=0 skip=1 error=3
-test `grep -c '^ERROR: all\.test - multiple test plans' stdout` -eq 3
+test $(grep -c '^ERROR: all\.test - multiple test plans' stdout) -eq 3
:
grep '^SKIP: wget\.test .* wget(1) not installed$' stdout
grep '^SKIP: curl\.test .* Can'\''t connect to gnu\.org!$' stdout
grep '^SKIP: mu\.test' stdout | $FGREP "$weirdchars" stdout
-test `grep -c ': .*\.test' stdout` -eq 6
+test $(grep -c ': .*\.test' stdout) -eq 6
:
# out its output progressively and "in sync" with test execution -- it is
# make that is stowing such output away instead of presenting it to the
# user as soon as it gets it.
-if using_gmake; then :; else
+if ! using_gmake; then
case $MAKE in
*\ -j*) skip_ "doesn't with non-GNU concurrent make";;
esac
END
echo TESTS += signal-$sig.test >> Makefile.am
done
-results_count=`ls *.test | wc -l | tr -d "$tab$sp"`
+results_count=$(ls *.test | wc -l | tr -d "$tab$sp")
chmod a+x *.test
./configure
-system=`uname -s -r || echo unknown` # Needed later.
+system=$(uname -s -r || echo unknown) # Needed later.
signal_caught ()
{
cat stdout # For debugging.
command_ok_ "count of test results" count_test_results \
- total=`expr $results_count '*' 2` \
+ total=$(($results_count * 2)) \
pass=$results_count error=$results_count \
fail=0 xpass=0 xfail=0 skip=0
END
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
- test `$FGREP -c ': all.test' stdout` -eq 4
+ test $($FGREP -c ': all.test' stdout) -eq 4
$EGREP '^PASS: all\.test 1($| )' stdout
$EGREP '^SKIP: all\.test 2($| )' stdout
$EGREP ': all\.test 3($| )' stdout
. ./defs || Exit 1
-cwd=`pwd` || fatal_ "couldn't get current working directory"
+cwd=$(pwd) || fatal_ "getting current working directory"
echo AC_OUTPUT >> configure.ac
TAR="$cwd/am--tar foo" $MAKE distcheck
test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = foo
+test "$(cat am--tar-has-run)" = foo
rm -f *.tar.* *has-run*
# Creative use of eval to pacify maintainer checks.
eval \$'MAKE dist "TAR=./am--tar mu"'
test -f $me-1.0.tar.gz
-test "`cat am--tar-has-run`" = mu
+test "$(cat am--tar-has-run)" = mu
:
AUTOMAKE_fails
grep "^configure\.ac:2:.*mutually exclusive" stderr > tar-err
cat tar-err
-test 1 = `wc -l < tar-err`
+test 1 -eq $(wc -l < tar-err)
grep "'tar-pax'" tar-err
grep "'tar-v7'" tar-err
cd build
../configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./foo
./bar
fi
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./foo
./bar
fi
test -f sub1/baz.trs
END
-cat > checkdir-driver <<'END'
-#! /bin/sh
+echo "#!$AM_TEST_RUNNER_SHELL" > checkdir-driver
+cat >> checkdir-driver <<'END'
set -e; set -u
while test $# -gt 0; do
case $1 in
echo "log: $log_file" # For debugging.
echo "trs: $trs_file" # Ditto.
case $log_file in */*);; *) exit 1;; esac
-dir_log=`expr "$log_file" : '\(.*\)/[^/]*'`
-dir_trs=`expr "$trs_file" : '\(.*\)/[^/]*'`
+dir_log=${log_file%/*}
+dir_trs=${trs_file%/*}
echo "dir_log: $dir_log" # For debugging.
echo "dir_trs: $dir_trs" # Likewise.
test x"$dir_trs" = x"$dir_log" || exit 1
grep '%% fail2 %%' test-suite.log
grep '%% pass-fail %%' test-suite.log
grep '%% pass-xpass-fail-xfail-skip-error %%' test-suite.log
- test `grep -c '%% ' test-suite.log` -eq 4
+ test $(grep -c '%% ' test-suite.log) -eq 4
TESTS='pass.t pass3-skip2-xfail.t' $MAKE -e check >stdout \
|| { cat stdout; cat test-suite.log; Exit 1; }
$MAKE check >stdout || { cat stdout; Exit 1; }
cat stdout
-test `grep -c '^PASS:' stdout` -eq 3
-test `grep -c '^XFAIL:' stdout` -eq 13
+test $(grep -c '^PASS:' stdout) -eq 3
+test $(grep -c '^XFAIL:' stdout) -eq 13
for dir in sub1 sub2; do
cd $dir
cp x2.test pass.test
$MAKE check >stdout && { cat stdout; Exit 1; }
cat stdout
- test "`cat pass.trs`" = ":test-result: FAIL"
- test "`cat x1.trs`" = ":test-result: XPASS"
- test "`cat x2.trs`" = ":test-result: XFAIL"
+ test "$(cat pass.trs)" = ":test-result: FAIL"
+ test "$(cat x1.trs)" = ":test-result: XPASS"
+ test "$(cat x2.trs)" = ":test-result: XFAIL"
grep '^FAIL: pass\.test$' stdout
grep '^XPASS: x1\.test$' stdout
grep '^XFAIL: x2\.test$' stdout
END
mkdir sub bin
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
cat > wrapper.skel <<'END'
#! /bin/sh
am_create_testdir=empty
. ./defs || Exit 1
-ocwd=`pwd` || fatal_ "getting current working directory"
+ocwd=$(pwd) || fatal_ "getting current working directory"
do_check ()
{
. ./defs || Exit 1
-ocwd=`pwd` || fatal_ "cannot get current working directory"
+ocwd=$(pwd) || fatal_ "cannot get current working directory"
mkdir src build
mv install-sh missing configure.ac src
for i in 1 2 3; do
AUTOMAKE_fails $i
- lineno=`sed -n 's/^## lineno //p' $i.am` \
+ lineno=$(sed -n 's/^## lineno //p' $i.am) \
&& test 0 -lt "$lineno" \
|| Exit 99
grep "^$i\\.am:$lineno:.*TEST_EXTENSIONS.*conditional content" stderr
grep -i 'log' Makefile.in # For debugging.
for lc in $valid_extensions; do
- uc=`echo $lc | tr '[a-z]' '[A-Z]'`
+ uc=$(echo $lc | tr '[a-z]' '[A-Z]')
$FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in
grep "^${uc}_LOG_COMPILE =" Makefile.in
grep "^\.${lc}\.log:" Makefile.in
AUTOMAKE_fails
for suf in mu .x-y a-b .t.1 .6c .0 .11 @suf@ .@ext@ '.=' '_&_'; do
- suf2=`printf '%s\n' "$suf" | sed -e 's/\./\\./'`
+ suf2=$(printf '%s\n' "$suf" | sed -e 's/\./\\./')
$EGREP "^Makefile\.am:2:.*invalid test extension.* $suf2( |$)" stderr
done
$FGREP "$pmarker $result $pmarker" my.log || st=1
$FGREP "$cmarker $result $cmarker" my.log || st=1
done
-test `$FGREP -c "$pmarker" my.log` -eq 5
-test `$FGREP -c "$cmarker" my.log` -eq 5
+test $($FGREP -c "$pmarker" my.log) -eq 5
+test $($FGREP -c "$cmarker" my.log) -eq 5
have_rst_section ()
{
- eqeq=`echo "$1" | sed 's/./=/g'`
+ eqeq=$(echo "$1" | sed 's/./=/g')
# Assume $1 contains no RE metacharacters.
sed -n "/^$1$/,/^$eqeq$/p" $2 > got
(echo "$1" && echo "$eqeq") > exp
test ! -f test-suite.log
# Check that VERBOSE causes the global testsuite log to be
# emitted on stdout.
-out=`cat stdout`
-log=`cat global.log`
+out=$(cat stdout)
+log=$(cat global.log)
case $out in *"$log"*) ;; *) Exit 1;; esac
touch error2.log test-suite.log my.log
have_result ()
{
cat > exp; echo >> exp; echo logloglog >> exp
- eline=`get_escaped_line exp`
+ eline=$(get_escaped_line exp)
sed -n -e "/^$eline$/,/^logloglog$/p" test-suite.log > got
cat exp; cat got
diff exp got
:recheck: no
END
-rechecked=`echo y-[0-9]*`
+rechecked=$(echo y-[0-9]*)
for t in [yn]-[0-9]*; do echo $t; done \
| sed 's/.*/TESTS += &/' >> Makefile.am
$srcdir/configure
$MAKE tb
- test x"`cat tb`" = x"foo bar sub/zardoz"
+ test x"$(cat tb)" = x"foo bar sub/zardoz"
rm -f tb
# Please don't change the order of the stuff in TESTS, below.
TESTS='foo.test foo2.sh foo-log foolog.test a.log.b.sh 0.exe' $MAKE -e tb
- test x"`cat tb`" = x"foo foo2 foo-log foolog a.log.b 0.exe"
+ test x"$(cat tb)" = x"foo foo2 foo-log foolog a.log.b 0.exe"
rm -f tb
cd $srcdir
error_count=17
tests_count=120
-pass=` seq_ 1 $pass_count | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
do_check $pass $skip $xfail $fail $xpass $error <<END
$header
xpass_count=17
error_count=9
-pass=` seq_ 1 $pass_count | sed 's/.*/pass-&.t/'`
-skip=` seq_ 1 $skip_count | sed 's/.*/skip-&.t/'`
-xfail=`seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/'`
-fail=` seq_ 1 $fail_count | sed 's/.*/fail-&.t/'`
-xpass=`seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/'`
-error=`seq_ 1 $error_count | sed 's/.*/error-&.t/'`
+ pass=$(seq_ 1 $pass_count | sed 's/.*/pass-&.t/')
+ skip=$(seq_ 1 $skip_count | sed 's/.*/skip-&.t/')
+xfail=$(seq_ 1 $xfail_count | sed 's/.*/xfail-&.t/')
+ fail=$(seq_ 1 $fail_count | sed 's/.*/fail-&.t/')
+xpass=$(seq_ 1 $xpass_count | sed 's/.*/xpass-&.t/')
+error=$(seq_ 1 $error_count | sed 's/.*/error-&.t/')
do_check $pass $skip $xfail $fail $xpass $error <<END
$header
$AUTOCONF
$AUTOMAKE
-./configure --program-prefix=gnu- --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-prefix=gnu- --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
$AUTOCONF
$AUTOMAKE
-./configure --program-transform-name='s/[12]//' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+cwd=$(pwd) || fatal_ "getting current working directory"
+
+./configure --program-transform-name='s/[12]//' --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Also squash all file types in question.
# On newer Cygwin versions, that won't work, likely due to overly
# aggressive appending of '.exe' suffix when copying/renaming Windows
-# executables). So let's skip this part of the test if we detect the
+# executables. So let's skip this part of the test if we detect the
# faulty heuristic is present. See also:
# <http://lists.gnu.org/archive/html/automake-patches/2010-08/msg00153.html>
# <http://thread.gmane.org/gmane.os.cygwin/119380>
cp foo bar && cmp foo bar \
|| skip_ "your Cygwin is too aggressive in tweaking '.exe' suffixes"
-./configure --program-transform-name='s/.*/foo/' --prefix "`pwd`/inst" --mandir "`pwd`/inst/man"
+./configure --program-transform-name='s/.*/foo/' --prefix "$cwd/inst" \
+ --mandir "$cwd/inst/man"
$MAKE
$MAKE test-install-foo
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
:
$AUTOCONF
$AUTOMAKE -a
-./configure --program-prefix=gnu- --prefix "`pwd`/inst"
+./configure --program-prefix=gnu- --prefix "$(pwd)/inst"
$MAKE test-install
$MAKE uninstall
-test `find inst -type f -print | wc -l` = 0
+test $(find inst -type f -print | wc -l) -eq 0
# Opportunistically test for installdirs.
rm -rf inst
$AUTOMAKE --add-missing
$AUTOCONF
-./configure "--infodir=`pwd`/_inst"
+./configure "--infodir=$(pwd)/_inst"
$MAKE
# Make sure .iNN files are installed.
AM_MAKEINFOFLAGS = --unsupported-option
EOF
$AUTOMAKE
-./configure --prefix "`pwd`"
+./configure --prefix "$(pwd)"
+
$MAKE html
test -f main.html
test -f sub/main2.html
$MAKE
$MAKE distclean
-case `pwd` in
+abscwd=$(pwd) || fatal_ "getting current working directory"
+
+case $abscwd in
*\ * | *\ *)
skip_ "this test might fail in a directory containing white spaces";;
esac
mkdir build
cd build
-../configure "--srcdir=`pwd`/.." "--prefix=`pwd`/_inst" "--infodir=`pwd`/_inst/info"
+../configure --srcdir="$abscwd" \
+ --prefix="$abscwd/build/_inst" \
+ --infodir="$abscwd/build/_inst/info"
+
$MAKE install
+
test -f ../main.info
test ! -f ./main.info
test -f _inst/info/main.info
$AUTOMAKE --add-missing
$AUTOCONF
-./configure "--prefix=`pwd`/inst" "--infodir=`pwd`/inst/info"
+./configure --prefix="$(pwd)/inst" --infodir="$(pwd)/inst/info"
$MAKE install-info
test -f inst/info/main.info
+
+:
$AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
# ... and it is the right one.
grep '^INFO_DEPS *= *foo.info *$' Makefile.in
$AUTOMAKE -Wno-override
# There is only one definition of INFO_DEPS ...
-test 1 = `grep '^INFO_DEPS.*=' Makefile.in | wc -l`
+test 1 -eq $(grep -c '^INFO_DEPS.*=' Makefile.in)
# ... and it is the right one.
grep '^INFO_DEPS *= *@INFO_DEPS@ *$' Makefile.in
chmod +x makeinfo
-PATH=`pwd`$PATH_SEPARATOR$PATH
+PATH=$(pwd)$PATH_SEPARATOR$PATH
export PATH
# Otherwise configure might pick up a working makeinfo from the
$ACLOCAL
$AUTOCONF
$AUTOMAKE
-./configure "--prefix=`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE html dvi ps pdf info \
install-html install-dvi install-ps install-pdf install-info \
install-man install-data install-exec install uninstall
-Exit 0
+:
# overkill.
for t in info dist-info dvi-am install-html uninstall-pdf-am; do
$EGREP "(^| )$t*.:" Makefile.in # For debugging.
- test `$EGREP -c "(^| )$t(:| *.:)" Makefile.in` -eq 1
+ test $($EGREP -c "(^| )$t(:| *.:)" Makefile.in) -eq 1
done
:
$AUTOMAKE
$AUTOCONF
+# Make it harder to experience false postives when grepping error messages.
inst=__inst-dir__
-./configure --prefix="`pwd`/$inst"
+./configure --prefix="$(pwd)/$inst"
mkdir $inst $inst/share
: > $inst/share/foobar.txt
$AUTOMAKE
$AUTOCONF
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
$MAKE uninstall
test ! -d inst
baz_SOURCES = baz.c
END
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent >> Makefile.am <<'END'
check-local:
./zardoz
public const string BARBAR;
END
-if cross_compiling; then :; else
+if ! cross_compiling; then
unindent >> Makefile.am <<'END'
check-local: test2
.PHONY: test1 test2
$FGREP 'am_libzardoz_la_OBJECTS' Makefile.in
$FGREP 'zardoz_vala.stamp:' Makefile.in
$FGREP 'libzardoz_la_vala.stamp:' Makefile.in
-test `$FGREP -c '.stamp:' Makefile.in` -eq 2
+test $($FGREP -c '.stamp:' Makefile.in) -eq 2
$FGREP 'zardoz.c' Makefile.in
$FGREP 'zardoz-foo.c' Makefile.in
$FGREP 'zardoz-bar.c' Makefile.in
$FGREP 'bar.c' sub/Makefile.in
$FGREP 'baz.c' sub/Makefile.in
$FGREP 'foo_vala.stamp:' sub/Makefile.in
-test `$FGREP -c '.stamp:' sub/Makefile.in` -eq 1
+test $($FGREP -c '.stamp:' sub/Makefile.in) -eq 1
# Check against regression for weird bug due to unescaped '@'
# characters used in a "..." perl string when writing the vala
END
chmod +x valac
-cwd=`pwd`
-
-# Use $cwd instead of `pwd` in the && list below to avoid a bug in
-# the way Solaris/Heirloom Sh handles 'set -e'.
+cwd=$(pwd) || fatal_ "getting current working directory"
$ACLOCAL
$AUTOMAKE -a
./configure
$MAKE
-if cross_compiling; then :; else
+if ! cross_compiling; then
./src/foo
./src/bar
- test `./src/foo` = foo
- test `./src/bar` = bar
+ test "$(./src/foo)" = foo
+ test "$(./src/bar)" = bar
fi
# Test clean rules.
# Makefile.am:5: warning: variable `libfoo_la_DEPENDENCIES' is defined but no program or
# Makefile.am:5: library has `libfoo_la' as canonical name (possible typo)
-
grep 'as canonical' stderr | grep -v ' .libfoo_la. ' && Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 6
+test $(grep -c 'variable.*is defined but' stderr) -eq 6
# If we add a global -Wnone, all warnings should disappear.
$AUTOMAKE -Wnone
grep 'as canonical' stderr | grep -v ' .foo. ' | grep -v ' .libfoo_a. ' \
&& Exit 1
-test `grep 'variable.*is defined but' stderr | wc -l` = 13
+test $(grep -c 'variable.*is defined but' stderr) -eq 13
# If we add a global -Wnone, all warnings should disappear.
$AUTOMAKE -Wnone
. ./defs || Exit 1
-amver=`$AUTOMAKE --version | sed -e 's/.* //;1q'`
+amver=$($AUTOMAKE --version | sed -e 's/.* //;1q')
# Does the extracted version number seems legit?
case $amver in
# Check that UPDATED seems right, and that UPDATED and UPDATED-MONTH
# are consistent.
$EGREP "^@set UPDATED $date$" $srcdir/$vfile.texi
- vmonth=`grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}'`
+ vmonth=$(grep '^@set UPDATED ' $srcdir/$vfile.texi | awk '{print $4, $5}')
grep "^@set UPDATED-MONTH $vmonth$" $srcdir/$vfile.texi
# Check that the vers*.texi file is distributed according
# to $(DISTFILES).
required='makeinfo tex texi2dvi-o'
. ./defs || Exit 1
-case `LC_ALL=C date '+%u'` in
- [1-7]) date_is_posix=:;;
- *) date_is_posx=false;;
-esac
-$date_is_posix \
- && day=`LC_ALL=C date '+%d'` && test -n "$day" \
- && month=`LC_ALL=C date '+%B'` && test -n "$month" \
- && year=`LC_ALL=C date '+%Y'`&& test -n "$year" \
+test $(LC_ALL=C date '+%u') -gt 0 && test $(LC_ALL=C date '+%u') -lt 8 \
+ && day=$(LC_ALL=C date '+%d') && test -n "$day" \
+ && month=$(LC_ALL=C date '+%B') && test -n "$month" \
+ && year=$(LC_ALL=C date '+%Y') && test -n "$year" \
|| skip_ "'date' is not POSIX-compliant enough"
-day=`echo "$day" | sed 's/^0//'`
+day=$(echo "$day" | sed 's/^0//')
(echo '\ex\a' | grep x) \
|| skip_ "grep doesn't work on input that is not pure text"
{
AUTOMAKE_run $*
grep '^Makefile\.am:.*:=.*not portable' stderr
- test `wc -l <stderr` -eq 1
+ test $(wc -l <stderr) -eq 1
}
set_am_opts()
grep '^sub/Makefile.am:.*foo_SOURCES' stderr && Exit 1
grep '^Makefile.am:.*INCLUDES' stderr && Exit 1
# Only three lines of warnings.
-test `grep -v 'warnings are treated as errors' stderr | wc -l` = 3
+test $(grep -v 'warnings are treated as errors' stderr | wc -l) -eq 3
# On fast machines the autom4te.cache created during the above run of
# $AUTOMAKE is likely to have the same time stamp as the configure.ac
END
$ACLOCAL
$AUTOMAKE
+
+:
AUTOMAKE_fails -Wno-error
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
sed '/AUTOMAKE_OPTIONS/d' sub/Makefile.am > t
mv -f t sub/Makefile.am
AUTOMAKE_fails -Wno-error
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
sed '/AUTOMAKE_OPTIONS/d' Makefile.am > t
mv -f t Makefile.am
AUTOMAKE_fails -Werror
grep 'VAR multiply defined' stderr
grep 'SUB multiply defined' stderr
-test `grep -c 'warnings are treated as errors' stderr` -eq 1
+test $(grep -c 'warnings are treated as errors' stderr) -eq 1
AUTOMAKE_run -Wno-error
grep 'VAR multiply defined' stderr
# Check that per-object flags are honored.
test -f bar-parse.output
-if cross_compiling; then :; else
+if ! cross_compiling; then
echo a | ./foo
echo b | ./foo && Exit 1
echo a | ./bar
test -f foo3-parse3.output
test -f foo4-parse4.output
-if cross_compiling; then :; else
+if ! cross_compiling; then
for i in 1 2 3 4; do
echo a | ./foo$i
echo b | ./foo$i && Exit 1
END
cp bin/yacc bin/bison
chmod a+x bin/yacc bin/bison
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH
YACC=yacc BISON=bison
export YACC BISON
$sleep
$MAKE parse.c parse2.c
stat parse.c parse.y parse2.c parse2.y || : # For debugging.
-test `ls -t parse.c parse.y | sed 1q` = parse.c
-test `ls -t parse2.c parse2.y | sed 1q` = parse2.c
+test $(ls -t parse.c parse.y | sed 1q) = parse.c
+test $(ls -t parse2.c parse2.y | sed 1q) = parse2.c
:
$sleep
touch ../foo/parse.y
$MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = z
+test $(ls -1t foo/parse.h z | sed 1q) = z
$sleep
sed 's/%%/%token TOKEN\n%%/g' ../foo/parse.y >../foo/parse.yt
mv -f ../foo/parse.yt ../foo/parse.y
$MAKE obj
-test `ls -1t foo/parse.h z | sed 1q` = foo/parse.h
+test $(ls -1t foo/parse.h z | sed 1q) = foo/parse.h
# Now, adds another parser to test ylwrap.
echo 'extern int dummy;' >> y.tab.c
END
chmod a+x bin/fake-yacc
-PATH=`pwd`/bin$PATH_SEPARATOR$PATH; export PATH
+PATH=$(pwd)/bin$PATH_SEPARATOR$PATH; export PATH
YACC=fake-yacc; export YACC
cat > Makefile.am <<'END'