[pypy-commit] pypy default: fix test_exportstruct

bdkearns noreply at buildbot.pypy.org
Mon Feb 25 10:52:44 CET 2013


Author: Brian Kearns <bdkearns at gmail.com>
Branch: 
Changeset: r61750:ee3db3dcb005
Date: 2013-02-25 04:52 -0500
http://bitbucket.org/pypy/pypy/changeset/ee3db3dcb005/

Log:	fix test_exportstruct

diff --git a/rpython/translator/c/test/test_genc.py b/rpython/translator/c/test/test_genc.py
--- a/rpython/translator/c/test/test_genc.py
+++ b/rpython/translator/c/test/test_genc.py
@@ -483,12 +483,16 @@
     assert hasattr(ctypes.CDLL(str(t.driver.c_entryp)), 'foobar')
 
 def test_exportstruct():
+    from rpython.translator.tool.cbuild import ExternalCompilationInfo
     from rpython.rlib.exports import export_struct
     def f():
         return 42
     FOO = Struct("FOO", ("field1", Signed))
     foo = malloc(FOO, flavor="raw")
     foo.field1 = 43
+    # maybe export_struct should add the struct name to eci automatically?
+    # https://bugs.pypy.org/issue1361
+    foo._obj._compilation_info = ExternalCompilationInfo(export_symbols=['BarStruct'])
     export_struct("BarStruct", foo._obj)
     t = Translation(f, [], backend="c")
     t.annotate()


More information about the pypy-commit mailing list