[pypy-commit] pypy default: Add a test for the correct #pragma in pyconfig.h

arigo noreply at buildbot.pypy.org
Mon Oct 19 03:38:21 EDT 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r80330:fcfc28ee7164
Date: 2015-10-19 09:38 +0200
http://bitbucket.org/pypy/pypy/changeset/fcfc28ee7164/

Log:	Add a test for the correct #pragma in pyconfig.h

diff --git a/pypy/module/cpyext/test/test_version.py b/pypy/module/cpyext/test/test_version.py
--- a/pypy/module/cpyext/test/test_version.py
+++ b/pypy/module/cpyext/test/test_version.py
@@ -1,6 +1,16 @@
+import py
 from pypy.module.cpyext.test.test_cpyext import AppTestCpythonExtensionBase
 
 
+def test_pragma_version():
+    from pypy.module.sys.version import PYPY_VERSION
+    rootdir = py.path.local(__file__).join('..', '..')
+    pyconfig_h = rootdir.join('include', 'pyconfig.h')
+    version = '%d%d' % (PYPY_VERSION[0], PYPY_VERSION[1])
+    pragma = 'pragma comment(lib,"python%s.lib")' % version
+    assert pragma in pyconfig_h.read()
+
+
 class AppTestVersion(AppTestCpythonExtensionBase):
 
     def test_versions(self):


More information about the pypy-commit mailing list