From: Alexandre Duret-Lutz Date: Mon, 10 Nov 2003 21:49:21 +0000 (+0000) Subject: * tests/spy.test: New file. X-Git-Tag: Release-1-7b~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a5e1b42a6f8149fb67950a07f635476c504f478a;p=thirdparty%2Fautomake.git * tests/spy.test: New file. * tests/Makefile.am (TESTS): Add spy.test. --- diff --git a/ChangeLog b/ChangeLog index 77df86bb8..8b05edff9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2003-11-10 Alexandre Duret-Lutz + * tests/spy.test: New file. + * tests/Makefile.am (TESTS): Add spy.test. + * automake.in (handle_configure): Distribute and define mkinstalldirs only if it is already present in the package. (scan_autoconf_files): Do not require mkinstalldirs. diff --git a/tests/Makefile.am b/tests/Makefile.am index afb9ed22b..66520ed82 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -409,6 +409,7 @@ spell.test \ spell2.test \ spell3.test \ spelling.test \ +spy.test \ stamph2.test \ stdlib.test \ stdlib2.test \ diff --git a/tests/Makefile.in b/tests/Makefile.in index a3532d842..139579095 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -523,6 +523,7 @@ spell.test \ spell2.test \ spell3.test \ spelling.test \ +spy.test \ stamph2.test \ stdlib.test \ stdlib2.test \ diff --git a/tests/spy.test b/tests/spy.test new file mode 100755 index 000000000..b09a33fbf --- /dev/null +++ b/tests/spy.test @@ -0,0 +1,84 @@ +#! /bin/sh +# Copyright (C) 2003 Free Software Foundation, Inc. +# +# This file is part of GNU Automake. +# +# GNU Automake 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. +# +# GNU Automake 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 autoconf; see the file COPYING. If not, write to +# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# Check whether double colon rules work. The Unix V7 make manual +# mentions double-colon rules, but POSIX does not. They seem to be +# supported by all Make implementation as we can tell. This test case +# is a spy: we want to detect if there exist implementations where +# these do not work. We might use these rules to simplify the rebuild +# rules (instead of the $? hack). + +. ./defs || exit 1 + +set -e + +cat >Makefile <<\EOF +a :: b + echo rule1 >> $@ +a :: c + echo rule2 >> $@ +a :: b c + echo rule3 >> $@ +EOF + +touch b c +$MAKE +test "`cat a`" = rule1 +: > a +$sleep +touch b +$MAKE +test "`cat a`" = rule1 +: > a +$sleep +touch c +$MAKE +test "`cat a`" = rule2 +: > a +$sleep +touch b c +$MAKE +test "`cat a`" = rule1 + + +: > a +$sleep +cat >Makefile <<\EOF +a :: b c + echo rule1 >> $@ +a :: c + echo rule2 >> $@ +a :: b + echo rule3 >> $@ +EOF + +touch b +$MAKE +test "`cat a`" = rule1 +: > a +$sleep +touch c +$MAKE +test "`cat a`" = rule1 +: > a +$sleep +touch b c +$MAKE +test "`cat a`" = rule1