automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[FYI] {testsuite-work} tests: few more checks on automatic remake suppor


From: Stefano Lattarini
Subject: [FYI] {testsuite-work} tests: few more checks on automatic remake support
Date: Tue, 3 May 2011 11:04:36 +0200
User-agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )

* 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(+), 0 deletions(-)
 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  <address@hidden>
 
+       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  <address@hidden>
+
        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 <http://www.gnu.org/licenses/>.
+
+# 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 <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([$mkfile sub/$mkfile])
+FOO='$magic1'
+AC_OUTPUT
+END
+
+mkdir sub
+echo SUBDIRS = sub > $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 <http://www.gnu.org/licenses/>.
+
+# 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 <<END
+AC_INIT([$me], [1.0])
+AM_INIT_AUTOMAKE
+AC_CONFIG_FILES([$mkfile sub/$mkfile])
+FOO='$magic1'
+AC_OUTPUT
+END
+
+mkdir sub
+
+cat > $mkfile.am <<END
+SUBDIRS = sub
+AM_MAKEFLAGS = -f $mkfile
+END
+
+cat > sub/$mkfile.am <<END
+AM_MAKEFLAGS = -f $mkfile
+END
+
+$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 -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
+
+:
-- 
1.7.2.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]