changeset 4319:8ece1ba156c7

run-tests.py: use coverage.py with *.py tests
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 07 Apr 2007 04:27:55 -0300
parents b95a42114616
children f9b61e0fc929
files tests/run-tests.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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':