[pypy-svn] r22538 - pypy/dist/pypy/rpython/l3interp/test

mwh at codespeak.net mwh at codespeak.net
Mon Jan 23 18:07:05 CET 2006


Author: mwh
Date: Mon Jan 23 18:07:03 2006
New Revision: 22538

Modified:
   pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py
Log:
(arre, mwh)
use isolate and boehm in the translated l3interp tests.


Modified: pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py
==============================================================================
--- pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py	(original)
+++ pypy/dist/pypy/rpython/l3interp/test/test_l3interp.py	Mon Jan 23 18:07:03 2006
@@ -5,7 +5,15 @@
 from pypy.translator.translator import TranslationContext
 from pypy.annotation import policy
 
+def setup_module(mod):
+    mod._cleanups = []
+
+def teardown_module(mod):
+    while mod._cleanups:
+        mod._cleanups.pop()()
+
 def translate(func, inputargs):
+    from pypy.translator.c.gc import BoehmGcPolicy
     t = TranslationContext()
     pol = policy.AnnotatorPolicy()
     pol.allow_someobjects = False
@@ -14,10 +22,11 @@
 
     from pypy.translator.tool.cbuild import skip_missing_compiler
     from pypy.translator.c import genc
-    builder = genc.CExtModuleBuilder(t, func)
+    builder = genc.CExtModuleBuilder(t, func, gcpolicy=BoehmGcPolicy)
     builder.generate_source()
     skip_missing_compiler(builder.compile)
-    builder.import_module()
+    builder.isolated_import()
+    _cleanups.append(builder.cleanup)
     return builder.get_entry_point()
 
 



More information about the Pypy-commit mailing list