def test_struct_included():
baseffi = FFI()
baseffi.cdef("struct foo_s { int x; };")
baseffi.set_source('test_struct_included_base', None)
#
ffi = FFI()
ffi.include(baseffi)
target = udir.join('test_struct_included.py')
make_py_source(ffi, 'test_struct_included', str(target))
assert target.read() == r"""# auto-generated file
import _cffi_backend
from test_struct_included_base import ffi as _ffi0
ffi = _cffi_backend.FFI('test_struct_included',
_version = 0x2601,
_types = b'\x00\x00\x00\x09',
_struct_unions = ((b'\x00\x00\x00\x00\x00\x00\x00\x08foo_s',),),
_includes = (_ffi0,),
)
"""
评论列表
文章目录