1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-27 03:21:53 +03:00

Add option for generating coverage data from python tests.

(This used to be commit 43c0fdfff0)
This commit is contained in:
Jelmer Vernooij 2008-09-09 15:55:10 +02:00
parent d613041396
commit faf83916ee

View File

@ -36,6 +36,8 @@ parser.add_option_group(credopts)
sambaopts = options.SambaOptions(parser)
parser.add_option_group(sambaopts)
parser.add_option_group(options.VersionOptions(parser))
parser.add_option("--coverage", metavar="CACHE", type=str,
help="Store coverage data in CACHE")
args = parser.parse_args()[1]
@ -45,4 +47,10 @@ samba.tests.cmdline_credentials = credopts.get_credentials(samba.tests.cmdline_l
param.cvar.default_config = samba.tests.cmdline_loadparm
runner = SubunitTestRunner()
if opts.coverage is not None:
import coverage
coverage.use_cache(True, opts.coverage)
coverage.start()
program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner)
if opts.coverage:
coverage.stop()