summaryrefslogtreecommitdiffstats
path: root/buildtools/wafsamba/samba_utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'buildtools/wafsamba/samba_utils.py')
-rw-r--r--buildtools/wafsamba/samba_utils.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 4588be9cd9..6cd7c8e048 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -386,7 +386,7 @@ def RUN_COMMAND(cmd,
return -1
-def RUN_PYTHON_TESTS(testfiles, pythonpath=None):
+def RUN_PYTHON_TESTS(testfiles, pythonpath=None, setup_cmd=None):
env = LOAD_ENVIRONMENT()
if pythonpath is None:
pythonpath = os.path.join(Utils.g_module.blddir, 'python')
@@ -394,6 +394,8 @@ def RUN_PYTHON_TESTS(testfiles, pythonpath=None):
for interp in env.python_interpreters:
for testfile in testfiles:
cmd = "PYTHONPATH=%s %s %s" % (pythonpath, interp, testfile)
+ if setup_cmd:
+ cmd = '%s ; %s' % (setup_cmd, cmd)
print('Running Python testwith %s: %s' % (interp, testfile))
ret = RUN_COMMAND(cmd)
if ret: