pypy/module/pypyjit/test_pypy_c/test_micronumpy.py::TestMicroNumPy::()::test_reduce_logical_and
self = <pypy.module.pypyjit.test_pypy_c.test_micronumpy.TestMicroNumPy object at 0x000001f1bf447520>
def test_reduce_logical_and(self):
def main():
import _numpypy.multiarray as np
import _numpypy.umath as um
arr = np.array([1.0] * 1500)
return um.logical_and.reduce(arr)
> log = self.run(main, [])
pypy\module\pypyjit\test_pypy_c\test_micronumpy.py:206:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pypy.module.pypyjit.test_pypy_c.test_micronumpy.TestMicroNumPy object at 0x000001f1bf447520>
func_or_src = <function main at 0x000001f1c1f7ef20>, args = []
import_site = False, discard_stdout_before_last_line = False
jitopts = {'disable_unrolling': 9999, 'threshold': 200}
src = <py._code.source.Source object at 0x000001f1bf447558>, funcname = 'main'
arglist = ''
f = <closed file 'd:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_reduce_logical_and.py', mode 'w' at 0x000001f1c1f7ef98>
logfile = local('d:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_reduce_logical_and.log')
cmdline = ['d:\\pypy_stuff\\buildbot64\\slave\\pypy-c-jit-win-x86-64\\build\\pypy\\goal\\pypy-c.exe', '-S', '--jit', 'threshold=...disable_unrolling=9999', 'd:\\systemtemp\\pytest\\usession-win-rpython-500\\test-pypy-jit\\test_reduce_logical_and.py']
key = 'disable_unrolling'
def run(self, func_or_src, args=[], import_site=False,
discard_stdout_before_last_line=False, **jitopts):
jitopts.setdefault('threshold', 200)
jitopts.setdefault('disable_unrolling', 9999)
src = py.code.Source(func_or_src)
if isinstance(func_or_src, types.FunctionType):
funcname = func_or_src.func_name
else:
funcname = 'main'
# write the snippet
arglist = ', '.join(map(repr, args))
with self.filepath.open("w") as f:
# we don't want to see the small bridges created
# by the checkinterval reaching the limit
f.write("import sys\n")
f.write("sys.setcheckinterval(10000000)\n")
f.write(str(src) + "\n")
f.write("print %s(%s)\n" % (funcname, arglist))
#
# run a child pypy-c with logging enabled
logfile = self.filepath.new(ext='.log')
#
cmdline = [sys.executable]
if not import_site:
cmdline.append('-S')
if jitopts:
jitcmdline = ['%s=%s' % (key, value)
for key, value in jitopts.items()]
cmdline += ['--jit', ','.join(jitcmdline)]
cmdline.append(str(self.filepath))
#
env = os.environ.copy()
# TODO old logging system
env['PYPYLOG'] = self.log_string + ':' + str(logfile)
jitlogfile = str(logfile) + '.jlog'
env['JITLOG'] = str(jitlogfile)
pipe = subprocess.Popen(cmdline,
env=env,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = pipe.communicate()
if pipe.wait() < 0:
raise IOError("subprocess was killed by signal %d" % (
pipe.returncode,))
if stderr.startswith('SKIP:'):
py.test.skip(stderr)
#if stderr.startswith('debug_alloc.h:'): # lldebug builds
# stderr = ''
#assert not stderr
if stderr:
print '*** stderr of the subprocess: ***'
print stderr
#
if discard_stdout_before_last_line:
stdout = stdout.splitlines(True)[-1]
#
# parse the JIT log
rawlog = logparser.parse_log_file(str(logfile), verbose=False)
rawtraces = logparser.extract_category(rawlog, 'jit-log-opt-')
log = Log(rawtraces)
> log.result = eval(stdout)
E File "<string>", line 0
E
E ^
E SyntaxError: invalid syntax
pypy\module\pypyjit\test_pypy_c\test_00_model.py:88: SyntaxError
---------- Captured stdout call ----------
*** stderr of the subprocess: ***
Traceback (most recent call last):
File "d:\systemtemp\pytest\usession-win-rpython-500\test-pypy-jit\test_reduce_logical_and.py", line 8, in <module>
print main()
File "d:\systemtemp\pytest\usession-win-rpython-500\test-pypy-jit\test_reduce_logical_and.py", line 4, in main
import _numpypy.multiarray as np
ImportError: No module named _numpypy
builder: pypy-c-jit-win-x86-64 build #2372+
test: pypy/module/pypyjit/test_pypy_c/test_micronumpy.py::TestMicroNumPy::()::test_reduce_logical_and