Show More
@@ -37,6 +37,7 b' import time' | |||
|
37 | 37 | SKIPPED_STATUS = 80 |
|
38 | 38 | SKIPPED_PREFIX = 'skipped: ' |
|
39 | 39 | FAILED_PREFIX = 'hghave check failed: ' |
|
40 | PYTHON = sys.executable | |
|
40 | 41 | |
|
41 | 42 | required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"] |
|
42 | 43 | |
@@ -46,8 +47,6 b' defaults = {' | |||
|
46 | 47 | 'port': ('HGTEST_PORT', 20059), |
|
47 | 48 | } |
|
48 | 49 | |
|
49 | python = sys.executable | |
|
50 | ||
|
51 | 50 | def parse_args(): |
|
52 | 51 | parser = optparse.OptionParser("%prog [options] [tests]") |
|
53 | 52 | parser.add_option("-C", "--annotate", action="store_true", |
@@ -204,7 +203,7 b' def use_correct_python():' | |||
|
204 | 203 | shutil.copymode(sys.executable, my_python) |
|
205 | 204 | |
|
206 | 205 | def install_hg(options): |
|
207 |
global |
|
|
206 | global PYTHON | |
|
208 | 207 | vlog("# Performing temporary installation of HG") |
|
209 | 208 | installerrs = os.path.join("tests", "install.err") |
|
210 | 209 | pure = options.pure and "--pure" or "" |
@@ -268,12 +267,12 b' def install_hg(options):' | |||
|
268 | 267 | os.path.join(BINDIR, '_hg.py'))) |
|
269 | 268 | f.close() |
|
270 | 269 | os.chmod(os.path.join(BINDIR, 'hg'), 0700) |
|
271 |
|
|
|
270 | PYTHON = '"%s" "%s" -x' % (sys.executable, | |
|
272 | 271 | os.path.join(TESTDIR,'coverage.py')) |
|
273 | 272 | |
|
274 | 273 | def _hgpath(): |
|
275 | 274 | cmd = '%s -c "import mercurial; print mercurial.__path__[0]"' |
|
276 |
hgpath = os.popen(cmd % |
|
|
275 | hgpath = os.popen(cmd % PYTHON) | |
|
277 | 276 | path = hgpath.read().strip() |
|
278 | 277 | hgpath.close() |
|
279 | 278 | return path |
@@ -389,7 +388,7 b' def run_one(options, test, skips, fails)' | |||
|
389 | 388 | lctest = test.lower() |
|
390 | 389 | |
|
391 | 390 | if lctest.endswith('.py') or firstline == '#!/usr/bin/env python': |
|
392 |
cmd = '%s "%s"' % ( |
|
|
391 | cmd = '%s "%s"' % (PYTHON, testpath) | |
|
393 | 392 | elif lctest.endswith('.bat'): |
|
394 | 393 | # do not run batch scripts on non-windows |
|
395 | 394 | if os.name != 'nt': |
@@ -523,7 +522,7 b' def run_children(options, expecthg, test' | |||
|
523 | 522 | continue |
|
524 | 523 | rfd, wfd = os.pipe() |
|
525 | 524 | childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)] |
|
526 |
cmdline = [ |
|
|
525 | cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job | |
|
527 | 526 | vlog(' '.join(cmdline)) |
|
528 | 527 | fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r') |
|
529 | 528 | os.close(wfd) |
General Comments 0
You need to be logged in to leave comments.
Login now