]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] tests: more uses of $(...) over `...` for command substitution
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 28 Jun 2012 15:31:52 +0000 (17:31 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 28 Jun 2012 15:33:52 +0000 (17:33 +0200)
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 <stefano.lattarini@gmail.com>
16 files changed:
t/ax/depcomp-shuffle.sh
t/built-sources-install.sh
t/depcomp-recover.sh
t/dist-srcdir.sh
t/dist-srcdir2.sh
t/fort2.sh
t/memoize.tap
t/parallel-tests-dynamic.sh
t/parallel-tests-longest-stem.sh
t/pattern-rules.sh
t/spy-phony.sh
t/spy-vpath-rewrite.sh
t/txinfo21b.sh
t/verbatim.sh
t/vpath-built-sources.sh
t/vpath-rewrite.sh

index a887f02847b8990d5f593facb9bdcf2d9929df60..d64f963967d0b9143eb6af10c25d5daa0bfa3f94 100644 (file)
@@ -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.
index 7234e7a3fb693775cf230dbe40b719622c7d63a0..2f53bb51edf658bcb22b564d62a81bcf2dffbb0b 100755 (executable)
@@ -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
index 7d3e7df3082855b60fee0f33e5223acba9cd251b..77775f6e65378c03ed4a37542e51a18ff8a7ea33 100755 (executable)
@@ -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 \
index 1f6cbb0a22dbd7896806933a83d159b5c545ce24..64cdcd8c1a03b7a0d4ad19b13c9f6f5505197c4d 100755 (executable)
@@ -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
index 5a105234be7778c3c7b85eae52887d021988132f..52146cdc7956c395707e6014af00b0e28c3b940f 100755 (executable)
@@ -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
 
 :
index 510938ca1ef037ce63678bcf3165de42fc95fe9f..4ec207c61079d024546bb5f630fc68fa8bf1d69c 100755 (executable)
@@ -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
index ea2f69e5b5305316b0e3834bc6588ac914630b84..a89515bcc3c874cc482a77a08e583d04569720f7 100755 (executable)
@@ -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
index da61450c4d5d9c716e55cf142df53d3499f87a92..9d561a3c30b976872b2d56005aa2e9605522ef5b 100755 (executable)
@@ -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
index 521cefd647245e4a0400a48473b0183f782c6e2c..181014b0909848a7127ee12e05a9d658bdc615a5 100755 (executable)
@@ -52,7 +52,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE -a
 
-./configure --prefix="`pwd`/inst"
+./configure --prefix="$(pwd)/inst"
 
 $MAKE check
 ls -l # For debugging.
index 50558aa3705c87cc2f0bf016fed2a04cd8b11ceb..8e96d592a190f67f3421633b97908980e71c9c6d 100755 (executable)
@@ -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
 
index a1f9d15c043f6b5708689b852abbe1f4dc9d5a9f..105a44a9fdd8f91fc6ba4c164046c2536fad2748 100755 (executable)
@@ -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"
 
 :
index 3e70fea2a21f89d2d457db9907e8dd5ac07cf48b..df345c4641817891e78d054b04490e5af1ba4716 100755 (executable)
@@ -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
index 2172d7e0f50119d5bab4a68e7916a08d00085686..8f6d3f5843768349f01a786b838593e67d7fdc33 100755 (executable)
@@ -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
index eb12959ee4c03903dbe39593591c501ef2de9130..4921f2639bda821152d09131f0d2e88749c8ae74 100755 (executable)
@@ -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
index e6d961f34329f20d1c2ff422fed58cc029d177e4..ae58511f07c94bdc2d5e69de951f9ecead23f60c 100755 (executable)
@@ -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
index 61fb2e6853ecc8e6f856031f11140a035b64aebe..8f1eeccb84b332ef4281f952d1a313e7cf520fa3 100755 (executable)
@@ -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