##// 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 parser.error("sorry, coverage options do not work when --local "
260 parser.error("sorry, coverage options do not work when --local "
261 "is specified")
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 global verbose
267 global verbose
264 if options.verbose:
268 if options.verbose:
265 verbose = ''
269 verbose = ''
@@ -1567,6 +1571,7 b' class TestRunner(object):'
1567
1571
1568 def __init__(self):
1572 def __init__(self):
1569 self.options = None
1573 self.options = None
1574 self._hgroot = None
1570 self._testdir = None
1575 self._testdir = None
1571 self._hgtmp = None
1576 self._hgtmp = None
1572 self._installdir = None
1577 self._installdir = None
@@ -1872,6 +1877,7 b' class TestRunner(object):'
1872 # Run installer in hg root
1877 # Run installer in hg root
1873 script = os.path.realpath(sys.argv[0])
1878 script = os.path.realpath(sys.argv[0])
1874 hgroot = os.path.dirname(os.path.dirname(script))
1879 hgroot = os.path.dirname(os.path.dirname(script))
1880 self._hgroot = hgroot
1875 os.chdir(hgroot)
1881 os.chdir(hgroot)
1876 nohome = '--home=""'
1882 nohome = '--home=""'
1877 if os.name == 'nt':
1883 if os.name == 'nt':
@@ -1996,9 +2002,13 b' class TestRunner(object):'
1996 vlog('# Producing coverage report')
2002 vlog('# Producing coverage report')
1997 # chdir is the easiest way to get short, relative paths in the
2003 # chdir is the easiest way to get short, relative paths in the
1998 # output.
2004 # output.
1999 os.chdir(self._pythondir)
2005 os.chdir(self._hgroot)
2000 covdir = os.path.join(self._installdir, '..', 'coverage')
2006 covdir = os.path.join(self._installdir, '..', 'coverage')
2001 cov = coverage(data_file=os.path.join(covdir, 'cov'))
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 cov.combine()
2012 cov.combine()
2003
2013
2004 omit = [os.path.join(x, '*') for x in [self._bindir, self._testdir]]
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