tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / ext.sh
old mode 100755 (executable)
new mode 100644 (file)
index 08643ac..d771d41
--- a/t/ext.sh
+++ b/t/ext.sh
@@ -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
@@ -16,7 +16,7 @@
 
 # Test to make sure extensions are set correctly for various languages.
 
-. ./defs || Exit 1
+. test-init.sh
 
 cat >> configure.ac << 'END'
 AC_PROG_F77
@@ -34,13 +34,10 @@ END
 $ACLOCAL
 $AUTOMAKE
 
-for ext in f for f90 f95 F F90 F95 r m mm upc
-do
-   # Some versions of the BSD shell wrongly exit when 'set -e' is active
-   # if the last command within a compound statement fails and is guarded
-   # by an && only.  So we play safe and use the following idiom, instead
-   # of the apparently simpler 'grep ... && Exit 1'.
-   if grep "^$ext\.o:" Makefile.in; then Exit 1; else :; fi
+for ext in f for f90 f95 F F90 F95 r m mm upc; do
    grep "^\.$ext\.o:" Makefile.in
+   grep "^$ext\.o:" Makefile.in && exit 1
+   : For shells with busted 'set -e'.
 done
-Exit 0
+
+: