[PATCH 2 of 2] run-tests: add a --compiler option

Bryan O'Sullivan bos at serpentine.com
Wed Nov 21 00:57:43 UTC 2012


# HG changeset patch
# User Bryan O'Sullivan <bryano at fb.com>
# Date 1353459415 28800
# Node ID 2394ff8634fa15527af2e0808546d57eef502d86
# Parent  334cba8db54f424075b33670ec668cba4fbeda01
run-tests: add a --compiler option

Without this option, it is not possible to run the test suite on Windows
using mingw's gcc as the compiler.

diff --git a/tests/run-tests.py b/tests/run-tests.py
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -163,6 +163,8 @@ def parseargs():
     parser.add_option("-p", "--port", type="int",
         help="port on which servers should listen"
              " (default: $%s or %d)" % defaults['port'])
+    parser.add_option("--compiler", type="string",
+        help="compiler to build with")
     parser.add_option("--pure", action="store_true",
         help="use pure Python code instead of C extensions")
     parser.add_option("-R", "--restart", action="store_true",
@@ -371,6 +373,9 @@ def usecorrectpython():
 def installhg(options):
     vlog("# Performing temporary installation of HG")
     installerrs = os.path.join("tests", "install.err")
+    compiler = ''
+    if options.compiler:
+        compiler = '--compiler ' + options.compiler
     pure = options.pure and "--pure" or ""
 
     # Run installer in hg root
@@ -385,10 +390,10 @@ def installhg(options):
         # when they happen.
         nohome = ''
     cmd = ('%(exe)s setup.py %(pure)s clean --all'
-           ' build --build-base="%(base)s"'
+           ' build %(compiler)s --build-base="%(base)s"'
            ' install --force --prefix="%(prefix)s" --install-lib="%(libdir)s"'
            ' --install-scripts="%(bindir)s" %(nohome)s >%(logfile)s 2>&1'
-           % dict(exe=sys.executable, pure=pure, 
+           % dict(exe=sys.executable, pure=pure, compiler=compiler,
                   base=os.path.join(HGTMP, "build"),
                   prefix=INST, libdir=PYTHONDIR, bindir=BINDIR, 
                   nohome=nohome, logfile=installerrs))



More information about the Mercurial-devel mailing list