automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [FYI] [ng] tests: more uses of $(...) over `...` for comma


From: Stefano Lattarini
Subject: [Automake-NG] [FYI] [ng] tests: more uses of $(...) over `...` for command substitution
Date: Thu, 28 Jun 2012 17:34:44 +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 <address@hidden>
---
 t/ax/depcomp-shuffle.sh          |    2 +-
 t/built-sources-install.sh       |    2 +-
 t/depcomp-recover.sh             |    2 +-
 t/dist-srcdir.sh                 |    2 +-
 t/dist-srcdir2.sh                |    2 +-
 t/fort2.sh                       |    2 +-
 t/memoize.tap                    |    4 ++--
 t/parallel-tests-dynamic.sh      |    4 ++--
 t/parallel-tests-longest-stem.sh |    2 +-
 t/pattern-rules.sh               |    2 +-
 t/spy-phony.sh                   |   12 ++++++------
 t/spy-vpath-rewrite.sh           |    2 +-
 t/txinfo21b.sh                   |    2 +-
 t/verbatim.sh                    |    4 ++--
 t/vpath-built-sources.sh         |    2 +-
 t/vpath-rewrite.sh               |    2 +-
 16 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/t/ax/depcomp-shuffle.sh b/t/ax/depcomp-shuffle.sh
index a887f02..d64f963 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 7234e7a..2f53bb5 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 7d3e7df..77775f6 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 1f6cbb0..64cdcd8 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 5a10523..52146cd 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 510938c..4ec207c 100755
--- a/t/fort2.sh
+++ b/t/fort2.sh
@@ -82,7 +82,7 @@ grep ' fake-fc .* address@hidden .* sub/bonjour\.f08 ' out
 grep ' fake-fc .* --gby .* address@hidden .* bye\.f95 ' out
 grep ' fake-fc .* --gby .* address@hidden .* 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 ea2f69e..a89515b 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 da61450..9d561a3 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 521cefd..181014b 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 50558aa..8e96d59 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 a1f9d15..105a44a 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 3e70fea..df345c4 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 2172d7e..8f6d3f5 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 eb12959..4921f26 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 e6d961f..ae58511 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 61fb2e6..8f1eecc 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
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]