tests: fix a timestamp-related spurious failures
[automake.git] / tests / py-compile-basic2.test
blob0da0d42311ddc3989ad20bd46c66d11c1d099886
1 #! /bin/sh
2 # Copyright (C) 2011 Free Software Foundation, Inc.
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.
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.
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/>.
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'.
21 required=python
22 . ./defs || Exit 1
24 set -e
26 ocwd=`pwd` || Exit 99
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
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
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"
64 for x in $lst; do echo $x.pyc; echo $x.pyo; done | sort > exp
65 find . -name '*.py[co]' | sed 's|^\./||' | sort > got
67 cat exp
68 cat got
69 diff exp got