summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-11-23 22:19:43 +0000
committerZac Medico <zmedico@gentoo.org>2009-11-23 22:19:43 +0000
commitdea8fc2a93f59ca0191313d3f807a4726e58d3e3 (patch)
tree8547c3fbd9a3cbe437d23abd84e502584699e856
parentBug #293614 - When the backtracking limit is reached and there is a SLOT (diff)
downloadportage-multirepo-dea8fc2a93f59ca0191313d3f807a4726e58d3e3.tar.gz
portage-multirepo-dea8fc2a93f59ca0191313d3f807a4726e58d3e3.tar.bz2
portage-multirepo-dea8fc2a93f59ca0191313d3f807a4726e58d3e3.zip
Add a test case which simply compiles all modules, useful for testing syntax
compatibility with the current version of python. svn path=/main/trunk/; revision=14876
-rw-r--r--pym/portage/tests/lint/__init__.py0
-rw-r--r--pym/portage/tests/lint/__test__0
-rw-r--r--pym/portage/tests/lint/test_compile_modules.py23
3 files changed, 23 insertions, 0 deletions
diff --git a/pym/portage/tests/lint/__init__.py b/pym/portage/tests/lint/__init__.py
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/pym/portage/tests/lint/__init__.py
diff --git a/pym/portage/tests/lint/__test__ b/pym/portage/tests/lint/__test__
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/pym/portage/tests/lint/__test__
diff --git a/pym/portage/tests/lint/test_compile_modules.py b/pym/portage/tests/lint/test_compile_modules.py
new file mode 100644
index 00000000..da039f4d
--- /dev/null
+++ b/pym/portage/tests/lint/test_compile_modules.py
@@ -0,0 +1,23 @@
+# Copyright 2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+from portage.const import PORTAGE_PYM_PATH
+from portage.tests import TestCase
+from portage import os
+from portage import _encodings
+from portage import _unicode_decode
+
+import py_compile
+
+class CompileModulesTestCase(TestCase):
+
+ def testCompileModules(self):
+ for parent, dirs, files in os.walk(PORTAGE_PYM_PATH):
+ parent = _unicode_decode(parent,
+ encoding=_encodings['fs'], errors='strict')
+ for x in files:
+ x = _unicode_decode(x,
+ encoding=_encodings['fs'], errors='strict')
+ if x[-3:] == '.py':
+ py_compile.compile(os.path.join(parent, x), doraise=True)