Example #1
0
 def test_modulename(self):
     ffi = FFI()
     ffi.cdef("/* %s test_modulename */ double test1foo(double x);" % self)
     csrc = "double test1foo(double x) { return x - 63.0; }"
     modname = 'xxtest_modulenamexx%d' % (self.generic,)
     lib = ffi.verify(csrc, force_generic_engine=self.generic,
                      modulename=modname)
     assert lib.test1foo(143) == 80.0
     suffix = _get_so_suffixes()[0]
     fn1 = os.path.join(ffi.verifier.tmpdir, modname + '.c')
     fn2 = os.path.join(ffi.verifier.tmpdir, modname + suffix)
     assert ffi.verifier.sourcefilename == fn1
     assert ffi.verifier.modulefilename == fn2
Example #2
0
 def test_modulename(self):
     ffi = FFI()
     ffi.cdef("/* %s test_modulename */ double test1foo(double x);" % self)
     csrc = "double test1foo(double x) { return x - 63.0; }"
     modname = 'xxtest_modulenamexx%d' % (self.generic,)
     lib = ffi.verify(csrc, force_generic_engine=self.generic,
                      modulename=modname)
     assert lib.test1foo(143) == 80.0
     suffix = _get_so_suffixes()[0]
     fn1 = os.path.join(ffi.verifier.tmpdir, modname + '.c')
     fn2 = os.path.join(ffi.verifier.tmpdir, modname + suffix)
     assert ffi.verifier.sourcefilename == fn1
     assert ffi.verifier.modulefilename == fn2