Commit 3882708d authored by Lisandro Dalcin's avatar Lisandro Dalcin

add --compiler option to runtests.py (mainly for MSVC/MinGW)

parent e5778e20
...@@ -98,7 +98,7 @@ KEEP_2X_FILES = [ ...@@ -98,7 +98,7 @@ KEEP_2X_FILES = [
os.path.join('Cython', 'Debugger', 'libpython.py'), os.path.join('Cython', 'Debugger', 'libpython.py'),
] ]
COMPILER = None
INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ]
CFLAGS = os.getenv('CFLAGS', '').split() CFLAGS = os.getenv('CFLAGS', '').split()
...@@ -414,6 +414,8 @@ class CythonCompileTestCase(unittest.TestCase): ...@@ -414,6 +414,8 @@ class CythonCompileTestCase(unittest.TestCase):
if incdir: if incdir:
build_extension.include_dirs.append(incdir) build_extension.include_dirs.append(incdir)
build_extension.finalize_options() build_extension.finalize_options()
if COMPILER:
build_extension.compiler = COMPILER
ext_include_dirs = [] ext_include_dirs = []
for match, get_additional_include_dirs in EXT_DEP_INCLUDES: for match, get_additional_include_dirs in EXT_DEP_INCLUDES:
if match(module): if match(module):
...@@ -1016,6 +1018,8 @@ def main(): ...@@ -1016,6 +1018,8 @@ def main():
parser.add_option("--no-cython", dest="with_cython", parser.add_option("--no-cython", dest="with_cython",
action="store_false", default=True, action="store_false", default=True,
help="do not run the Cython compiler, only the C compiler") help="do not run the Cython compiler, only the C compiler")
parser.add_option("--compiler", dest="compiler", default=None,
help="C compiler type")
parser.add_option("--no-c", dest="use_c", parser.add_option("--no-c", dest="use_c",
action="store_false", default=True, action="store_false", default=True,
help="do not test C compilation") help="do not test C compilation")
...@@ -1199,6 +1203,9 @@ def main(): ...@@ -1199,6 +1203,9 @@ def main():
if sys.platform in ['win32', 'cygwin'] and sys.version_info < (2,6): if sys.platform in ['win32', 'cygwin'] and sys.version_info < (2,6):
exclude_selectors += [ lambda x: x == "run.specialfloat" ] exclude_selectors += [ lambda x: x == "run.specialfloat" ]
global COMPILER
if options.compiler:
COMPILER = options.compiler
languages = [] languages = []
if options.use_c: if options.use_c:
languages.append('c') languages.append('c')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment