#! /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
# 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
$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