[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: spy.test for ::-rules
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: spy.test for ::-rules |
Date: |
Mon, 10 Nov 2003 22:49:04 +0100 |
User-agent: |
Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux) |
This was discussed in April/May, when Eric Siegerman (IIRC) suggested
using ::-rules to simplify
http://mail.gnu.org/archive/html/automake/2003-05/msg00089.html
2003-11-10 Alexandre Duret-Lutz <address@hidden>
* tests/spy.test: New file.
* tests/Makefile.am (TESTS): Add spy.test.
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.525
diff -u -r1.525 Makefile.am
--- tests/Makefile.am 10 Nov 2003 20:55:33 -0000 1.525
+++ tests/Makefile.am 10 Nov 2003 21:47:50 -0000
@@ -409,6 +409,7 @@
spell2.test \
spell3.test \
spelling.test \
+spy.test \
stamph2.test \
stdlib.test \
stdlib2.test \
Index: tests/spy.test
===================================================================
RCS file: tests/spy.test
diff -N tests/spy.test
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ tests/spy.test 10 Nov 2003 21:47:51 -0000
@@ -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
--
Alexandre Duret-Lutz
- FYI: spy.test for ::-rules,
Alexandre Duret-Lutz <=