From cbfbccce3e2e56fdf2a5844e6c73db2cb3099a64 Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 2 May 2011 19:04:01 +0200 Subject: [PATCH] tests: few more checks on automatic remake support * tests/remake-all-1.test: New test, check that the "all" target triggers rebuilt of outdated Makefiles. * tests/remake-all-2.test: Likewise, but for when the makefiles are not named `Makefile'. * tests/Makefile.am (TESTS): Update. --- ChangeLog | 9 ++++++ tests/Makefile.am | 2 ++ tests/Makefile.in | 2 ++ tests/remake-all-1.test | 67 +++++++++++++++++++++++++++++++++++++++++++ tests/remake-all-2.test | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 155 insertions(+) create mode 100755 tests/remake-all-1.test create mode 100755 tests/remake-all-2.test diff --git a/ChangeLog b/ChangeLog index 9a512c5..4c04c15 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2011-05-03 Stefano Lattarini + tests: few more checks on automatic remake support + * tests/remake-all-1.test: New test, check that the "all" target + triggers rebuilt of outdated Makefiles. + * tests/remake-all-2.test: Likewise, but for when the makefiles + are not named `Makefile'. + * tests/Makefile.am (TESTS): Update. + +2011-05-03 Stefano Lattarini + tests: check some remake features with non-GNU make too * tests/acloca14.test ($required): Drop "GNUmake". This test works as-is with non-GNU make implementations. diff --git a/tests/Makefile.am b/tests/Makefile.am index 56e5859..0cba6a8 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -822,6 +822,8 @@ remake10b.test \ remake10c.test \ remake11.test \ remake12.test \ +remake-all-1.test \ +remake-all-2.test \ remake-gnulib-add-acsubst.test \ remake-gnulib-add-header.test \ remake-gnulib-remove-header.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index e44b2e7..fd06043 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1082,6 +1082,8 @@ remake10b.test \ remake10c.test \ remake11.test \ remake12.test \ +remake-all-1.test \ +remake-all-2.test \ remake-gnulib-add-acsubst.test \ remake-gnulib-add-header.test \ remake-gnulib-remove-header.test \ diff --git a/tests/remake-all-1.test b/tests/remake-all-1.test new file mode 100755 index 0000000..670b46a --- /dev/null +++ b/tests/remake-all-1.test @@ -0,0 +1,67 @@ +#! /bin/sh +# Copyright (C) 2010, 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 . + +# Check that the "all" target triggers rebuilt of outdated Makefiles. +# See also sister test `remake-all-2.test'. + +. ./defs || Exit 1 + +mkfile=Makefile + +magic1=::MagicStringOne:: +magic2=__MagicStringTwo__ +magic3=%%MagicStringThree%% + +cat > configure.in < $mkfile.am +: > sub/$mkfile.am + +$ACLOCAL +$AUTOMAKE + +$EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in + +$AUTOCONF +./configure + +$FGREP "$magic1" mkfile.in && Exit 1 # Sanity check. + +# Two code paths in configure.am: + +# - either a file in $(am__configure_deps) has been updated ... +$sleep +echo "AC_SUBST([FOO])" >> configure.in +$MAKE +$FGREP FOO $mkfile # For debugging. +$FGREP $magic1 $mkfile + +# - ... or not; i.e., Makefile.am or an included file has. +$sleep +echo "# $magic2" >> $mkfile.am +echo "# $magic3" >> sub/$mkfile.am +$MAKE +$FGREP $magic2 $mkfile +$FGREP $magic3 sub/$mkfile + +: diff --git a/tests/remake-all-2.test b/tests/remake-all-2.test new file mode 100755 index 0000000..395ef69 --- /dev/null +++ b/tests/remake-all-2.test @@ -0,0 +1,75 @@ +#! /bin/sh +# Copyright (C) 2010, 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 . + +# Check that the "all" target triggers rebuilt of outdated makefiles. +# This handle the case in which the makefiles are not called `Makefile'. +# See also sister test `remake-all-1.test'. + +. ./defs || Exit 1 + +mkfile=foobar + +magic1=::MagicStringOne:: +magic2=__MagicStringTwo__ +magic3=%%MagicStringThree%% + +cat > configure.in < $mkfile.am < sub/$mkfile.am <> configure.in +$MAKE -f $mkfile +$FGREP FOO $mkfile # For debugging. +$FGREP $magic1 $mkfile + +# - ... or not; i.e., Makefile.am or an included file has. +$sleep +echo "# $magic2" >> $mkfile.am +echo "# $magic3" >> sub/$mkfile.am +$MAKE -f $mkfile +$FGREP $magic2 $mkfile +$FGREP $magic3 sub/$mkfile + +: -- 2.7.4