test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / instfail.sh
old mode 100755 (executable)
new mode 100644 (file)
index 1e5a340..7a8f1f2
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2008-2012 Free Software Foundation, Inc.
+# Copyright (C) 2008-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
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 # The install rule should honor failures of the install program.
-# Some of these are already caught by instmany.test.
+# Some of these are already caught by 'instmany.sh'.
 
 # This test has a few sister tests, for java, info, libtool.
 
 required=cc
-. ./defs || Exit 1
+. test-init.sh
 
 cat >>configure.ac <<END
 AC_PROG_CC
@@ -60,7 +60,7 @@ $ACLOCAL
 $AUTOCONF
 $AUTOMAKE --add-missing
 
-instdir=`pwd`/inst
+instdir=$(pwd)/inst || fatal_ "getting current working directory"
 ./configure --prefix="$instdir"
 $MAKE
 
@@ -71,23 +71,22 @@ for file in lib1.a libn1.a
 do
   chmod a-r $file
   test ! -r $file || skip_ "cannot drop file read permissions"
-  $MAKE install-exec && Exit 1
+  $MAKE install-exec && exit 1
   chmod u+r $file
 done
 
 $MAKE unreadable-prog
-$MAKE install-exec && Exit 1
+$MAKE install-exec && exit 1
 $MAKE readable-prog
 
 $MAKE unreadable-progn
-$MAKE install-exec && Exit 1
+$MAKE install-exec && exit 1
 $MAKE readable-progn
 
-if grep "^EMACS = no" Makefile; then :; else
-  for file in lisp1.el lisp1.elc
-  do
+if ! grep "^EMACS = no" Makefile; then
+  for file in lisp1.el lisp1.elc; do
     chmod a-r $file
-    $MAKE install-data && Exit 1
+    $MAKE install-data && exit 1
     chmod u+r $file
   done
 fi