# HG changeset patch # User Christian Ebert # Date 1326934248 -3600 # Node ID 15aa105f81e282899666853ad3f9f1ea8437d2a6 # Parent 1321f8629e893f3c59b747cd4be0248009153d85# Parent 7c2190b236cfa90ebf6b43ad8d03d8b12bcfdbb6 Merge with stable diff -r 1321f8629e89 -r 15aa105f81e2 tests/run-tests.py --- a/tests/run-tests.py Fri Dec 09 00:10:00 2011 +0100 +++ b/tests/run-tests.py Thu Jan 19 01:50:48 2012 +0100 @@ -141,6 +141,8 @@ " rather than capturing and diff'ing it (disables timeout)") parser.add_option("-f", "--first", action="store_true", help="exit on the first test failure") + parser.add_option("-H", "--htmlcov", action="store_true", + help="create an HTML report of the coverage of the files") parser.add_option("--inotify", action="store_true", help="enable inotify extension when running tests") parser.add_option("-i", "--interactive", action="store_true", @@ -211,7 +213,7 @@ % hgbin) options.with_hg = hgbin - options.anycoverage = options.cover or options.annotate + options.anycoverage = options.cover or options.annotate or options.htmlcov if options.anycoverage: try: import coverage @@ -493,8 +495,11 @@ return covrun('-c') - omit = ','.join([BINDIR, TESTDIR]) + omit = ','.join(os.path.join(x, '*') for x in [BINDIR, TESTDIR]) covrun('-i', '-r', '"--omit=%s"' % omit) # report + if options.htmlcov: + htmldir = os.path.join(TESTDIR, 'htmlcov') + covrun('-i', '-b', '"--directory=%s"' % htmldir, '"--omit=%s"' % omit) if options.annotate: adir = os.path.join(TESTDIR, 'annotated') if not os.path.isdir(adir):