##// END OF EJS Templates
run-tests: report code coverage from source directory...
Gregory Szorc -
r24506:60bbb407 default
parent child Browse files
Show More
@@ -260,6 +260,10 b' def parseargs(args, parser):'
260 260 parser.error("sorry, coverage options do not work when --local "
261 261 "is specified")
262 262
263 if options.anycoverage and options.with_hg:
264 parser.error("sorry, coverage options do not work when --with-hg "
265 "is specified")
266
263 267 global verbose
264 268 if options.verbose:
265 269 verbose = ''
@@ -1567,6 +1571,7 b' class TestRunner(object):'
1567 1571
1568 1572 def __init__(self):
1569 1573 self.options = None
1574 self._hgroot = None
1570 1575 self._testdir = None
1571 1576 self._hgtmp = None
1572 1577 self._installdir = None
@@ -1872,6 +1877,7 b' class TestRunner(object):'
1872 1877 # Run installer in hg root
1873 1878 script = os.path.realpath(sys.argv[0])
1874 1879 hgroot = os.path.dirname(os.path.dirname(script))
1880 self._hgroot = hgroot
1875 1881 os.chdir(hgroot)
1876 1882 nohome = '--home=""'
1877 1883 if os.name == 'nt':
@@ -1996,9 +2002,13 b' class TestRunner(object):'
1996 2002 vlog('# Producing coverage report')
1997 2003 # chdir is the easiest way to get short, relative paths in the
1998 2004 # output.
1999 os.chdir(self._pythondir)
2005 os.chdir(self._hgroot)
2000 2006 covdir = os.path.join(self._installdir, '..', 'coverage')
2001 2007 cov = coverage(data_file=os.path.join(covdir, 'cov'))
2008
2009 # Map install directory paths back to source directory.
2010 cov.config.paths['srcdir'] = ['.', self._pythondir]
2011
2002 2012 cov.combine()
2003 2013
2004 2014 omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]]
General Comments 0
You need to be logged in to leave comments. Login now