]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Coverage for conditional `else' and `endif' arguments.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Nov 2009 20:52:34 +0000 (21:52 +0100)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 14 Nov 2009 20:52:34 +0000 (21:52 +0100)
* tests/cond46.test: New test.
* tests/Makefile.am: Update.

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

index de8d22efb0e344e75bba37eef0dd7db23cf38014..9b514838b2929d6c689516d97347f6b3231ba779 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-14  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Coverage for conditional `else' and `endif' arguments.
+       * tests/cond46.test: New test.
+       * tests/Makefile.am: Update.
+
 2009-10-18  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        Simplify Variable::_check_ambiguous_condition.
index 98829c9ac3c90fdf2c07531b3708d61655a78c96..6d42996cfd308e2e82f25e6e50263d785f2638b3 100644 (file)
@@ -187,6 +187,7 @@ cond42.test \
 cond43.test \
 cond44.test \
 cond45.test \
+cond46.test \
 condd.test \
 condhook.test \
 condinc.test \
index d12b8504d436e64b4aa5085eba9d636049369f44..7ac0b620e25b122fd2280cdfc1f9de5f0e71ff60 100644 (file)
@@ -421,6 +421,7 @@ cond42.test \
 cond43.test \
 cond44.test \
 cond45.test \
+cond46.test \
 condd.test \
 condhook.test \
 condinc.test \
diff --git a/tests/cond46.test b/tests/cond46.test
new file mode 100755 (executable)
index 0000000..73b6e94
--- /dev/null
@@ -0,0 +1,110 @@
+#! /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/>.
+
+# Ensure the right condition is listed after `else' and `endif'.
+
+. ./defs || Exit 1
+
+cat >> configure.in << 'END'
+AM_CONDITIONAL([USE_A],[test x = y])
+AM_CONDITIONAL([USE_B],[test x = z])
+AC_OUTPUT
+END
+
+$ACLOCAL
+
+cat > Makefile.am << 'END'
+if USE_A
+endif !USE_A
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+endif USE_B
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else
+endif USE_A
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else
+endif !USE_A
+END
+
+$AUTOMAKE
+
+cat > Makefile.am << 'END'
+if USE_A
+if USE_B
+else
+endif !USE_A
+endif
+END
+
+AUTOMAKE_fails
+grep 'endif.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else USE_A
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else USE_B
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+if USE_B
+else USE_A
+endif
+endif
+END
+
+AUTOMAKE_fails
+grep 'else.*incompatible with current conditional' stderr
+
+cat > Makefile.am << 'END'
+if USE_A
+else !USE_A
+endif
+END
+
+$AUTOMAKE
+
+Exit 0