# HG changeset patch # User Markus Zapke-Gr?ndemann # Date 1326292711 -3600 # Node ID 7c2190b236cfa90ebf6b43ad8d03d8b12bcfdbb6 # Parent 62b7a0759ee37ea0b6f5d0ac3a8bebdfa89c7fe4 tests: add htmlcov option [ original upstream message ] diff -r 62b7a0759ee3 -r 7c2190b236cf tests/run-tests.py --- a/tests/run-tests.py Thu Jan 12 14:39:02 2012 -0600 +++ b/tests/run-tests.py Wed Jan 11 15:38:31 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 @@ -495,6 +497,9 @@ covrun('-c') 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):