Author: fijal
Branch: 
Changeset: r82082:a56a14e631f0
Date: 2016-02-05 10:46 +0100
http://bitbucket.org/pypy/pypy/changeset/a56a14e631f0/

Log:    run actually tests and make them pass

diff --git a/pypy/module/_vmprof/test/test__vmprof.py 
b/pypy/module/_vmprof/test/test__vmprof.py
--- a/pypy/module/_vmprof/test/test__vmprof.py
+++ b/pypy/module/_vmprof/test/test__vmprof.py
@@ -23,7 +23,7 @@
             i += 5 * WORD # header
             assert s[i    ] == '\x05'    # MARKER_HEADER
             assert s[i + 1] == '\x00'    # 0
-            assert s[i + 2] == '\x01'    # VERSION_THREAD_ID
+            assert s[i + 2] == '\x02'    # VERSION_THREAD_ID
             assert s[i + 3] == chr(4)    # len('pypy')
             assert s[i + 4: i + 8] == 'pypy'
             i += 8
diff --git a/pypy/module/_vmprof/test/test_direct.py 
b/pypy/module/_vmprof/test/test_direct.py
--- a/pypy/module/_vmprof/test/test_direct.py
+++ b/pypy/module/_vmprof/test/test_direct.py
@@ -19,6 +19,7 @@
 
 lib = ffi.verify("""
 #define PYPY_JIT_CODEMAP
+#include "vmprof_stack.h"
 
 volatile int pypy_codemap_currently_invalid = 0;
 
@@ -42,7 +43,7 @@
 }
 
 
-""" + open(str(srcdir.join("vmprof_get_custom_offset.h"))).read())
+""" + open(str(srcdir.join("vmprof_get_custom_offset.h"))).read(), 
include_dirs=[str(srcdir)])
 
 class TestDirect(object):
     def test_infrastructure(self):
@@ -67,8 +68,5 @@
         buf = ffi.new("long[10]", [0] * 10)
         result = ffi.cast("void**", buf)
         res = lib.vmprof_write_header_for_jit_addr(result, 0, ffi.NULL, 100)
-        assert res == 6
-        assert buf[0] == 2
-        assert buf[1] == 16
-        assert buf[2] == 12
-        assert buf[3] == 8
+        assert res == 10
+        assert [x for x in buf] == [6, 0, 3, 16, 3, 12, 3, 8, 3, 4
diff --git a/rpython/rlib/rvmprof/cintf.py b/rpython/rlib/rvmprof/cintf.py
--- a/rpython/rlib/rvmprof/cintf.py
+++ b/rpython/rlib/rvmprof/cintf.py
@@ -21,7 +21,7 @@
     _libs = []
 eci_kwds = dict(
     include_dirs = [SRC],
-    includes = ['rvmprof.h'],
+    includes = ['rvmprof.h', 'vmprof_stack.h'],
     libraries = _libs,
     separate_module_files = [SRC.join('rvmprof.c')],
     post_include_bits=['#define RPYTHON_VMPROF\n'],
@@ -30,10 +30,6 @@
 
 
 def setup():
-    if not detect_cpu.autodetect().startswith(detect_cpu.MODEL_X86_64):
-        raise VMProfPlatformUnsupported("rvmprof only supports"
-                                        " x86-64 CPUs for now")
-
     platform.verify_eci(ExternalCompilationInfo(
         compile_extra=['-DRPYTHON_LL2CTYPES'],
         **eci_kwds))
diff --git a/rpython/rlib/rvmprof/src/vmprof_main.h 
b/rpython/rlib/rvmprof/src/vmprof_main.h
--- a/rpython/rlib/rvmprof/src/vmprof_main.h
+++ b/rpython/rlib/rvmprof/src/vmprof_main.h
@@ -32,9 +32,9 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include "vmprof_stack.h"
 #include "vmprof_getpc.h"
 #include "vmprof_mt.h"
-#include "vmprof_stack.h"
 #include "vmprof_common.h"
 
 /************************************************************/
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to