[pypy-svn] r16676 - in pypy/release/0.7.x/pypy/translator: c/test tool
pedronis at codespeak.net
pedronis at codespeak.net
Fri Aug 26 20:08:22 CEST 2005
Author: pedronis
Date: Fri Aug 26 20:08:21 2005
New Revision: 16676
Modified:
pypy/release/0.7.x/pypy/translator/c/test/test_boehm.py
pypy/release/0.7.x/pypy/translator/tool/cbuild.py
Log:
try to skip test_boehm if boehm is not there
Modified: pypy/release/0.7.x/pypy/translator/c/test/test_boehm.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/c/test/test_boehm.py (original)
+++ pypy/release/0.7.x/pypy/translator/c/test/test_boehm.py Fri Aug 26 20:08:21 2005
@@ -50,6 +50,9 @@
def test_boehm():
import py
+ from pypy.translator.tool import cbuild
+ if not cbuild.check_boehm_presence():
+ py.test.skip("no boehm gc on this machine")
gw = py.execnet.PopenGateway()
chan = gw.remote_exec(py.code.Source(test_src))
res = chan.receive()
Modified: pypy/release/0.7.x/pypy/translator/tool/cbuild.py
==============================================================================
--- pypy/release/0.7.x/pypy/translator/tool/cbuild.py (original)
+++ pypy/release/0.7.x/pypy/translator/tool/cbuild.py Fri Aug 26 20:08:21 2005
@@ -261,3 +261,22 @@
extra_preargs=extra_preargs)
return str(outputfilename)
+def check_boehm_presence():
+ from pypy.tool.udir import udir
+ try:
+ cfile = udir.join('check_boehm.c')
+ cfname = str(cfile)
+ cfile = cfile.open('w')
+ cfile.write("""
+#include <gc.h>
+
+int main() {
+ return 0;
+}
+""")
+ cfile.close()
+ build_executable([cfname], libraries=['gc'])
+ except:
+ return False
+ else:
+ return True
More information about the Pypy-commit
mailing list