def test_compile_module(self):
ffi = FFI()
ffi.cdef("double sin(double x);")
csrc = '/*hi there %s!*/\n#include <math.h>\n' % self
v = Verifier(ffi, csrc, force_generic_engine=self.generic,
libraries=[self.lib_m])
v.compile_module()
assert v.get_module_name().startswith('_cffi_')
if v.generates_python_module():
mod = imp.load_dynamic(v.get_module_name(), v.modulefilename)
assert hasattr(mod, '_cffi_setup')
评论列表
文章目录