1. Pypy
  2. Untitled project
  3. pypy

Commits

Armin Rigo  committed 4036e41

when running compliance tests on top of pypy-c, put more
information in the generated reports.

  • Participants
  • Parent commits 957aede
  • Branches default

Comments (0)

Files changed (1)

File lib-python/conftest.py

View file
  • Ignore whitespace
         # "unknown" for them
         return 'unknown'  
 
+def getexecutable(_cache={}):
+    execpath = pypydir.join('bin', 'pypy-c')
+    if not _cache:
+        text = execpath.sysexec('-c', 
+            'import sys; print sys.version; print sys.pypy_translation_info')
+        lines = text.split('\n')
+        assert len(lines) == 3 and lines[2] == ''
+        assert lines[1].startswith('{') and lines[1].endswith('}')
+        info = eval(lines[1])
+        info['version'] = lines[0]
+        _cache.update(info)
+    return execpath, _cache
+
 class RunFileExternal(py.test.collect.Module): 
     def __init__(self, name, parent, regrtest): 
         super(RunFileExternal, self).__init__(name, parent) 
         
         TIMEOUT = gettimeout()
         if option.use_compiled:
-            python = pypydir.join('bin', 'pypy-c')
+            execpath, info = getexecutable()
             cmd = "%s %s %s %s" %(
-                python, 
+                execpath, 
                 regrrun, regrrun_verbosity, fspath.purebasename)
             print cmd
         else:
         result = Result()
         fspath = regrtest.getfspath() 
         result['fspath'] = str(fspath) 
+        result['pypy-revision'] = getrev(pypydir) 
         if option.use_compiled:
-            #Please fix this, breaks the report table
-            result['pypy-revision'] = '%s compiled' % getrev(pypydir)
-        else: 
-            result['pypy-revision'] = getrev(pypydir) 
+            execpath, info = getexecutable()
+            result['executable'] = execpath.basename
+            for key, value in info.items():
+                result['executable-%s' % key] = str(value)
+        else:
+            result['executable'] = 'py.py'
         result['options'] = regrtest.getoptions() 
         result['timeout'] = gettimeout()
         result['startdate'] = time.ctime()