Trying to debug testing infra

This commit is contained in:
Elmom 2010-09-29 20:27:53 +03:00
parent e539c44b74
commit 15812d48dd

View file

@ -8,7 +8,7 @@ temppath = py.test.ensuretemp('MCAD')
def pytest_generate_tests(metafunc): def pytest_generate_tests(metafunc):
if "modpath" in metafunc.funcargnames: if "modpath" in metafunc.funcargnames:
for fpath, modnames in collect_test_modules().items(): for fpath, modnames in collect_test_modules().items():
os.system("cp %s %s/" % (fpath, temppath)) #os.system("cp %s %s/" % (fpath, temppath))
if "modname" in metafunc.funcargnames: if "modname" in metafunc.funcargnames:
for modname in modnames: for modname in modnames:
metafunc.addcall(funcargs=dict(modname=modname, modpath=fpath)) metafunc.addcall(funcargs=dict(modname=modname, modpath=fpath))
@ -21,12 +21,14 @@ def test_module_compile(modname, modpath):
fpath = temppath.join(tempname) fpath = temppath.join(tempname)
stlpath = temppath.join(tempname + ".stl") stlpath = temppath.join(tempname + ".stl")
f = fpath.open('w') f = fpath.open('w')
f.write(""" code = """
//generated testfile //generated testfile
use <%s> use <%s>
%s(); %s();
""" % (modpath, modname)) """ % (modpath, modname)
print code
f.write(code)
f.flush f.flush
output = call_openscad(path=fpath, stlpath=stlpath, timeout=5) output = call_openscad(path=fpath, stlpath=stlpath, timeout=5)
print output print output