translator/c/test/test_newgc.py::TestMiniMarkGC::()::test_framework_nongc_static_root
cls = <class 'rpython.translator.c.test.test_newgc.TestMiniMarkGC'>
def setup_class(cls):
funcs0 = []
funcs1 = []
funcsstr = []
name_to_func = {}
for fullname in dir(cls):
if not fullname.startswith('define'):
continue
keyword = option.keyword
if keyword.startswith('test_') and not keyword.endswith(':'):
keyword = keyword[len('test_'):]
if keyword not in fullname:
continue
prefix, name = fullname.split('_', 1)
definefunc = getattr(cls, fullname)
func = definefunc.im_func(cls)
func.__name__ = 'f_' + name
if prefix == 'definestr':
funcsstr.append(func)
funcs0.append(None)
funcs1.append(None)
else:
numargs = len(inspect.getargspec(func)[0])
funcsstr.append(None)
if numargs == 0:
funcs0.append(func)
funcs1.append(None)
else:
assert numargs == 1
funcs0.append(None)
funcs1.append(func)
assert name not in name_to_func
name_to_func[name] = len(name_to_func)
assert name_to_func
def allfuncs(name, arg):
num = name_to_func[name]
func0 = funcs0[num]
if func0:
return str(func0())
func1 = funcs1[num]
if func1:
return str(func1(arg))
funcstr = funcsstr[num]
if funcstr:
return funcstr(arg)
assert 0, 'unreachable'
cls.funcsstr = funcsstr
> cls.c_allfuncs = staticmethod(cls._makefunc_str_int(allfuncs))
translator/c/test/test_newgc.py:117:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
translator/c/test/test_newgc.py:58: in _makefunc_str_int
exename = t.compile()
translator/interactive.py:117: in compile
getattr(self.driver, 'compile_' + backend)()
translator/driver.py:108: in proc
return self.proceed(backend_goal)
translator/driver.py:569: in proceed
result = self._execute(goals, task_skip = self._maybe_skip())
translator/tool/taskengine.py:114: in _execute
res = self._do(goal, taskcallable, *args, **kwds)
translator/driver.py:278: in _do
res = func()
translator/driver.py:455: in task_source_c
exe_name=exe_name)
translator/c/genc.py:214: in generate_source
self.eci, defines=defines, split=self.split)
translator/c/genc.py:879: in gen_source
sg.gen_readable_parts_of_source(f)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <rpython.translator.c.genc.SourceGenerator instance at 0x000000003c9dba20>
f = <open file '/tmp/pytest/usession-main-3871/testing_1/testing_1.c', mode 'w' at 0x0000000039935920>
def gen_readable_parts_of_source(self, f):
split_criteria_big = SPLIT_CRITERIA
if py.std.sys.platform != "win32":
if self.database.gcpolicy.need_no_typeptr():
pass # XXX gcc uses toooooons of memory??? (somefailed=True in translator/c/test/test_newgc.py)
builder: rpython-linux-aarch64 build #572+
test: translator/c/test/test_newgc.py::TestMiniMarkGC::()::test_framework_nongc_static_root