summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-09-09 15:55:10 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-09-09 15:55:10 +0200
commitfaf83916ee62638e3eff60e68b4b7b36be2ddc05 (patch)
treebe32cdd101a4049a31f7bbdec461af70cc694713 /source4
parentd6130413965b53baa07b7b93c9b0d5199cff4437 (diff)
downloadsamba-faf83916ee62638e3eff60e68b4b7b36be2ddc05.tar.gz
samba-faf83916ee62638e3eff60e68b4b7b36be2ddc05.tar.bz2
samba-faf83916ee62638e3eff60e68b4b7b36be2ddc05.zip
Add option for generating coverage data from python tests.
(This used to be commit 43c0fdfff02021caef2d8f73d6bfdc4b051a65ef)
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/scripting/bin/subunitrun8
1 files changed, 8 insertions, 0 deletions
diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun
index 6f1086ad37..ee2d1e11da 100755
--- a/source4/scripting/bin/subunitrun
+++ b/source4/scripting/bin/subunitrun
@@ -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()