From: Lisandro Dalcin Date: Fri, 11 Feb 2011 00:59:01 +0000 (-0300) Subject: add --compiler option to runtests.py (mainly for MSVC/MinGW) X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3882708df483847f03366f4925142eda0befe418;p=cython.git add --compiler option to runtests.py (mainly for MSVC/MinGW) --- diff --git a/runtests.py b/runtests.py index acfcb609..7db83be1 100644 --- a/runtests.py +++ b/runtests.py @@ -98,7 +98,7 @@ KEEP_2X_FILES = [ os.path.join('Cython', 'Debugger', 'libpython.py'), ] - +COMPILER = None INCLUDE_DIRS = [ d for d in os.getenv('INCLUDE', '').split(os.pathsep) if d ] CFLAGS = os.getenv('CFLAGS', '').split() @@ -414,6 +414,8 @@ class CythonCompileTestCase(unittest.TestCase): if incdir: build_extension.include_dirs.append(incdir) build_extension.finalize_options() + if COMPILER: + build_extension.compiler = COMPILER ext_include_dirs = [] for match, get_additional_include_dirs in EXT_DEP_INCLUDES: if match(module): @@ -1016,6 +1018,8 @@ def main(): parser.add_option("--no-cython", dest="with_cython", action="store_false", default=True, 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", action="store_false", default=True, help="do not test C compilation") @@ -1199,6 +1203,9 @@ def main(): if sys.platform in ['win32', 'cygwin'] and sys.version_info < (2,6): exclude_selectors += [ lambda x: x == "run.specialfloat" ] + global COMPILER + if options.compiler: + COMPILER = options.compiler languages = [] if options.use_c: languages.append('c')