run-tests.py: use coverage.py with *.py tests
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Sat, 07 Apr 2007 04:27:55 -0300
changeset 4319 8ece1ba156c7
parent 4318 b95a42114616
child 4320 f9b61e0fc929
run-tests.py: use coverage.py with *.py tests
tests/run-tests.py
--- a/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
+++ b/tests/run-tests.py	Sat Apr 07 04:27:55 2007 -0300
@@ -45,6 +45,7 @@
 (options, args) = parser.parse_args()
 verbose = options.verbose
 coverage = options.cover or options.cover_stdlib or options.annotate
+python = sys.executable
 
 def vlog(*msg):
     if verbose:
@@ -115,6 +116,7 @@
         shutil.copymode(sys.executable, my_python)
 
 def install_hg():
+    global python
     vlog("# Performing temporary installation of HG")
     installerrs = os.path.join("tests", "install.err")
 
@@ -154,6 +156,8 @@
             os.path.join(BINDIR, '_hg.py')))
         f.close()
         os.chmod(os.path.join(BINDIR, 'hg'), 0700)
+        python = '"%s" "%s" -x' % (sys.executable,
+                                   os.path.join(TESTDIR,'coverage.py'))
 
 def output_coverage():
     vlog("# Producing coverage report")
@@ -238,7 +242,7 @@
     lctest = test.lower()
 
     if lctest.endswith('.py'):
-        cmd = '%s "%s"' % (sys.executable, os.path.join(TESTDIR, test))
+        cmd = '%s "%s"' % (python, os.path.join(TESTDIR, test))
     elif lctest.endswith('.bat'):
         # do not run batch scripts on non-windows
         if os.name != 'nt':