diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-12-09 15:35:51 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-12-10 03:04:06 +0100 |
commit | 069ff146cb13b5bb6655b9d47540ab5ea9f6183e (patch) | |
tree | 66a9a84d678a67c64acd4709799b80dda3318c02 | |
parent | a957d8c80f532654f502fdd37aecd34b231a00e8 (diff) | |
download | samba-069ff146cb13b5bb6655b9d47540ab5ea9f6183e.tar.gz samba-069ff146cb13b5bb6655b9d47540ab5ea9f6183e.tar.bz2 samba-069ff146cb13b5bb6655b9d47540ab5ea9f6183e.zip |
subunitrun: Support --list.
-rwxr-xr-x | source4/scripting/bin/subunitrun | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun index a6337e505b..72f6429188 100755 --- a/source4/scripting/bin/subunitrun +++ b/source4/scripting/bin/subunitrun @@ -22,7 +22,7 @@ import sys # Find right directory when running from source tree sys.path.insert(0, "bin/python") -from unittest import TestProgram +from subunit.run import TestProgram import optparse import samba samba.ensure_external_module("testtools", "testtools") @@ -35,10 +35,15 @@ from subunit.run import SubunitTestRunner parser = optparse.OptionParser("subunitrun [options] <tests>") credopts = options.CredentialsOptions(parser) parser.add_option_group(credopts) +parser.add_option('-l', '--list', dest='listtests', default=False, + help='List tests rather than running them.', + action="store_true") -args = parser.parse_args()[1] +opts, args = parser.parse_args() samba.tests.cmdline_credentials = credopts.get_credentials(samba.tests.env_loadparm()) +if opts.listtests: + args.insert(0, "--list") runner = SubunitTestRunner() -program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner) +program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner, stdout=sys.stdout) |