Show More
@@ -1951,8 +1951,14 b' class TestRunner(object):' | |||
|
1951 | 1951 | rc = os.path.join(self._testdir, '.coveragerc') |
|
1952 | 1952 | vlog('# Installing coverage rc to %s' % rc) |
|
1953 | 1953 | os.environ['COVERAGE_PROCESS_START'] = rc |
|
1954 |
|
|
|
1955 | os.environ['COVERAGE_FILE'] = fn | |
|
1954 | covdir = os.path.join(self._installdir, '..', 'coverage') | |
|
1955 | try: | |
|
1956 | os.mkdir(covdir) | |
|
1957 | except OSError, e: | |
|
1958 | if e.errno != errno.EEXIST: | |
|
1959 | raise | |
|
1960 | ||
|
1961 | os.environ['COVERAGE_DIR'] = covdir | |
|
1956 | 1962 | |
|
1957 | 1963 | def _checkhglib(self, verb): |
|
1958 | 1964 | """Ensure that the 'mercurial' package imported by python is |
@@ -1991,9 +1997,9 b' class TestRunner(object):' | |||
|
1991 | 1997 | # chdir is the easiest way to get short, relative paths in the |
|
1992 | 1998 | # output. |
|
1993 | 1999 | os.chdir(self._pythondir) |
|
1994 | covdir = os.path.join(self._installdir, '..') | |
|
1995 |
cov = coverage(data_file=os.path.join(covdir, ' |
|
|
1996 |
cov. |
|
|
2000 | covdir = os.path.join(self._installdir, '..', 'coverage') | |
|
2001 | cov = coverage(data_file=os.path.join(covdir, 'cov')) | |
|
2002 | cov.combine() | |
|
1997 | 2003 | |
|
1998 | 2004 | omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]] |
|
1999 | 2005 | cov.report(ignore_errors=True, omit=omit) |
@@ -1,5 +1,16 b'' | |||
|
1 | import os | |
|
2 | ||
|
3 | if os.environ.get('COVERAGE_PROCESS_START'): | |
|
1 | 4 | try: |
|
2 | 5 | import coverage |
|
3 | getattr(coverage, 'process_startup', lambda: None)() | |
|
6 | import random | |
|
7 | ||
|
8 | # uuid is better, but not available in Python 2.4. | |
|
9 | covpath = os.path.join(os.environ['COVERAGE_DIR'], | |
|
10 | 'cov.%s' % random.randrange(0, 1000000000000)) | |
|
11 | cov = coverage.coverage(data_file=covpath, auto_data=True) | |
|
12 | cov._warn_no_data = False | |
|
13 | cov._warn_unimported_source = False | |
|
14 | cov.start() | |
|
4 | 15 | except ImportError: |
|
5 | 16 | pass |
General Comments 0
You need to be logged in to leave comments.
Login now