changeset 8096:a110d7a20f3f

run-tests: upper-case global PYTHON variable
author Martin Geisler <mg@lazybytes.net>
date Tue, 21 Apr 2009 10:53:42 +0200
parents f5428d4ffd97
children eea3c1a8fba8
files tests/run-tests.py
diffstat 1 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Mon Apr 20 21:50:11 2009 -0400
+++ b/tests/run-tests.py	Tue Apr 21 10:53:42 2009 +0200
@@ -37,6 +37,7 @@
 SKIPPED_STATUS = 80
 SKIPPED_PREFIX = 'skipped: '
 FAILED_PREFIX  = 'hghave check failed: '
+PYTHON = sys.executable
 
 required_tools = ["python", "diff", "grep", "unzip", "gunzip", "bunzip2", "sed"]
 
@@ -46,8 +47,6 @@
     'port': ('HGTEST_PORT', 20059),
 }
 
-python = sys.executable
-
 def parse_args():
     parser = optparse.OptionParser("%prog [options] [tests]")
     parser.add_option("-C", "--annotate", action="store_true",
@@ -204,7 +203,7 @@
         shutil.copymode(sys.executable, my_python)
 
 def install_hg(options):
-    global python
+    global PYTHON
     vlog("# Performing temporary installation of HG")
     installerrs = os.path.join("tests", "install.err")
     pure = options.pure and "--pure" or ""
@@ -268,12 +267,12 @@
                  os.path.join(BINDIR, '_hg.py')))
         f.close()
         os.chmod(os.path.join(BINDIR, 'hg'), 0700)
-        python = '"%s" "%s" -x' % (sys.executable,
+        PYTHON = '"%s" "%s" -x' % (sys.executable,
                                    os.path.join(TESTDIR,'coverage.py'))
 
 def _hgpath():
     cmd = '%s -c "import mercurial; print mercurial.__path__[0]"'
-    hgpath = os.popen(cmd % python)
+    hgpath = os.popen(cmd % PYTHON)
     path = hgpath.read().strip()
     hgpath.close()
     return path
@@ -389,7 +388,7 @@
     lctest = test.lower()
 
     if lctest.endswith('.py') or firstline == '#!/usr/bin/env python':
-        cmd = '%s "%s"' % (python, testpath)
+        cmd = '%s "%s"' % (PYTHON, testpath)
     elif lctest.endswith('.bat'):
         # do not run batch scripts on non-windows
         if os.name != 'nt':
@@ -523,7 +522,7 @@
             continue
         rfd, wfd = os.pipe()
         childopts = ['--child=%d' % wfd, '--port=%d' % (options.port + j * 3)]
-        cmdline = [python, sys.argv[0]] + opts + childopts + job
+        cmdline = [PYTHON, sys.argv[0]] + opts + childopts + job
         vlog(' '.join(cmdline))
         fps[os.spawnvp(os.P_NOWAIT, cmdline[0], cmdline)] = os.fdopen(rfd, 'r')
         os.close(wfd)