def task_database_c(self): translator = self.translator if translator.annotator is not None: translator.frozen = True if self.libdef is not None: cbuilder = self.libdef.getcbuilder(self.translator, self.config) self.standalone = False standalone = False else: standalone = self.standalone if standalone: from pypy.translator.c.genc import CStandaloneBuilder as CBuilder else: from pypy.translator.c.genc import CExtModuleBuilder as CBuilder cbuilder = CBuilder(self.translator, self.entry_point, config=self.config) cbuilder.stackless = self.config.translation.stackless if not standalone: # xxx more messy cbuilder.modulename = self.extmod_name database = cbuilder.build_database() self.log.info("database for generating C source was created") self.cbuilder = cbuilder self.database = database
def _compile_and_run(self, t, entry_point, entry_point_graph, args): from pypy.translator.c.genc import CStandaloneBuilder as CBuilder # XXX patch exceptions cbuilder = CBuilder(t, entry_point, config=t.config) cbuilder.generate_source() exe_name = cbuilder.compile() log('---------- Test starting ----------') stdout = cbuilder.cmdexec(" ".join([str(arg) for arg in args])) res = int(stdout) log('---------- Test done (%d) ----------' % (res, )) return res
def __init__(self, *args, **kwds): self.functions = kwds.pop('functions') self.name = kwds.pop('name') CBuilder.__init__(self, *args, **kwds)