comparison tests/run-tests.py @ 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 f059d6ffcdf0
children 5c9c71cde1c9
comparison
equal deleted inserted replaced
43045:8c4f32b907e6 43046:e360acfaf210
3168 f.write(data) 3168 f.write(data)
3169 else: 3169 else:
3170 print('WARNING: cannot fix hg.bat reference to python.exe') 3170 print('WARNING: cannot fix hg.bat reference to python.exe')
3171 3171
3172 if self.options.anycoverage: 3172 if self.options.anycoverage:
3173 custom = os.path.join(self._testdir, 'sitecustomize.py') 3173 custom = os.path.join(osenvironb[b'RUNTESTDIR'], 'sitecustomize.py')
3174 target = os.path.join(self._pythondir, 'sitecustomize.py') 3174 target = os.path.join(self._pythondir, 'sitecustomize.py')
3175 vlog('# Installing coverage trigger to %s' % target) 3175 vlog('# Installing coverage trigger to %s' % target)
3176 shutil.copyfile(custom, target) 3176 shutil.copyfile(custom, target)
3177 rc = os.path.join(self._testdir, '.coveragerc') 3177 rc = os.path.join(self._testdir, '.coveragerc')
3178 vlog('# Installing coverage rc to %s' % rc) 3178 vlog('# Installing coverage rc to %s' % rc)