tests: cosmetic changes in t/extra-sources.sh
[platform/upstream/automake.git] / t / python2.sh
1 #! /bin/sh
2 # Copyright (C) 2002-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 # Make sure that Automake suggests using AM_PATH_PYTHON.
18
19 . test-init.sh
20
21 $ACLOCAL
22
23 echo 1. pythondir not defined
24
25 cat > Makefile.am <<'END'
26 PYTHON = x
27 python_PYTHON = foo.py
28 END
29
30 AUTOMAKE_fails -a
31 grep 'pythondir.*undefined' stderr
32 grep AM_PATH_PYTHON stderr
33
34
35 echo 2. pkgpythondir not defined
36
37 cat > Makefile.am <<'END'
38 PYTHON = x
39 pkgpython_PYTHON = foo.py
40 END
41
42 AUTOMAKE_fails -a
43 grep 'pkgpythondir.*undefined' stderr
44 grep AM_PATH_PYTHON stderr
45
46
47 echo 3. pyexecdir not defined
48
49 cat > Makefile.am <<'END'
50 PYTHON = x
51 pyexec_PYTHON = foo.py
52 END
53
54 AUTOMAKE_fails -a
55 grep 'pyexecdir.*undefined' stderr
56 grep AM_PATH_PYTHON stderr
57
58
59 echo 4. pkgpyexecdir not defined
60
61 cat > Makefile.am <<'END'
62 PYTHON = x
63 pkgpyexec_PYTHON = foo.py
64 END
65
66 AUTOMAKE_fails -a
67 grep 'pkgpyexecdir.*undefined' stderr
68 grep AM_PATH_PYTHON stderr
69
70
71 echo 5. PYTHON not defined.
72
73 cat > Makefile.am <<'END'
74 pkgpyexecdir = /here/we/go
75 pkgpyexec_PYTHON = foo.py
76 END
77
78 AUTOMAKE_fails -a
79 grep 'PYTHON.*undefined' stderr
80 grep AM_PATH_PYTHON stderr
81
82
83 echo 6. Ok.
84
85 cat > Makefile.am <<'END'
86 PYTHON = x
87 pkgpyexecdir = /here/we/go
88 pkgpyexec_PYTHON = foo.py
89 END
90
91 rm -f py-compile
92 $AUTOMAKE -a
93 test -f py-compile
94
95
96 echo 7. Ok again.
97
98 cat > Makefile.am <<'END'
99 PYTHON = x
100 fubardir = /here/we/go
101 fubar_PYTHON = foo.py
102 END
103
104 $AUTOMAKE -a
105
106 :