Merge branch 'msvc' into maint
[platform/upstream/automake.git] / tests / py-compile-basic2.test
1 #! /bin/sh
2 # Copyright (C) 2011 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 more basic functionalities of the `py-compile' script, with
18 # dummy python sources, but more complex directory layouts.  See also
19 # related test `py-compile-basic.test'.
20
21 required=python
22 . ./defs || Exit 1
23
24 set -e
25
26 ocwd=`pwd` || Exit 99
27
28 pyfiles="
29   foo.py
30   ./foo1.py
31   ../foo2.py
32   ../dir/foo3.py
33   $ocwd/foo4.py
34   sub/bar.py
35   sub/subsub/barbar.py
36   __init__.py
37   sub/__init__.py
38   1.py
39   .././_.py
40 "
41
42 lst='
43   dir/foo
44   dir/foo1
45   foo2
46   dir/foo3
47   foo4
48   dir/sub/bar
49   dir/sub/subsub/barbar
50   dir/__init__
51   dir/sub/__init__
52   dir/1
53   _
54 '
55
56 mkdir dir
57 cd dir
58 cp "$testsrcdir/../lib/py-compile" .
59 mkdir sub sub/subsub
60 touch $pyfiles
61 ./py-compile $pyfiles
62 cd "$ocwd"
63
64 for x in $lst; do echo $x.pyc; echo $x.pyo; done | sort > exp
65 find . -name '*.py[co]' | sed 's|^\./||' | sort > got
66
67 cat exp
68 cat got
69 diff exp got
70
71 :