]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Coverage: warn about configure substitution in EXTRA_PRIMARY.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Nov 2009 20:57:11 +0000 (21:57 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Nov 2009 20:57:11 +0000 (21:57 +0100)
* tests/subst5.test: New test.
* tests/Makefile.am: Update.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/Makefile.am
tests/Makefile.in
tests/subst5.test [new file with mode: 0755]

index adab68a8488dfe84b4b6f58a8d9c79aad2e56b1f..bdd7ba092bd23f83a3a0297a9b73528a4a3f631e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2009-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       Coverage: warn about configure substitution in EXTRA_PRIMARY.
+       * tests/subst5.test: New test.
+       * tests/Makefile.am: Update.
+
        Coverage for syntax errors with conditionals in included fragments.
        * tests/condinc2.test: Amend test.
 
index fe16314a23a7efb1af1d115d52a0c3b2f0d08101..2d012934df81fff931148984032a0ad3dc6f7f82 100644 (file)
@@ -642,6 +642,7 @@ subst.test \
 subst2.test \
 subst3.test \
 subst4.test \
+subst5.test \
 substref.test \
 substre2.test \
 substtarg.test \
index be3f2a70346062a4b216eb97783064e09f125ad6..f827a46ea897b6347dbe829eca52b24469d77e03 100644 (file)
@@ -876,6 +876,7 @@ subst.test \
 subst2.test \
 subst3.test \
 subst4.test \
+subst5.test \
 substref.test \
 substre2.test \
 substtarg.test \
diff --git a/tests/subst5.test b/tests/subst5.test
new file mode 100755 (executable)
index 0000000..7ffa1ad
--- /dev/null
@@ -0,0 +1,42 @@
+#! /bin/sh
+# Copyright (C) 2009 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 3 of the License, 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/>.
+
+# Complain about configure substitutions in EXTRA_PRIMARY variables.
+# Rationale: we need to know the literal values of, say, PROGRAMS.
+# Thus, we allow substitutions in bin_PROGRAMS, but then EXTRA_PROGRAMS
+# needs to list possible values of that substitution, literally.
+
+. ./defs || Exit 1
+
+set -e
+
+cat >>configure.in <<'END'
+AC_PROG_CC
+AC_SUBST([substed1])
+AC_SUBST([substed2])
+END
+
+cat > Makefile.am <<'END'
+bin_PROGRAMS = @substed1@
+EXTRA_PROGRAMS = @substed2@
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep 'bin_PROGRAMS.*contains configure substitution' stderr && Exit 1
+grep 'EXTRA_PROGRAMS.*contains configure substitution' stderr
+
+Exit 0