summaryrefslogtreecommitdiff
path: root/selftest/selftesthelpers.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-11-09 13:10:24 +1100
committerAndrew Tridgell <tridge@samba.org>2011-11-10 14:24:21 +1100
commitb0be72d5080aed3da3f33a45b72f88e90fbe3d13 (patch)
tree9ca101db98b42083bff3e6986a29a33c116b3775 /selftest/selftesthelpers.py
parentac0bba2ea18e2e9ac578a333a3b260951e4c976e (diff)
downloadsamba-b0be72d5080aed3da3f33a45b72f88e90fbe3d13.tar.gz
samba-b0be72d5080aed3da3f33a45b72f88e90fbe3d13.tar.bz2
samba-b0be72d5080aed3da3f33a45b72f88e90fbe3d13.zip
test: added directory option to planpythontestsuite()
Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
Diffstat (limited to 'selftest/selftesthelpers.py')
-rw-r--r--selftest/selftesthelpers.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 085c62c466..58a2f0f5d6 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -158,10 +158,17 @@ def planperltestsuite(name, path):
skiptestsuite(name, "Test::More not available")
-def planpythontestsuite(env, module):
+def planpythontestsuite(env, module, name=None, directory=None):
+
+ if name is None:
+ name = module
if has_system_subunit_run:
- plantestsuite_idlist(module, env, [python, "-m", "subunit.run", "$LISTOPT", module])
+ cmd = [python, "-m", "subunit.run", "$LISTOPT", module]
+ if directory is not None:
+ cmd.extend(['-D', directory])
+ plantestsuite_idlist(name, env, cmd)
else:
- plantestsuite_idlist(module, env, "PYTHONPATH=$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools %s -m subunit.run $LISTOPT %s" % (srcdir(), srcdir(), python, module))
-
-
+ cmd = "PYTHONPATH=$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools %s -m subunit.run $LISTOPT %s" % (srcdir(), srcdir(), python, module)
+ if directory is not None:
+ cmd += ' -D %s' % directory
+ plantestsuite_idlist(name, env, cmd)