[pypy-svn] r34094 - in pypy/dist/pypy/jit/codegen/llvm: . test

ericvrp at codespeak.net ericvrp at codespeak.net
Fri Nov 3 13:32:53 CET 2006


Author: ericvrp
Date: Fri Nov  3 13:32:51 2006
New Revision: 34094

Modified:
   pypy/dist/pypy/jit/codegen/llvm/llvmjit.py
   pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py
Log:
made sure that importint llvmjit causes the c-library to be updated.



Modified: pypy/dist/pypy/jit/codegen/llvm/llvmjit.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/llvmjit.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/llvmjit.py	Fri Nov  3 13:32:51 2006
@@ -13,6 +13,23 @@
 import os
 
 path = os.path.join(os.path.dirname(__file__), 'libllvmjit.so')
+
+curdir = os.getcwd()
+os.chdir(os.path.dirname(__file__))
+
+#With py.test --session=R the master server rsyncs the .so library too!?!
+#So we always need to recompile the library if its platform (output of file libllvmjit.so)
+#differs from the current (remote) platform.
+#note: we can't do this in global scope because that will only be executed on the master server.
+#os.system('rm -rf libllvmjit.so build')
+
+#We might want to generate an up-to-date version of the library always so running (tests)
+#on a clean checkout will produce correct results.
+os.system('python setup.py build_ext -i')
+
+os.chdir(curdir)
+
+#load the actual library
 llvmjit = cdll.LoadLibrary(os.path.abspath(path))
 class _FuncPtr(_CFuncPtr):
     _flags_ = _FUNCFLAG_CDECL

Modified: pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py
==============================================================================
--- pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py	(original)
+++ pypy/dist/pypy/jit/codegen/llvm/test/test_llvmjit.py	Fri Nov  3 13:32:51 2006
@@ -3,10 +3,12 @@
 from os.path import dirname, join
 from pypy.translator.c.test.test_genc import compile
 
+from pypy.jit.codegen.llvm import llvmjit
+
 try:
     from pypy.jit.codegen.llvm import llvmjit
 except OSError:
-    py.test.skip("libllvmjit not found (see ../README.TXT)")
+    py.test.skip("can not load libllvmjit library (see ../README.TXT)")
 
 #helper data
 curdir = dirname(__file__)



More information about the Pypy-commit mailing list