# HG changeset patch # User Ian Moody # Date 2019-10-04 17:18:38 # Node ID e360acfaf210625e552cd3b4a14c169947898a3c # Parent 8c4f32b907e6bea3cf1ac9870eef90601d7c5294 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 diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -3170,7 +3170,7 @@ class TestRunner(object): 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)