summaryrefslogtreecommitdiff
path: root/selftest/selftesthelpers.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-11-10 13:59:21 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-11-10 23:37:04 +0100
commitd84ba4fc0a28b481229c57754deb3dcacf61ed93 (patch)
treef7b179264eb8378d4dcab0a4c2776292931a8b71 /selftest/selftesthelpers.py
parentf5d3e4572234ab28a95a35c87e7b56cf94ab1780 (diff)
downloadsamba-d84ba4fc0a28b481229c57754deb3dcacf61ed93.tar.gz
samba-d84ba4fc0a28b481229c57754deb3dcacf61ed93.tar.bz2
samba-d84ba4fc0a28b481229c57754deb3dcacf61ed93.zip
selftest: re-implement directory option for planpythontestsuite.
Diffstat (limited to 'selftest/selftesthelpers.py')
-rw-r--r--selftest/selftesthelpers.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index 085c62c466..c0b5d0d46c 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -158,10 +158,14 @@ def planperltestsuite(name, path):
skiptestsuite(name, "Test::More not available")
-def planpythontestsuite(env, module):
- if has_system_subunit_run:
- plantestsuite_idlist(module, env, [python, "-m", "subunit.run", "$LISTOPT", module])
- else:
- plantestsuite_idlist(module, env, "PYTHONPATH=$PYTHONPATH:%s/lib/subunit/python:%s/lib/testtools %s -m subunit.run $LISTOPT %s" % (srcdir(), srcdir(), python, module))
-
-
+def planpythontestsuite(env, module, name=None, directory=None):
+ pypath = []
+ if not has_system_subunit_run:
+ pypath.extend(["%s/lib/subunit/python" % srcdir(),
+ "%s/lib/testtools" % srcdir()])
+ if directory is not None:
+ pypath.append(directory)
+ args = [python, "-m", "subunit.run", "$LISTOPT", module]
+ if pypath:
+ args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath]))
+ plantestsuite_idlist(name, env, args)