Commits

Konstantin Lopuhin  committed a4a0613

start integration test of jitlogparser on actual pypy run

  • Participants
  • Parent commits 0c8e562
  • Branches bridge-logging

Comments (0)

Files changed (1)

File pypy/tool/jitlogparser/test/test_parser.py

+import re
+import os.path
+import tempfile
+import subprocess
+
 from pypy.tool.jitlogparser.parser import (SimpleParser, TraceForOpcode,
                                            Function, adjust_bridges,
                                            import_log, split_trace, Op,
 from pypy.tool.jitlogparser.storage import LoopStorage
 import py, sys
 from rpython.jit.backend.detect_cpu import autodetect_main_model
+from rpython.tool.logparser import extract_category
+
 
 def parse(input, **kwds):
     return SimpleParser.parse_from_input(input, **kwds)
     f = Function.from_operations(loop.operations, LoopStorage())
     assert len(f.chunks) == 2
     
+def test_import_log_on_pypy():
+    ''' Test import_log and parse_log_counts on a log from actual pypy run
+    '''
+    log_filename = tempfile.mktemp()
+    pypy = '/Users/kostia/programming/pypy/pypy-c' # FIXME
+    subprocess.check_call([pypy, 
+        os.path.join(os.path.dirname(__file__), 'y.py')],
+        env={'PYPYLOG': 'jit-log-opt,jit-backend:%s' % log_filename})
+    log, loops = import_log(log_filename)
+    parse_log_counts(extract_category(log, 'jit-backend-count'), loops)
+    for loop in loops:
+        loop.force_asm()
+        if re.search("file '.*lib-python.*'", loop.comment):
+            # do not care for _optimize_charset or _mk_bitmap
+            continue
+        else:
+            import pdb; pdb.set_trace()
+