tests: use more POSIX shell features our test scripts
[platform/upstream/automake.git] / t / subst3.sh
index cc81063..f201336 100755 (executable)
@@ -23,7 +23,7 @@ cat >> configure.ac <<'EOF'
 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])
@@ -139,7 +139,7 @@ rm -f install-sh
 $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
@@ -147,9 +147,9 @@ $MAKE test-install-exec
 $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
@@ -162,14 +162,14 @@ $MAKE uninstall
 $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