[pypy-commit] pypy vmprof-newstack: fix tests

arigo pypy.commits at gmail.com
Fri Jan 15 05:58:13 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: vmprof-newstack
Changeset: r81788:bcf38eb09571
Date: 2016-01-15 11:57 +0100
http://bitbucket.org/pypy/pypy/changeset/bcf38eb09571/

Log:	fix tests

diff --git a/rpython/rlib/rvmprof/src/rvmprof.c b/rpython/rlib/rvmprof/src/rvmprof.c
--- a/rpython/rlib/rvmprof/src/rvmprof.c
+++ b/rpython/rlib/rvmprof/src/rvmprof.c
@@ -12,6 +12,8 @@
 #else
 
 #  include "common_header.h"
+#  include "structdef.h"
+#  include "src/threadlocal.h"
 #  include "rvmprof.h"
 /*#  ifndef VMPROF_ADDR_OF_TRAMPOLINE
 #   error "RPython program using rvmprof, but not calling vmprof_execute_code()"
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
@@ -126,12 +126,18 @@
  * *************************************************************
  */
 
-#include "src/threadlocal.h"
 
+#ifndef RPYTHON_LL2CTYPES
 static vmprof_stack_t *get_vmprof_stack(void)
 {
     return RPY_THREADLOCALREF_GET(vmprof_tl_stack);
 }
+#else
+static vmprof_stack_t *get_vmprof_stack(void)
+{
+    return 0;
+}
+#endif
 
 static int get_stack_trace(intptr_t *result, int max_depth, intptr_t pc, ucontext_t *ucontext)
 {
diff --git a/rpython/rlib/rvmprof/src/vmprof_stack.h b/rpython/rlib/rvmprof/src/vmprof_stack.h
--- a/rpython/rlib/rvmprof/src/vmprof_stack.h
+++ b/rpython/rlib/rvmprof/src/vmprof_stack.h
@@ -1,3 +1,5 @@
+#ifndef _VMPROF_STACK_H_
+#define _VMPROF_STACK_H_
 
 #include <unistd.h>
 
@@ -19,3 +21,5 @@
 // to worry too much. There is a potential for squeezing it with bit
 // patterns into one WORD, but I don't want to care RIGHT NOW, potential
 // for future optimization potential
+
+#endif
diff --git a/rpython/rlib/rvmprof/test/test_ztranslation.py b/rpython/rlib/rvmprof/test/test_ztranslation.py
--- a/rpython/rlib/rvmprof/test/test_ztranslation.py
+++ b/rpython/rlib/rvmprof/test/test_ztranslation.py
@@ -64,8 +64,14 @@
 def test_interpreted():
     # takes forever if the Python process is already big...
     import subprocess
-    subprocess.check_call([sys.executable, os.path.basename(__file__)],
-                          cwd=(os.path.dirname(__file__) or '.'))
+    me = os.path.basename(__file__)
+    if me.endswith('pyc') or me.endswith('pyo'):
+        me = me[:-1]
+    env = os.environ.copy()
+    env['PYTHONPATH'] = ''
+    subprocess.check_call([sys.executable, me],
+                          cwd=(os.path.dirname(__file__) or '.'),
+                          env=env)
 
 def test_compiled():
     fn = compile(main, [], gcpolicy="minimark")


More information about the pypy-commit mailing list