# HG changeset patch # User Christian Ebert # Date 1354147179 0 # Node ID ca46d3dccb19eccbf8b841301476c46ca31aec02 # Parent 0928d50a0abef37cc6fe718a969aabe12599c1c5# Parent d38c648869bbdafe8437c3a330170262561dda52 Merge with stable diff -r 0928d50a0abe -r ca46d3dccb19 tests/run-tests.py --- 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()