+2011-03-30 Stefano Lattarini <stefano.lattarini@gmail.com>
+
+ tests: improve tests on "maintainer-clean" target
+ * tests/aclocal6.test: Move checks related to "maintainer-clean"
+ functionalities into ...
+ * tests/maintclean-vpath.test: ... this new test.
+ * tests/maintclean.test: Update heading comments. Extend to also
+ test subdirs. Remove useless disabling of YACC. Fix m4 quoting
+ in configure.in. Add a trailing `:' command. Remove extra blank
+ lines.
+ * tests/Makefile.am (TESTS): Update.
+
2011-03-21 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
tests: fix unindent to use printf not echo for script.
lzma.test \
m4-inclusion.test \
maintclean.test \
+maintclean-vpath.test \
make.test \
makej.test \
makej2.test \
lzma.test \
m4-inclusion.test \
maintclean.test \
+maintclean-vpath.test \
make.test \
makej.test \
makej2.test \
#! /bin/sh
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2011 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
$AUTOCONF
$AUTOMAKE --copy --add-missing
-# Users can disable autom4te.cache.
-if test -d autom4te.cache; then
- test_cache='test -d'
-else
- test_cache=:
-fi
-
mkdir build
cd build
test -f $me-1.0/m4/somedefs.m4
test -f $me-1.0/acinclude.m4
-# Make sure maintainer-clean works in VPATH builds.
-# (This is unrelated to the rest of this test.)
-$MAKE clean
-$test_cache ../autom4te.cache
-test -f Makefile
-test -f sub/Makefile
-$MAKE maintainer-clean
-test ! -d ../autom4te.cache
-test ! -f Makefile
-test ! -f sub/Makefile
-
:
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2011 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 Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Make sure distclean and maintainer-clean erase the right files.
+# This test is for VPATH builds; see sister test `maintclean-vpath.test'
+# for in-tree builds.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([bar sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+SUBDIRS = sub
+noinst_DATA = foo.c
+foo.c:
+ touch foo.c
+MAINTAINERCLEANFILES = foo.c
+END
+
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+ cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
+END
+
+: > bar.in
+: > sub/zap.sh
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+# Users can disable autom4te.cache.
+if test -d autom4te.cache; then
+ test_cache='test -d ../autom4te.cache'
+else
+ test_cache=:
+fi
+
+mkdir build
+
+chmod a-w . sub
+
+cd build
+
+../configure
+test -f bar
+
+$MAKE
+test -f foo.c
+test -f sub/zap
+$test_cache
+
+$MAKE distclean
+test ! -f bar
+test ! -f Makefile
+test ! -f sub/Makefile
+test ! -f config.status
+test -f foo.c
+test -f sub/zap
+test -f ../sub/zap.sh
+$test_cache
+
+../configure
+test -f bar
+
+$MAKE foo.c
+test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
+
+chmod u+w ..
+
+$MAKE maintainer-clean
+test -f ../sub/zap.sh
+test ! -f bar
+test ! -f foo.c
+test ! -f sub/zap
+test ! -f Makefile
+test ! -f sub/Makefile
+test ! -f config.status
+test ! -d ../autom4te.cache
+
+:
#! /bin/sh
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2011 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/>.
# Make sure distclean and maintainer-clean erase the right files.
+# This test is for in-tree builds; see sister test `maintclean-vpath.test'
+# for VPATH builds.
. ./defs || Exit 1
set -e
cat >> configure.in << 'END'
-AC_CONFIG_FILES(bar)
+AC_CONFIG_FILES([bar sub/Makefile])
AC_OUTPUT
END
cat > Makefile.am <<'END'
+SUBDIRS = sub
noinst_DATA = foo.c
-
foo.c:
touch foo.c
-
MAINTAINERCLEANFILES = foo.c
+END
+mkdir sub
+cat > sub/Makefile.am <<'END'
+noinst_SCRIPTS = zap
+zap: zap.sh
+ cp $(srcdir)/zap.sh $@ && chmod a+x $@
+MAINTAINERCLEANFILES = zap
END
-touch bar.in
+: > bar.in
+: > sub/zap.sh
$ACLOCAL
$AUTOCONF
test_cache=:
fi
-# Since we don't require Yacc, make sure it's not used.
-./configure YACC=false
+./configure
test -f bar
$MAKE
test -f foo.c
+test -f sub/zap
+$test_cache
$MAKE distclean
test ! -f bar
test ! -f Makefile
+test ! -f sub/Makefile
test ! -f config.status
test -f foo.c
+test -f sub/zap
+test -f sub/zap.sh
$test_cache
./configure
$MAKE foo.c
test -f foo.c
+cd sub
+$MAKE zap
+test -f zap
+cd ..
$MAKE maintainer-clean
+test -f sub/zap.sh
test ! -f bar
test ! -f foo.c
+test ! -f sub/zap
test ! -f Makefile
+test ! -f sub/Makefile
test ! -f config.status
test ! -d autom4te.cache
+
+: