add --compiler option to runtests.py (mainly for MSVC/MinGW)
authorLisandro Dalcin <dalcinl@gmail.com>
Fri, 11 Feb 2011 00:59:01 +0000 (21:59 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Fri, 11 Feb 2011 00:59:01 +0000 (21:59 -0300)
runtests.py

index acfcb609385a656cae1731061f5ddbe24fc4526c..7db83be15abe5320eeed989ccfb96a344bb89ecf 100644 (file)
@@ -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')