From: Stefano Lattarini Date: Sun, 16 Oct 2011 15:07:19 +0000 (+0200) Subject: coverage: required but missing '.am' and '.m4' files are diagnosed X-Git-Tag: v1.12.0b~224 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=237b93207fcf50e49540ce2d604a9b6fe312d713;p=platform%2Fupstream%2Fautomake.git 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. --- diff --git a/ChangeLog b/ChangeLog index e3787bb..01a5997 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2011-11-22 Stefano Lattarini + 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 + 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 . + +# 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 . + +# 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 + +: