tests: avoid a spurious failure on NetBSD
[platform/upstream/automake.git] / t / werror4.sh
index b2f3f6a..7908d1d 100755 (executable)
@@ -16,7 +16,7 @@
 
 # -Werror and local -Werror settings should be flagged for the user.
 
-. ./defs || Exit 1
+. test-init.sh
 
 cat >>configure.ac <<\END
 AC_CONFIG_FILES([sub/Makefile])
@@ -40,7 +40,7 @@ $ACLOCAL
 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
@@ -48,7 +48,7 @@ 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
@@ -56,11 +56,11 @@ 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
 grep 'SUB multiply defined' stderr
-grep 'warnings are treated as errors' stderr && Exit 1
+grep 'warnings are treated as errors' stderr && exit 1
 
 :