python11.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #! /bin/sh
  2. # Copyright (C) 2004-2017 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. # Test missing python.
  17. # Python is not required for this test.
  18. . test-init.sh
  19. # We don't want to allow user overrides in this test.
  20. unset PYTHON
  21. cat >>configure.ac <<'EOF'
  22. m4_define([_AM_PYTHON_INTERPRETER_LIST], [IShouldNotExist1 IShouldNotExist2])
  23. AM_PATH_PYTHON
  24. # The following be executed only after the first run, once a
  25. # third argument has been added to the previous macro.
  26. echo PYTHON = $PYTHON
  27. test "$PYTHON" = : || exit 1
  28. EOF
  29. : > Makefile.am
  30. $ACLOCAL
  31. $AUTOCONF
  32. ./configure >stdout 2>stderr && { cat stdout; cat stderr >&2; exit 1; }
  33. cat stdout
  34. cat stderr >&2
  35. grep 'checking for IShouldNotExist1' stdout
  36. grep 'checking for IShouldNotExist2' stdout
  37. grep 'no suitable Python interpreter found' stderr
  38. sed 's/AM_PATH_PYTHON/AM_PATH_PYTHON(,,:)/' configure.ac >configure.tmp
  39. mv -f configure.tmp configure.ac
  40. $ACLOCAL --force
  41. $AUTOCONF --force
  42. # This one should define PYTHON as ":" and exit successfully.
  43. ./configure
  44. # Any user setting should be used.
  45. ./configure PYTHON=foo >stdout && { cat stdout; exit 1; }
  46. cat stdout
  47. grep 'PYTHON = foo' stdout
  48. :