From ac0bba2ea18e2e9ac578a333a3b260951e4c976e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 9 Nov 2011 13:10:00 +1100 Subject: [PATCH] test: added -D option to subunitrun this allows for: subunitrun -D lib/ldb/tests/python api which makes this easier for developers --- source4/scripting/bin/subunitrun | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source4/scripting/bin/subunitrun b/source4/scripting/bin/subunitrun index 9c87d2eca3..9b3c315d2c 100755 --- a/source4/scripting/bin/subunitrun +++ b/source4/scripting/bin/subunitrun @@ -56,6 +56,8 @@ credopts = options.CredentialsOptions(parser) sambaopts = options.SambaOptions(parser) parser.add_option_group(credopts) parser.add_option_group(sambaopts) +parser.add_option('-D', '--directory', dest='directory', default=None, + help='set test directory') try: from subunit.run import TestProgram except ImportError: @@ -72,5 +74,8 @@ samba.tests.cmdline_credentials = credopts.get_credentials(lp) if getattr(opts, "listtests", False): args.insert(0, "--list") +if opts.directory: + sys.path.append(opts.directory) + runner = SubunitTestRunner() program = TestProgram(module=None, argv=[sys.argv[0]] + args, testRunner=runner) -- 2.34.1