7 # XXX This file is really stupid!! Just a 5-minute effort on my part...
9 if not os
.path
.exists('.temp'):
11 for i
in ['pythonc.py', 'syntax.py', 'transform.py', 'backend.cpp', 'alloc.h']:
12 shutil
.copy(i
, '.temp')
14 for i
in os
.listdir('tests'):
16 shutil
.copy('tests/%s' % i
, '.temp/test.py')
18 out_p
= subprocess
.check_output('./pythonc.py -q test.py', cwd
='.temp', shell
=True)
20 out_c
= subprocess
.check_output('python3 test.py', cwd
='.temp', shell
=True)
23 raise RuntimeError('%s mismatched!\nPythonc:\n%s\nCPython:\n%s' % (i
,
24 out_p
.decode(), out_c
.decode()))
27 # XXX timing should factor out translation time
28 print('%s: pythonc=%ss cpython=%ss (%.3fx)' % (i
, time_p
, time_c
, time_p
/ time_c
))