[pypy-svn] r17037 - pypy/dist/pypy/translator/llvm/test

ericvrp at codespeak.net ericvrp at codespeak.net
Mon Aug 29 14:30:51 CEST 2005


Author: ericvrp
Date: Mon Aug 29 14:30:50 2005
New Revision: 17037

Modified:
   pypy/dist/pypy/translator/llvm/test/runtest.py
   pypy/dist/pypy/translator/llvm/test/test_lltype.py
Log:
added test for minimum llvm version (1.6(cvs) at the moment)


Modified: pypy/dist/pypy/translator/llvm/test/runtest.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/test/runtest.py	(original)
+++ pypy/dist/pypy/translator/llvm/test/runtest.py	Mon Aug 29 14:30:50 2005
@@ -2,6 +2,7 @@
 from pypy.translator.llvm.genllvm import compile_module
 
 optimize_tests = False
+MINIMUM_LLVM_VERSION = 1.6
 
 def llvm_is_on_path():
     try:
@@ -10,16 +11,31 @@
         return False 
     return True
 
+def llvm_version():
+    import os
+    v = os.popen('llvm-as -version 2>&1').readline()
+    v = ''.join([c for c in v if c.isdigit()])
+    v = int(v) / 10.0
+    return v
+
 def compile_function(function, annotation, **kwds):
     if not llvm_is_on_path():
         py.test.skip("llvm not found")
-        
+
+    v = llvm_version()
+    if v < MINIMUM_LLVM_VERSION:
+        py.test.skip("llvm version not up-to-date (found %.1f, should be >= %.1f)" % (v, MINIMUM_LLVM_VERSION))
+
     mod = compile_module(function, annotation, optimize=optimize_tests, **kwds)
     return getattr(mod, 'pypy_' + function.func_name + "_wrapper")
 
 def compile_module_function(function, annotation, **kwds):
     if not llvm_is_on_path():
         py.test.skip("llvm not found")
+
+    v, minimum = llvm_version(), 1.6
+    if v < minimum:
+        py.test.skip("llvm version not up-to-date (found %.1f, should be >= %.1f)" % (v, minimum))
         
     mod = compile_module(function, annotation, **kwds)
     f = getattr(mod, 'pypy_' + function.func_name + "_wrapper")

Modified: pypy/dist/pypy/translator/llvm/test/test_lltype.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/test/test_lltype.py	(original)
+++ pypy/dist/pypy/translator/llvm/test/test_lltype.py	Mon Aug 29 14:30:50 2005
@@ -236,6 +236,5 @@
         res += floats.f4 > 1e200
         res += floats.f5 == nan
         return res
-    
     f = compile_function(floats_fn, [])
     assert f() == floats_fn()



More information about the Pypy-commit mailing list