[pypy-svn] r45635 - pypy/dist/pypy/lang/test

fijal at codespeak.net fijal at codespeak.net
Mon Aug 13 18:33:33 CEST 2007


Author: fijal
Date: Mon Aug 13 18:33:33 2007
New Revision: 45635

Added:
   pypy/dist/pypy/lang/test/
   pypy/dist/pypy/lang/test/__init__.py   (contents, props changed)
   pypy/dist/pypy/lang/test/test_translation.py   (contents, props changed)
Log:
Introduce tests whether frontend build or not, useful for checking.


Added: pypy/dist/pypy/lang/test/__init__.py
==============================================================================

Added: pypy/dist/pypy/lang/test/test_translation.py
==============================================================================
--- (empty file)
+++ pypy/dist/pypy/lang/test/test_translation.py	Mon Aug 13 18:33:33 2007
@@ -0,0 +1,33 @@
+
+""" Tests whether each interpreter translates itself
+"""
+
+#def base_translation_test(targetname):
+
+import sys, py
+from pypy.translator import driver
+from pypy.translator import translator
+from pypy.config.translationoption import get_combined_translation_config
+from pypy.translator.goal.translate import load_target
+
+class TestTranslation:
+    def translate(self, targetname):
+        config = get_combined_translation_config(translating=True)
+        config.translation.backend = 'c'
+        targetspec = 'pypy.translator.goal.' + targetname
+        mod = __import__(targetspec)
+        targetspec_dic = sys.modules[targetspec].__dict__
+        t = translator.TranslationContext()
+        drv = driver.TranslationDriver.from_targetspec(targetspec_dic, config, [],
+                                                       empty_translator=t)
+        drv.proceed('compile')
+
+    def test_scheme(self):
+        py.test.skip("Doesn't work and this is a known issue")
+        self.translate('targetscheme')
+
+    def test_js(self):
+        self.translate('targetjsstandalone')
+
+    def test_prolog(self):
+        self.translate('targetprologstandalone')



More information about the Pypy-commit mailing list