[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] {master} Improve and extend tests on `:=' variable assignments.
From: |
Stefano Lattarini |
Subject: |
[PATCH] {master} Improve and extend tests on `:=' variable assignments. |
Date: |
Thu, 25 Nov 2010 14:37:28 +0100 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
The attached patch is based off of maint, and intended for master.
OK to apply?
Regards,
Stefano
-*-*-*-
Improve and extend tests on `:=' variable assignments.
* tests/colneq.test: Avoid useless use of wildcards and extra
variable assignments in Makefile.am. Use command-line automake
options instead of editing AUTOMAKE_OPTIONS in Makefile.am.
Make grepping of the generated Makefile.in slightly stricter.
Add a trailing `:' command.
* tests/colneq.test: Avoid useless use of EXTRA_DIST special
variable in Makefile.am. Do not create dummy files which are
not needed anymore. Also run autoconf, ./configure and make.
Add a trailing `:' command.
* tests/colneq3.test: New test, similar to colneq.test, but
running ./configure and make.
* tests/Makefile.am (TESTS): Update.
---
ChangeLog | 16 ++++++++++++++++
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
tests/colneq.test | 13 +++++++------
tests/colneq2.test | 19 ++++++++++++++-----
tests/colneq3.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 85 insertions(+), 11 deletions(-)
create mode 100755 tests/colneq3.test
From f40de139c765d5f7d83c586feb5f95462a98b85a Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Thu, 25 Nov 2010 14:33:54 +0100
Subject: [PATCH] Improve and extend tests on `:=' variable assignments.
* tests/colneq.test: Avoid useless use of wildcards and extra
variable assignments in Makefile.am. Use command-line automake
options instead of editing AUTOMAKE_OPTIONS in Makefile.am.
Make grepping of the generated Makefile.in slightly stricter.
Add a trailing `:' command.
* tests/colneq.test: Avoid useless use of EXTRA_DIST special
variable in Makefile.am. Do not create dummy files which are
not needed anymore. Also run autoconf, ./configure and make.
Add a trailing `:' command.
* tests/colneq3.test: New test, similar to colneq.test, but
running ./configure and make.
* tests/Makefile.am (TESTS): Update.
---
ChangeLog | 16 ++++++++++++++++
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
tests/colneq.test | 13 +++++++------
tests/colneq2.test | 19 ++++++++++++++-----
tests/colneq3.test | 46 ++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 85 insertions(+), 11 deletions(-)
create mode 100755 tests/colneq3.test
diff --git a/ChangeLog b/ChangeLog
index 2cbce3b..ace57fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-25 Stefano Lattarini <address@hidden>
+
+ Improve and extend tests on `:=' variable assignments.
+ * tests/colneq.test: Avoid useless use of wildcards and extra
+ variable assignments in Makefile.am. Use command-line automake
+ options instead of editing AUTOMAKE_OPTIONS in Makefile.am.
+ Make grepping of the generated Makefile.in slightly stricter.
+ Add a trailing `:' command.
+ * tests/colneq.test: Avoid useless use of EXTRA_DIST special
+ variable in Makefile.am. Do not create dummy files which are
+ not needed anymore. Also run autoconf, ./configure and make.
+ Add a trailing `:' command.
+ * tests/colneq3.test: New test, similar to colneq.test, but
+ running ./configure and make.
+ * tests/Makefile.am (TESTS): Update.
+
2010-11-21 Stefano Lattarini <address@hidden>
Tests: consistently use "|| Exit 1" after ". ./defs".
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5f1ab9e..d36bf88 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -138,6 +138,7 @@ clean.test \
clean2.test \
colneq.test \
colneq2.test \
+colneq3.test \
colon.test \
colon2.test \
colon3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 140b178..f545e6c 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -405,6 +405,7 @@ clean.test \
clean2.test \
colneq.test \
colneq2.test \
+colneq3.test \
colon.test \
colon2.test \
colon3.test \
diff --git a/tests/colneq.test b/tests/colneq.test
index 59d2414..66dbb8b 100755
--- a/tests/colneq.test
+++ b/tests/colneq.test
@@ -1,5 +1,6 @@
#! /bin/sh
-# Copyright (C) 1996, 2001, 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1996, 2001, 2002, 2003, 2010 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
@@ -21,14 +22,14 @@
set -e
cat > Makefile.am << 'END'
-ICONS := $(wildcard *.xbm)
-data_DATA = $(ICONS)
+FOOBAR := zardoz
END
$ACLOCAL
AUTOMAKE_fails
grep ':=.*not portable' stderr
-echo 'AUTOMAKE_OPTIONS = -Wno-portability' >> Makefile.am
-$AUTOMAKE
-grep 'ICONS :=' Makefile.in
+$AUTOMAKE -Wno-portability
+grep '^FOOBAR *:= *zardoz *$' Makefile.in
+
+:
diff --git a/tests/colneq2.test b/tests/colneq2.test
index e454c46..0c05899 100755
--- a/tests/colneq2.test
+++ b/tests/colneq2.test
@@ -20,14 +20,23 @@
set -e
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
cat > Makefile.am << 'END'
t = a b c
-EXTRA_DIST = $(t:=.test)
+FOO = $(t:=.test)
+.PHONY: test
+test:
+ test x'$(FOO)' = x'a.test b.test c.test'
END
-: > a.test
-: > b.test
-: > c.test
-
$ACLOCAL
+$AUTOCONF
$AUTOMAKE
+
+./configure
+$MAKE test
+
+:
diff --git a/tests/colneq3.test b/tests/colneq3.test
new file mode 100755
index 0000000..4c2afaa
--- /dev/null
+++ b/tests/colneq3.test
@@ -0,0 +1,46 @@
+#! /bin/sh
+# Copyright (C) 2010 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/>.
+
+# Test that := definitions work as expected at make time.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+cat >> configure.in << 'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+BAR := $(FOO)
+BAZ = $(FOO)
+FOO := foo
+.PHONY: test
+test:
+ test x'$(FOO)' = x'foo'
+ test x'$(BAZ)' = x'foo'
+ test x'$(BAR)' = x
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -Wno-portability
+
+./configure
+$MAKE test
+
+:
--
1.7.1
- [PATCH] {master} Improve and extend tests on `:=' variable assignments.,
Stefano Lattarini <=