[pypy-svn] pypy default: add the possibility to return a value

antocuni commits-noreply at bitbucket.org
Tue Feb 22 17:41:32 CET 2011


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: 
Changeset: r42213:19438e0d8289
Date: 2011-02-22 17:25 +0100
http://bitbucket.org/pypy/pypy/changeset/19438e0d8289/

Log:	add the possibility to return a value

diff --git a/pypy/module/pypyjit/test_pypy_c/test_model.py b/pypy/module/pypyjit/test_pypy_c/test_model.py
--- a/pypy/module/pypyjit/test_pypy_c/test_model.py
+++ b/pypy/module/pypyjit/test_pypy_c/test_model.py
@@ -22,7 +22,7 @@
         # write the snippet
         with self.filepath.open("w") as f:
             f.write(str(py.code.Source(func)) + "\n")
-            f.write("%s()\n" % func.func_name)
+            f.write("print %s()\n" % func.func_name)
         #
         # run a child pypy-c with logging enabled
         logfile = self.filepath.new(ext='.log')
@@ -43,6 +43,7 @@
         rawlog = logparser.parse_log_file(str(logfile))
         rawtraces = logparser.extract_category(rawlog, 'jit-log-opt-')
         log = Log(func, rawtraces)
+        log.result = eval(stdout)
         return log
 
 
@@ -84,6 +85,7 @@
             return i
         #
         log = self.run(f)
+        assert log.result == 1003
         loops = log.loops_by_filename(self.filepath)
         assert len(loops) == 1
         assert loops[0].filename == self.filepath


More information about the Pypy-commit mailing list