summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2011-11-13 21:51:53 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-11-14 15:49:36 +0100
commit38495995c924ce4339a0f4982e1a87ce8bcfe640 (patch)
tree3062e1d14db5a0c801e5a54f1f92874158f70fb9 /selftest
parent17c529a35ffe9f850403c80e25ccaada86d42625 (diff)
downloadsamba-38495995c924ce4339a0f4982e1a87ce8bcfe640.tar.gz
samba-38495995c924ce4339a0f4982e1a87ce8bcfe640.tar.bz2
samba-38495995c924ce4339a0f4982e1a87ce8bcfe640.zip
selftesthelpers: Cope with empty binary mappings list, simplify handling of perl.
Diffstat (limited to 'selftest')
-rw-r--r--selftest/selftesthelpers.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py
index c2f434896f..f4b032198b 100644
--- a/selftest/selftesthelpers.py
+++ b/selftest/selftesthelpers.py
@@ -40,13 +40,15 @@ def binpath(name):
binary_mapping_string = os.getenv("BINARY_MAPPING", None)
if binary_mapping_string is not None:
for binmapping_entry in binary_mapping_string.split(','):
- binmapping = binmapping_entry.split(':')
- binary_mapping[binmapping[0]] = binmapping[1]
+ try:
+ (from_path, to_path) = binmapping_entry.split(':', 1)
+ except ValueError:
+ continue
+ binary_mapping[from_path] = to_path
perl = os.getenv("PERL", "perl")
-perl = perl.split()
-if subprocess.call(perl + ["-e", "eval require Test::More;"]) == 0:
+if subprocess.call([perl, "-e", "eval require Test::More;"]) == 0:
has_perl_test_more = True
else:
has_perl_test_more = False
@@ -157,7 +159,7 @@ def planperltestsuite(name, path):
:param path: Path to the test runner
"""
if has_perl_test_more:
- plantestsuite(name, "none", "%s %s | %s" % (" ".join(perl), path, tap2subunit))
+ plantestsuite(name, "none", "%s %s | %s" % (perl, path, tap2subunit))
else:
skiptestsuite(name, "Test::More not available")