tests: work around strangeness in MSYS
[automake.git] / tests / python11.test
blob969a461b6c10d8ca40da11c333059224d2f984ff
1 #! /bin/sh
2 # Copyright (C) 2004, 2006, 2008, 2010, 2011 Free Software Foundation,
3 # Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2, or (at your option)
8 # any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Test missing python.
20 # Python is not required for this test.
21 . ./defs || Exit 1
23 cat >>configure.in <<'EOF'
24 m4_define([_AM_PYTHON_INTERPRETER_LIST], [IShouldNotExist1 IShouldNotExist2])
25 AM_PATH_PYTHON
26 # The following be executed only after the first run, once a
27 # third argument has been added to the previous macro.
28 echo PYTHON = $PYTHON
29 test "$PYTHON" = : || exit 1
30 EOF
32 : > Makefile.am
34 $ACLOCAL
35 $AUTOCONF
37 ./configure >stdout 2>stderr && { cat stdout; cat stderr >&2; Exit 1; }
38 cat stdout
39 cat stderr >&2
40 grep 'checking for IShouldNotExist1' stdout
41 grep 'checking for IShouldNotExist2' stdout
42 grep 'no suitable Python interpreter found' stderr
44 sed 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.in >configure.int
45 mv -f configure.int configure.in
46 $ACLOCAL --force
47 $AUTOCONF --force
48 # This one should define PYTHON as ":" and exit successfully.
49 ./configure
51 # Any user setting should be used.
52 ./configure PYTHON=foo >stdout && { cat stdout; Exit 1; }
53 cat stdout
54 grep 'PYTHON = foo' stdout