changeset 43046:e360acfaf210

run-tests: make coverage work out of tree Currently coverage fails when run on an out-of-tree extension since run-tests.py tries to load sitecustomize.py from self._testdir, which is the dir for the extension's tests. Differential Revision: https://phab.mercurial-scm.org/D6960
author Ian Moody <moz-ian@perix.co.uk>
date Fri, 04 Oct 2019 18:18:38 +0100
parents 8c4f32b907e6
children 0f90c2d2d7e8
files tests/run-tests.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Thu Oct 03 13:18:15 2019 -0700
+++ b/tests/run-tests.py	Fri Oct 04 18:18:38 2019 +0100
@@ -3170,7 +3170,7 @@
                 print('WARNING: cannot fix hg.bat reference to python.exe')
 
         if self.options.anycoverage:
-            custom = os.path.join(self._testdir, 'sitecustomize.py')
+            custom = os.path.join(osenvironb[b'RUNTESTDIR'], 'sitecustomize.py')
             target = os.path.join(self._pythondir, 'sitecustomize.py')
             vlog('# Installing coverage trigger to %s' % target)
             shutil.copyfile(custom, target)