test harness: improve catching of usage errors in script 'test-driver'
[platform/upstream/automake.git] / t / distcleancheck.sh
old mode 100755 (executable)
new mode 100644 (file)
index 5cdd6f1..b91d835
@@ -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
@@ -18,7 +18,7 @@
 # The example Makefile.am we use is from the FAQ entry 'distcleancheck'.
 
 required=cc
-. ./defs || exit 1
+. test-init.sh
 
 cat >>configure.ac << 'END'
 AC_PROG_CC
@@ -62,9 +62,7 @@ mv -f t Makefile.am
 $AUTOMAKE
 ./configure
 $MAKE
-$MAKE distcheck 2>stderr && { cat srderr >&2; exit 1; }
-cat stderr >&2
-
+run_make -E -e FAIL distcheck
 grep 'ERROR:.*files left in build directory after distclean' stderr
 grep '^\./foo\.1$' stderr