test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / configure.sh
old mode 100755 (executable)
new mode 100644 (file)
index cedba55..7de9e76
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2010-2012 Free Software Foundation, Inc.
+# Copyright (C) 2010-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
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Diagnose if the autoconf input is named configure.in.
 # Diagnose if both configure.in and configure.ac are present, prefer
 # configure.ac.
 
-. ./defs || Exit 1
+. test-init.sh
 
 cat >configure.ac <<EOF
 AC_INIT([$me], [1.0])
@@ -33,11 +34,11 @@ EOF
 
 : >Makefile.am
 
-$ACLOCAL 2>stderr && { cat stderr >&2; Exit 1; }
+$ACLOCAL 2>stderr && { cat stderr >&2; exit 1; }
 cat stderr >&2
 grep 'configure\.ac.*configure\.in.*both present' stderr
 
-$ACLOCAL -Wno-error 2>stderr || { cat stderr >&2; Exit 1; }
+$ACLOCAL -Wno-error 2>stderr || { cat stderr >&2; exit 1; }
 cat stderr >&2
 grep 'configure\.ac.*configure\.in.*both present' stderr
 grep 'proceeding.*configure\.ac' stderr
@@ -51,4 +52,8 @@ AUTOMAKE_run -Wno-error
 grep 'configure\.ac.*configure\.in.*both present' stderr
 grep 'proceeding.*configure\.ac' stderr
 
+mv -f configure.ac configure.in
+AUTOMAKE_fails
+grep "autoconf input.*'configure.ac', not 'configure.in'" stderr
+
 :