summaryrefslogtreecommitdiff
path: root/tests/python11.test
diff options
context:
space:
mode:
authorAlexandre Duret-Lutz <adl@gnu.org>2004-11-10 20:12:34 +0000
committerAlexandre Duret-Lutz <adl@gnu.org>2004-11-10 20:12:34 +0000
commite4f1de1eb94823053e742b84769de2d580d28af0 (patch)
tree36bbbdffe9478f800d4ed69dbe8110de1f5a0cb8 /tests/python11.test
parent97f03a22c33d904dc08ebd3a3e595327636f3204 (diff)
downloadautomake-e4f1de1eb94823053e742b84769de2d580d28af0.tar.gz
* m4/python.m4 (AM_PATH_PYTHON): Fix the invocation of
AC_PATH_PROGS to correctly define PYTHON as `:' when no interpreter is found (this worked correctly only when a minimal version was passed to AM_PATH_PYTHON). Report from Stepan Kasal. (_AM_PYTHON_INTERPRETER_LIST): Define using m4_define_default, so we can easily override the list from the test suite. * tests/python11.test: New file. * tests/Makefile.am (TESTS): Add python11.test.
Diffstat (limited to 'tests/python11.test')
-rwxr-xr-xtests/python11.test58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/python11.test b/tests/python11.test
new file mode 100755
index 000000000..f88a5aa38
--- /dev/null
+++ b/tests/python11.test
@@ -0,0 +1,58 @@
+#! /bin/sh
+# Copyright (C) 2004 Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake 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.
+#
+# GNU Automake 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 Automake; see the file COPYING. If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test missing python.
+
+# Python is not required for this test.
+. ./defs || exit 1
+
+set -e
+
+cat >>configure.in <<'EOF'
+m4_define([_AM_PYTHON_INTERPRETER_LIST], [IShouldNotExist1 IShouldNotExist2])
+AM_PATH_PYTHON
+# The following be executed only after the first run, once a
+# third argument has been added to the previous macro.
+echo PYTHON = $PYTHON
+test "$PYTHON" = : || exit 1
+EOF
+
+: > Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+
+./configure >stdout 2>stderr && exit 1
+cat stdout
+cat stderr
+grep 'checking for IShouldNotExist1' stdout
+grep 'checking for IShouldNotExist2' stdout
+grep 'no suitable Python interpreter found' stderr
+
+$PERL -pi -e 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.in
+$ACLOCAL
+$AUTOCONF
+# This one should define PYTHON as : and exit succesfully
+./configure
+
+# Any user setting should be used.
+./configure PYTHON=foo >stdout && exit 1
+cat stdout
+grep 'PYTHON = foo' stdout