automake-patches
[Top][All Lists]
Advanced

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

[FYI] {maint} coverage: required but missing '.am' and '.m4' files are d


From: Stefano Lattarini
Subject: [FYI] {maint} coverage: required but missing '.am' and '.m4' files are diagnosed
Date: Tue, 22 Nov 2011 21:49:49 +0100

The stub rules emitted to work around the "deleted header problem"
for `.m4' files (included by autoconf in e.g., configure.ac) and
for `.am' files (included by automake in e.g., Makefile.am) should
not prevent the remake rules from correctly erroring out when a
still-required file is missing.

* tests/deleted-am.test: New test.
* tests/deleted-m4.test: Likewise.
* tests/Makefile.am (TESTS): Add them.
---
 ChangeLog             |   12 +++++++++
 tests/Makefile.am     |    2 +
 tests/Makefile.in     |    2 +
 tests/deleted-am.test |   65 +++++++++++++++++++++++++++++++++++++++++++++++
 tests/deleted-m4.test |   67 +++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 148 insertions(+), 0 deletions(-)
 create mode 100755 tests/deleted-am.test
 create mode 100755 tests/deleted-m4.test

diff --git a/ChangeLog b/ChangeLog
index e3787bb..01a5997 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2011-11-22  Stefano Lattarini  <address@hidden>
 
+       coverage: required but missing '.am' and '.m4' files are diagnosed
+       The stub rules emitted to work around the "deleted header problem"
+       for `.m4' files (included by autoconf in e.g., configure.ac) and
+       for `.am' files (included by automake in e.g., Makefile.am) should
+       not prevent the remake rules from correctly erroring out when a
+       still-required file is missing.
+       * tests/deleted-am.test: New test.
+       * tests/deleted-m4.test: Likewise.
+       * tests/Makefile.am (TESTS): Add them.
+
+2011-11-22  Stefano Lattarini  <address@hidden>
+
        coverage: expose automake bug#10111 in the testsuite
        * tests/remake-am-pr10111.test: New test, xfailing.
        * tests/remake-m4-pr10111.test: Likewise.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 936b781..831906b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -302,6 +302,8 @@ dejagnu-relative-srcdir.test \
 dejagnu-siteexp-extend.test \
 dejagnu-siteexp-append.test \
 dejagnu-siteexp-useredit.test \
+deleted-am.test \
+deleted-m4.test \
 depacl2.test \
 depcomp.test \
 depcomp2.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 18983ae..3ad0146 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -586,6 +586,8 @@ dejagnu-relative-srcdir.test \
 dejagnu-siteexp-extend.test \
 dejagnu-siteexp-append.test \
 dejagnu-siteexp-useredit.test \
+deleted-am.test \
+deleted-m4.test \
 depacl2.test \
 depcomp.test \
 depcomp2.test \
diff --git a/tests/deleted-am.test b/tests/deleted-am.test
new file mode 100755
index 0000000..cc82e79
--- /dev/null
+++ b/tests/deleted-am.test
@@ -0,0 +1,65 @@
+#! /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/>.
+
+# The stub rules emitted to work around the "deleted header problem"
+# for `.am' files shouldn't prevent the remake rules from correctly
+# erroring out when a still-required file is missing.
+# See also discussion about automake bug#9768.
+
+. ./defs || Exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+echo 'include $(top_srcdir)/foobar.am' > Makefile.am
+echo 'include zardoz.am' > foobar.am
+: > zardoz.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+
+rm -f zardoz.am
+$MAKE >output 2>&1 && { cat output; Exit 1; }
+cat output
+# FIXME: enable this stricter grepping, once bug#9768 has been taken
+# FIXME: care of.
+## This error will come from automake, not make, so we can be stricter
+## in our grepping of it.
+# grep 'cannot open.*zardoz\.am' output
+grep 'zardoz\.am' output
+grep 'foobar\.am' output && Exit 1 # No spurious error, please.
+
+# Try  with one less indirection.
+: > foobar.am
+$AUTOMAKE Makefile
+./config.status Makefile
+$MAKE # Sanity check.
+rm -f foobar.am
+$MAKE >output 2>&1 && { cat output; Exit 1; }
+cat output
+# FIXME: enable this stricter grepping, once bug#9768 has been taken
+# FIXME: care of.
+## This error will come from automake, not make, so we can be stricter
+## in our grepping of it.
+# grep 'cannot open.*foobar\.am' output
+grep 'foobar\.am' output
+
+:
diff --git a/tests/deleted-m4.test b/tests/deleted-m4.test
new file mode 100755
index 0000000..6b0b9af
--- /dev/null
+++ b/tests/deleted-m4.test
@@ -0,0 +1,67 @@
+#! /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/>.
+
+# The stub rules emitted to work around the "deleted header problem"
+# for `.m4' files shouldn't prevent the remake rules from correctly
+# erroring out when a still-required file is missing.
+# See also discussion about automake bug#9768.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in <<'END'
+m4_include([foobar.m4])
+AC_OUTPUT
+END
+
+: > Makefile.am
+
+echo 'm4_include([zardoz.m4])' > foobar.m4
+: > zardoz.m4
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE
+
+rm -f zardoz.m4
+$MAKE >output 2>&1 && { cat output; Exit 1; }
+cat output
+# This error will come from aclocal, not make, so we can be stricter
+# in our grepping of it.
+grep ' foobar\.m4:1:.*zardoz\.m4.*does not exist' output
+# No spurious errors, please.
+$FGREP -v ' foobar.m4:1:' output | $FGREP 'foobar.m4' && Exit 1
+
+# Try with one less indirection.
+: > foobar.m4
+$ACLOCAL --force
+$AUTOCONF
+./configure
+$MAKE # Sanity check.
+rm -f foobar.m4
+$MAKE >output 2>&1 && { cat output; Exit 1; }
+cat output
+# This error will come from aclocal, not make, so we can be stricter
+# in our grepping of it.
+grep 'foobar\.m4.*does not exist' output
+# No spurious errors, please (ok, this is really paranoid).
+$FGREP 'zardoz.m4' output && Exit 1
+
+:
-- 
1.7.2.3




reply via email to

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