translator/c/test/test_newgc.py::TestMiniMarkGC::()::test_framework_static_roots
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???
else:
split_criteria_big = SPLIT_CRITERIA * 4
#
# All declarations
#
with self.write_on_included_file(f, 'structdef.h') as fi:
gen_structdef(fi, self.database)
with self.write_on_included_file(f, 'forwarddecl.h') as fi:
gen_forwarddecl(fi, self.database)
with self.write_on_included_file(f, 'preimpl.h') as fi:
gen_preimpl(fi, self.database)
#
# Implementation of functions and global structures and arrays
#
print(file=f)
print('/***********************************************************/', file=f)
print('/*** Implementations ***/', file=f)
print(file=f)
print('#define PYPY_FILE_NAME "%s"' % os.path.basename(f.name), file=f)
print('#include "src/g_include.h"', file=f)
if self.database.reverse_debugger:
print('#include "revdb_def.h"', file=f)
print(file=f)
nextralines = 11 + 1
for name, nodeiter in self.splitnodesimpl('nonfuncnodes.c',
self.othernodes,
nextralines, 1):
with self.write_on_maybe_separate_source(f, name) as fc:
if fc is not f:
print('/***********************************************************/', file=fc)
print('/*** Non-function Implementations ***/', file=fc)
print(file=fc)
print('#include "singleheader.h"', file=fc)
print('#include "src/g_include.h"', file=fc)
print(file=fc)
print(MARKER, file=fc)
for node, impl in nodeiter:
print('\n'.join(impl), file=fc)
print(MARKER, file=fc)
print('/***********************************************************/', file=fc)
nextralines = 12
for name, nodeiter in self.splitnodesimpl('implement.c',
self.funcnodes,
nextralines, 1,
split_criteria_big):
with self.write_on_maybe_separate_source(f, name) as fc:
if fc is not f:
print('/***********************************************************/', file=fc)
print('/*** Implementations ***/', file=fc)
print(file=fc)
print('#include "singleheader.h"', file=fc)
print('#define PYPY_FILE_NAME "%s"' % name, file=fc)
print('#include "src/g_include.h"', file=fc)
if self.database.reverse_debugger:
print('#include "revdb_def.h"', file=fc)
print(file=fc)
print(MARKER, file=fc)
for node, impl in nodeiter:
> print('\n'.join(impl), file=fc)
E IOError: [Errno 28] No space left on device: '/tmp/pytest/usession-main-3871/testing_1/rpython_rlib.c'
translator/c/genc.py:720: IOError
builder: rpython-linux-aarch64 build #572+
test: translator/c/test/test_newgc.py::TestMiniMarkGC::()::test_framework_static_roots