tests: avoid a spurious failure on MSYS
[platform/upstream/automake.git] / t / pr220.sh
1 #! /bin/sh
2 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
7 # any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 # Test for PR automake/220.
18 # Test for problems when conditionals are not actually defined.
19 # Check that the problems is diagnosed by configure.
20 # This isn't perfect (ideally we'd like an error from autoconf),
21 # but it is the best we can do.  It certainly makes it easier
22 # to debug the problem.
23 # Note that this should be also in the documentation.
24
25 . test-init.sh
26
27 cat > Makefile.am << 'EOF'
28 if NEVER_TRUE
29 NEVER_DEFINED = foo.txt
30 endif
31 data_DATA = $(NEVER_DEFINED)
32 EOF
33
34 cat >> configure.ac << 'EOF'
35 AC_ARG_ENABLE([foo],
36 [  --enable-foo          Enable foo],
37 [ if test "foo" = "bar" ; then
38     AM_CONDITIONAL([NEVER_TRUE], [true])
39   else
40     AM_CONDITIONAL([NEVER_TRUE], [false])
41   fi
42 ])
43 AC_OUTPUT
44 EOF
45
46 mkdir build
47
48 $ACLOCAL
49 $AUTOCONF
50 $AUTOMAKE -a
51
52 cd build
53 # configure should fail since we've done something invalid.
54 ../configure 2>stderr && { cat stderr >&2; exit 1; }
55 cat stderr >&2
56 grep 'conditional.*NEVER_TRUE' stderr
57
58 :