From: Stefano Lattarini Date: Mon, 31 Dec 2012 22:29:24 +0000 (+0100) Subject: coverage: test CONFIG_STATUS_DEPENDENCIES X-Git-Tag: v1.13.1~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f3e8d1cd06707576cf702e11c758617bea1a067f;p=platform%2Fupstream%2Fautomake.git coverage: test CONFIG_STATUS_DEPENDENCIES * t/remake-config-status-dependencies.sh: New test. * t/list-of-tests.mk: Add it. * doc/automake.texi: Reference it in comments. Signed-off-by: Stefano Lattarini --- diff --git a/doc/automake.texi b/doc/automake.texi index b23805a..ee2df4d 100644 --- a/doc/automake.texi +++ b/doc/automake.texi @@ -9892,6 +9892,7 @@ from @file{configure.ac}. For instance, the following statement will cause @file{configure} to be rerun each time @file{version.sh} is changed. +@c Keep in sync with remake-config-status-dependencies.sh @example AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version.sh']) @end example diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk index a73e551..d612573 100644 --- a/t/list-of-tests.mk +++ b/t/list-of-tests.mk @@ -919,6 +919,7 @@ t/remake-after-aclocal-m4.sh \ t/remake-include-configure.sh \ t/remake-include-makefile.sh \ t/remake-include-aclocal.sh \ +t/remake-config-status-dependencies.sh \ t/remake-deeply-nested.sh \ t/remake-mild-stress.sh \ t/remake-all-1.sh \ diff --git a/t/remake-config-status-dependencies.sh b/t/remake-config-status-dependencies.sh new file mode 100755 index 0000000..c625661 --- /dev/null +++ b/t/remake-config-status-dependencies.sh @@ -0,0 +1,70 @@ +#! /bin/sh +# Copyright (C) 2013 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 . + +# Test CONFIG_STATUS_DEPENDENCIES. + +. test-init.sh + +cat >> configure.ac <<'END' +. ${srcdir}/version.sh +AC_SUBST([EXTRA_VERSION]) +AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/version.sh']) +AC_OUTPUT +END + +echo EXTRA_VERSION=1.0 > version.sh + +cat > Makefile.am <<'END' +.PHONY: test-1 test-2 test-3 +check-local: test-3 +test-1: + test $(EXTRA_VERSION) = 1.0 +test-2: + test $(EXTRA_VERSION) = 2.1 +test-3: + test $(EXTRA_VERSION) = 3.14 +END + +$ACLOCAL +$AUTOCONF +$AUTOMAKE + +./configure +$MAKE test-1 + +$sleep +echo EXTRA_VERSION=2.1 > version.sh +using_gmake || $MAKE Makefile +$MAKE test-2 + +$MAKE distclean +mkdir build +cd build +../configure +$MAKE test-2 +$sleep +echo EXTRA_VERSION=3.14 > ../version.sh +using_gmake || $MAKE Makefile +$MAKE test-3 + +# Contents of $(CONFIG_STATUS_DEPENDENCIES) are *not* to be +# automatically distributed; there is no generic good reason +# for that. +$MAKE distdir +test ! -e $distdir/version.sh +test -f $distdir/configure || exit 99 # Sanity check. + +: