test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / hdr-vars-defined-once.sh
old mode 100755 (executable)
new mode 100644 (file)
index 1e31cd2..91fbcb6
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@
 # Test to make sure header vars defined only once when including.
 # Report from Marcus G. Daniels.
 
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac <<END
 AC_OUTPUT
@@ -31,8 +31,7 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-len=`grep '^srcdir' Makefile.in | wc -l`
-test $len -eq 1
+test $(grep -c '^srcdir' Makefile.in) -eq 1
 
 # Also make sure include file is distributed.
 sed -n -e '/^DIST_COMMON =.*\\$/ {