#! /bin/sh
-# Copyright (C) 2011-2012 Free Software Foundation, Inc.
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# Test more basic functionalities of the 'py-compile' script,
# with "believable" python sources. See also related test
-# 'py-compile-basic2.test'.
+# 'py-compile-basic2.sh'.
required=python
-. ./defs || Exit 1
+. test-init.sh
cp "$am_scriptdir/py-compile" . \
|| fatal_ "failed to fetch auxiliary script py-compile"
bar = baz = (1, (2,), [3, 4]); zardoz = 0;
END
-cat > bar.py <<'END'
+mkdir sub
+cat > sub/bar.py <<'END'
# Import of non-existent modules, or assertion of false conditions,
# shouldn't cause problems, as it should be enough for the code to
# be syntactically correct.
assert False
END
-./py-compile foo.py bar.py
-test -f foo.pyc
-test -f foo.pyo
-test -f bar.pyc
-test -f bar.pyo
+# An empty file in a more deeply-nested directory should be ok as well.
+mkdir -p 1/_/2/_/3/_
+: > 1/_/2/_/3/_/0.py
+
+./py-compile foo.py sub/bar.py 1/_/2/_/3/_/0.py
+py_installed foo.pyc
+py_installed foo.pyo
+py_installed sub/bar.pyc
+py_installed sub/bar.pyo
+py_installed 1/_/2/_/3/_/0.pyc
+py_installed 1/_/2/_/3/_/0.pyo
: