D6960: run-tests: make coverage work out of tree

Kwan (Ian Moody) phabricator at mercurial-scm.org
Fri Oct 4 17:21:51 UTC 2019


Kwan created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D6960

AFFECTED FILES
  tests/run-tests.py

CHANGE DETAILS

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 @@
                 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)



To: Kwan, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list