parser.add_option("--cython-only", dest="cython_only",
action="store_true", default=False,
help="only compile pyx to c, do not run C compiler or run the tests")
- parser.add_option("--refnanny", dest="with_refnanny",
- action="store_true", default=False,
- help="also test that Cython-generated code does correct reference counting")
+ parser.add_option("--no-refnanny", dest="with_refnanny",
+ action="store_false", default=True,
+ help="do not regression test reference counting")
parser.add_option("--sys-pyregr", dest="system_pyregr",
action="store_true", default=False,
help="run the regression tests of the CPython installation")
if options.with_refnanny:
from pyximport.pyxbuild import pyx_to_dll
- import ctypes
libpath = pyx_to_dll(os.path.join("Cython", "Runtime", "refnanny.pyx"),
build_in_temp=True,
pyxbuild_dir=os.path.join(WORKDIR, "support"))
- ctypes.PyDLL(libpath, mode=ctypes.RTLD_GLOBAL)
- sys.path.append(os.path.split(libpath)[0])
- import refnanny
- del sys.path[-1]
+ sys.path.insert(0, os.path.split(libpath)[0])
CFLAGS.append("-DCYTHON_REFNANNY")
test_bugs = False
sys.stderr.write(" %s\n" % test)
if options.with_refnanny:
+ import refnanny
sys.stderr.write("\n".join([repr(x) for x in refnanny.reflog]))