--- a/tests/run-tests.py Wed Nov 14 13:25:00 2012 +0000
+++ b/tests/run-tests.py Wed Nov 28 23:59:39 2012 +0000
@@ -163,6 +163,8 @@
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 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
@@ -384,12 +389,14 @@
# least on Windows for now, deal with .pydistutils.cfg bugs
# when they happen.
nohome = ''
- cmd = ('%s setup.py %s clean --all'
- ' build --build-base="%s"'
- ' install --force --prefix="%s" --install-lib="%s"'
- ' --install-scripts="%s" %s >%s 2>&1'
- % (sys.executable, pure, os.path.join(HGTMP, "build"),
- INST, PYTHONDIR, BINDIR, nohome, installerrs))
+ cmd = ('%(exe)s setup.py %(pure)s clean --all'
+ ' 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, compiler=compiler,
+ base=os.path.join(HGTMP, "build"),
+ prefix=INST, libdir=PYTHONDIR, bindir=BINDIR,
+ nohome=nohome, logfile=installerrs))
vlog("# Running", cmd)
if os.system(cmd) == 0:
if not options.verbose:
@@ -768,13 +775,18 @@
True -> passed
False -> failed'''
- global results, iolock
+ global results, resultslock, iolock
testpath = os.path.join(TESTDIR, test)
+ def result(l, e):
+ resultslock.acquire()
+ results[l].append(e)
+ resultslock.release()
+
def skip(msg):
if not options.verbose:
- results['s'].append((test, msg))
+ result('s', (test, msg))
else:
iolock.acquire()
print "\nSkipping %s: %s" % (testpath, msg)
@@ -797,15 +809,15 @@
rename(testpath + ".err", testpath)
else:
rename(testpath + ".err", testpath + ".out")
- success(test)
+ result('p', test)
return
- results['f'].append((test, msg))
+ result('f', (test, msg))
def success():
- results['p'].append(test)
+ result('p', test)
def ignore(msg):
- results['i'].append((test, msg))
+ result('i', (test, msg))
if (os.path.basename(test).startswith("test-") and '~' not in test and
('.' not in test or test.endswith('.py') or
@@ -1118,6 +1130,7 @@
sys.exit(failures != 0)
results = dict(p=[], f=[], s=[], i=[])
+resultslock = threading.Lock()
times = []
iolock = threading.Lock()