[pypy-commit] cffi cffi-1.0: test fixes
arigo
noreply at buildbot.pypy.org
Sat May 2 11:26:29 CEST 2015
Author: Armin Rigo <arigo at tunes.org>
Branch: cffi-1.0
Changeset: r1901:a21ecd9803c3
Date: 2015-05-02 11:27 +0200
http://bitbucket.org/cffi/cffi/changeset/a21ecd9803c3/
Log: test fixes
diff --git a/_cffi1/test_parse_c_type.py b/_cffi1/test_parse_c_type.py
--- a/_cffi1/test_parse_c_type.py
+++ b/_cffi1/test_parse_c_type.py
@@ -2,10 +2,12 @@
import cffi
from . import cffi_opcode
+local_dir = os.path.dirname(__file__)
+
r_macro = re.compile(r"#define \w+[(][^\n]*|#include [^\n]*")
r_define = re.compile(r"(#define \w+) [^\n]*")
r_ifdefs = re.compile(r"(#ifdef |#endif)[^\n]*")
-header = open('parse_c_type.h').read()
+header = open(os.path.join(local_dir, 'parse_c_type.h')).read()
header = r_macro.sub(r"", header)
header = r_define.sub(r"\1 ...", header)
header = r_ifdefs.sub(r"", header)
@@ -13,8 +15,8 @@
ffi = cffi.FFI()
ffi.cdef(header)
-lib = ffi.verify(open('parse_c_type.c').read(),
- include_dirs=[os.getcwd()])
+lib = ffi.verify(open(os.path.join(local_dir, 'parse_c_type.c')).read(),
+ include_dirs=[local_dir])
class ParseError(Exception):
pass
diff --git a/c/test_c.py b/c/test_c.py
--- a/c/test_c.py
+++ b/c/test_c.py
@@ -3342,4 +3342,4 @@
def test_version():
# this test is here mostly for PyPy
- assert __version__ == "0.9.2"
+ assert __version__ == "1.0.0"
More information about the pypy-commit
mailing list