From: Stefano Lattarini Date: Thu, 28 Jun 2012 15:31:52 +0000 (+0200) Subject: [ng] tests: more uses of $(...) over `...` for command substitution X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32b141596d3e7de90a64cc2922bb23d3ce55f4ca;p=thirdparty%2Fautomake.git [ng] tests: more uses of $(...) over `...` for command substitution Caught by the 'sc_tests_command_subst' maintainer check. * Several tests: Adjust. Also ... * t/memoize.tap: ... use $((...)) instead of `expr ...` here, and ... * t/parallel-tests-dynamic.sh: ... add a missing quote here. Signed-off-by: Stefano Lattarini --- diff --git a/t/ax/depcomp-shuffle.sh b/t/ax/depcomp-shuffle.sh index a887f0284..d64f96396 100644 --- a/t/ax/depcomp-shuffle.sh +++ b/t/ax/depcomp-shuffle.sh @@ -112,7 +112,7 @@ $srcdir/configure --enable-dependency-tracking $MAKE grep_prog_out foofoofoo # Sanity check. -EXEEXT=`$MAKE -s --no-print-directory get-exeext` \ +EXEEXT=$($MAKE -s --no-print-directory get-exeext) \ || fatal_ "cannot get \$EXEEXT" # Modify an header file. diff --git a/t/built-sources-install.sh b/t/built-sources-install.sh index 7234e7a3f..2f53bb51e 100755 --- a/t/built-sources-install.sh +++ b/t/built-sources-install.sh @@ -57,7 +57,7 @@ END $ACLOCAL $AUTOCONF $AUTOMAKE -./configure --prefix "`pwd`/inst" +./configure --prefix "$(pwd)/inst" # Now make sure these two files are rebuilt during make install. $MAKE install diff --git a/t/depcomp-recover.sh b/t/depcomp-recover.sh index 7d3e7df30..77775f6e6 100755 --- a/t/depcomp-recover.sh +++ b/t/depcomp-recover.sh @@ -76,7 +76,7 @@ for vpath in : false; do $srcdir/configure --enable-dependency-tracking $MAKE - depdir=`$MAKE -s --no-print-directory get-depdir` \ + depdir=$($MAKE -s --no-print-directory get-depdir) \ && test -n "$depdir" \ && test -d $depdir \ && test -d sub/src/$depdir \ diff --git a/t/dist-srcdir.sh b/t/dist-srcdir.sh index 1f6cbb0a2..64cdcd8c1 100755 --- a/t/dist-srcdir.sh +++ b/t/dist-srcdir.sh @@ -19,7 +19,7 @@ am_create_testdir=empty . ./defs || exit 1 -ocwd=`pwd` || fatal_ "cannot get current working directory" +ocwd=$(pwd) || fatal_ "cannot get current working directory" mkdir src cd src diff --git a/t/dist-srcdir2.sh b/t/dist-srcdir2.sh index 5a105234b..52146cdc7 100755 --- a/t/dist-srcdir2.sh +++ b/t/dist-srcdir2.sh @@ -44,6 +44,6 @@ grep 'filename-that-is-easy-to-grep' stderr echo good > ../filename-that-is-easy-to-grep $MAKE distdir -test "`cat $distdir/filename-that-is-easy-to-grep`" = good +test "$(cat $distdir/filename-that-is-easy-to-grep)" = good : diff --git a/t/fort2.sh b/t/fort2.sh index 510938ca1..4ec207c61 100755 --- a/t/fort2.sh +++ b/t/fort2.sh @@ -82,7 +82,7 @@ grep ' fake-fc .* --@08 .* sub/bonjour\.f08 ' out grep ' fake-fc .* --gby .* --@95 .* bye\.f95 ' out grep ' fake-fc .* --gby .* --@90 .* sub/baz\.f90 ' out -test `grep -c '.*--gby.*\.f' out` -eq 2 +test $(grep -c '.*--gby.*\.f' out) -eq 2 $EGREP 'fake-fc.*--@(95|03|08).*\.f90' out && exit 1 $EGREP 'fake-fc.*--@(90|03|08).*\.f95' out && exit 1 diff --git a/t/memoize.tap b/t/memoize.tap index ea2f69e5b..a89515bcc 100755 --- a/t/memoize.tap +++ b/t/memoize.tap @@ -21,7 +21,7 @@ am_create_testdir=empty plan_ 17 -ocwd=`pwd` || fatal_ "couldn't get current working directory" +ocwd=$(pwd) || fatal_ "couldn't get current working directory" cp "$am_amdir"/header-vars.am . \ || fatal_ "fetching makefile fragment headers-vars.am" @@ -33,7 +33,7 @@ rm -f header-vars.am T () { - tcount=`expr $tcount + 1` + tcount=$(($tcount + 1)) mkdir $tcount.d cd $tcount.d echo include ../defn.mk > Makefile diff --git a/t/parallel-tests-dynamic.sh b/t/parallel-tests-dynamic.sh index da61450c4..9d561a3c3 100755 --- a/t/parallel-tests-dynamic.sh +++ b/t/parallel-tests-dynamic.sh @@ -118,7 +118,7 @@ grep '^SKIP: fu\.sh$' stdout grep '^SKIP: mu$' stdout $MAKE mostlyclean -test "`find . -name *.log`" = ./config.log +test "$(find . -name '*.log')" = ./config.log $MAKE distcheck > stdout || { cat stdout; exit 1; } cat stdout @@ -138,7 +138,7 @@ grep '^PASS: t00-foo\.sh' stdout grep '^XFAIL: t98S\.sh' stdout $MAKE mostlyclean -test "`find . -name *.log`" = ./config.log +test "$(find . -name '*.log')" = ./config.log $MAKE check TESTS='$(shell echo t00 | sed "s/$$/-foo/") t99' test -f t00-foo.log diff --git a/t/parallel-tests-longest-stem.sh b/t/parallel-tests-longest-stem.sh index 521cefd64..181014b09 100755 --- a/t/parallel-tests-longest-stem.sh +++ b/t/parallel-tests-longest-stem.sh @@ -52,7 +52,7 @@ $ACLOCAL $AUTOCONF $AUTOMAKE -a -./configure --prefix="`pwd`/inst" +./configure --prefix="$(pwd)/inst" $MAKE check ls -l # For debugging. diff --git a/t/pattern-rules.sh b/t/pattern-rules.sh index 50558aa37..8e96d592a 100755 --- a/t/pattern-rules.sh +++ b/t/pattern-rules.sh @@ -52,7 +52,7 @@ for vpath in : false; do $MAKE diff $srcdir/bar/one.in ./foo/one.out diff $srcdir/two/z ./two.sh - test `cat mu.py` = True + test "$(cat mu.py)" = True cd $srcdir done diff --git a/t/spy-phony.sh b/t/spy-phony.sh index a1f9d15c0..105a44a9f 100755 --- a/t/spy-phony.sh +++ b/t/spy-phony.sh @@ -41,17 +41,17 @@ test ! -f rdir/foo : > pfile mkdir pdir $MAKE pdir pfile -test "`cat pfile`" = bar -test "`cat pdir/foo`" = foo +test "$(cat pfile)" = bar +test "$(cat pdir/foo)" = foo $MAKE other -test "`cat dummy`" = baz +test "$(cat dummy)" = baz $MAKE other -test "`cat dummy`" = "baz${nl}baz" +test "$(cat dummy)" = "baz${nl}baz" echo not run > indirect $MAKE indirect -test "`cat indirect`" = run -test "`cat dummy`" = "baz${nl}baz${nl}baz" +test "$(cat indirect)" = run +test "$(cat dummy)" = "baz${nl}baz${nl}baz" : diff --git a/t/spy-vpath-rewrite.sh b/t/spy-vpath-rewrite.sh index 3e70fea2a..df345c464 100755 --- a/t/spy-vpath-rewrite.sh +++ b/t/spy-vpath-rewrite.sh @@ -20,7 +20,7 @@ . ./defs || exit 1 -ocwd=`pwd` || fatal_ "couldn't get current working directory" +ocwd=$(pwd) || fatal_ "couldn't get current working directory" mkdir src cd src diff --git a/t/txinfo21b.sh b/t/txinfo21b.sh index 2172d7e0f..8f6d3f584 100755 --- a/t/txinfo21b.sh +++ b/t/txinfo21b.sh @@ -125,7 +125,7 @@ cat >> ../Makefile.am <<\EOF AM_MAKEINFOHTMLFLAGS = --no-headers --no-split AM_MAKEINFOFLAGS = --unsupported-option EOF -../configure --prefix "`pwd`" +../configure --prefix "$(pwd)" $MAKE html test -f main.html test -f sub/main2.html diff --git a/t/verbatim.sh b/t/verbatim.sh index eb12959ee..4921f2639 100755 --- a/t/verbatim.sh +++ b/t/verbatim.sh @@ -132,8 +132,8 @@ grep '^## unmodified$' Makefile.in grep '^xyz = \\$' Makefile.in $EGREP 'foo|bar' Makefile.in # For debugging. -test `grep -c '^foo +=' Makefile.in` -eq 2 -test `grep -c '^bar =' Makefile.in` -eq 3 +test $(grep -c '^foo +=' Makefile.in) -eq 2 +test $(grep -c '^bar =' Makefile.in) -eq 3 $AUTOCONF ./configure diff --git a/t/vpath-built-sources.sh b/t/vpath-built-sources.sh index e6d961f34..ae58511f0 100755 --- a/t/vpath-built-sources.sh +++ b/t/vpath-built-sources.sh @@ -20,7 +20,7 @@ required=cc . ./defs || exit 1 -ocwd=`pwd` || fatal_ "couldn't get current working directory" +ocwd=$(pwd) || fatal_ "couldn't get current working directory" cat >> configure.ac <<'END' AC_PROG_CC diff --git a/t/vpath-rewrite.sh b/t/vpath-rewrite.sh index 61fb2e685..8f1eeccb8 100755 --- a/t/vpath-rewrite.sh +++ b/t/vpath-rewrite.sh @@ -91,7 +91,7 @@ cd build $MAKE test-vpath cd .. -ocwd=`pwd` || fatal_ "couldn't get current working directory" +ocwd=$(pwd) || fatal_ "couldn't get current working directory" mkdir build2 build2/subbuild cd build2/subbuild "$ocwd"/configure