Show More
@@ -3514,21 +3514,23 class TestRunner(object): | |||
|
3514 | 3514 | print('WARNING: cannot fix hg.bat reference to python.exe') |
|
3515 | 3515 | |
|
3516 | 3516 | if self.options.anycoverage: |
|
3517 | custom = os.path.join(osenvironb[b'RUNTESTDIR'], 'sitecustomize.py') | |
|
3518 | target = os.path.join(self._pythondir, 'sitecustomize.py') | |
|
3517 | custom = os.path.join( | |
|
3518 | osenvironb[b'RUNTESTDIR'], b'sitecustomize.py' | |
|
3519 | ) | |
|
3520 | target = os.path.join(self._pythondir, b'sitecustomize.py') | |
|
3519 | 3521 | vlog('# Installing coverage trigger to %s' % target) |
|
3520 | 3522 | shutil.copyfile(custom, target) |
|
3521 | rc = os.path.join(self._testdir, '.coveragerc') | |
|
3523 | rc = os.path.join(self._testdir, b'.coveragerc') | |
|
3522 | 3524 | vlog('# Installing coverage rc to %s' % rc) |
|
3523 |
os |
|
|
3524 | covdir = os.path.join(self._installdir, '..', 'coverage') | |
|
3525 | osenvironb[b'COVERAGE_PROCESS_START'] = rc | |
|
3526 | covdir = os.path.join(self._installdir, b'..', b'coverage') | |
|
3525 | 3527 | try: |
|
3526 | 3528 | os.mkdir(covdir) |
|
3527 | 3529 | except OSError as e: |
|
3528 | 3530 | if e.errno != errno.EEXIST: |
|
3529 | 3531 | raise |
|
3530 | 3532 | |
|
3531 |
os |
|
|
3533 | osenvironb[b'COVERAGE_DIR'] = covdir | |
|
3532 | 3534 | |
|
3533 | 3535 | def _checkhglib(self, verb): |
|
3534 | 3536 | """Ensure that the 'mercurial' package imported by python is |
@@ -3602,22 +3604,25 class TestRunner(object): | |||
|
3602 | 3604 | # chdir is the easiest way to get short, relative paths in the |
|
3603 | 3605 | # output. |
|
3604 | 3606 | os.chdir(self._hgroot) |
|
3605 | covdir = os.path.join(self._installdir, '..', 'coverage') | |
|
3607 | covdir = os.path.join(_strpath(self._installdir), '..', 'coverage') | |
|
3606 | 3608 | cov = coverage(data_file=os.path.join(covdir, 'cov')) |
|
3607 | 3609 | |
|
3608 | 3610 | # Map install directory paths back to source directory. |
|
3609 | cov.config.paths['srcdir'] = ['.', self._pythondir] | |
|
3611 | cov.config.paths['srcdir'] = ['.', _strpath(self._pythondir)] | |
|
3610 | 3612 | |
|
3611 | 3613 | cov.combine() |
|
3612 | 3614 | |
|
3613 | omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]] | |
|
3615 | omit = [ | |
|
3616 | _strpath(os.path.join(x, b'*')) | |
|
3617 | for x in [self._bindir, self._testdir] | |
|
3618 | ] | |
|
3614 | 3619 | cov.report(ignore_errors=True, omit=omit) |
|
3615 | 3620 | |
|
3616 | 3621 | if self.options.htmlcov: |
|
3617 | htmldir = os.path.join(self._outputdir, 'htmlcov') | |
|
3622 | htmldir = os.path.join(_strpath(self._outputdir), 'htmlcov') | |
|
3618 | 3623 | cov.html_report(directory=htmldir, omit=omit) |
|
3619 | 3624 | if self.options.annotate: |
|
3620 | adir = os.path.join(self._outputdir, 'annotated') | |
|
3625 | adir = os.path.join(_strpath(self._outputdir), 'annotated') | |
|
3621 | 3626 | if not os.path.isdir(adir): |
|
3622 | 3627 | os.mkdir(adir) |
|
3623 | 3628 | cov.annotate(directory=adir, omit=omit) |
General Comments 0
You need to be logged in to leave comments.
Login now