def bindir():
return os.path.normpath(os.getenv("BINDIR", "./bin"))
+binary_mapping = {}
+
def binpath(name):
+ if name in binary_mapping:
+ name = binary_mapping[name]
return os.path.join(bindir(), "%s%s" % (name, os.getenv("EXEEXT", "")))
-perl = os.getenv("PERL", "perl")
-perl = perl.split()
+binary_mapping_string = os.getenv("BINARY_MAPPING", None)
+if binary_mapping_string is not None:
+ for binmapping_entry in binary_mapping_string.split(','):
+ try:
+ (from_path, to_path) = binmapping_entry.split(':', 1)
+ except ValueError:
+ continue
+ binary_mapping[from_path] = to_path
+
+# Split perl variable to allow $PERL to be set to e.g. "perl -W"
+perl = os.getenv("PERL", "perl").split()
if subprocess.call(perl + ["-e", "eval require Test::More;"]) == 0:
has_perl_test_more = True
def plantestsuite_idlist(name, env, cmdline):
print "-- TEST-IDLIST --"
- print name
+ if env == "none":
+ fullname = name
+ else:
+ fullname = "%s(%s)" % (name, env)
+ print fullname
print env
if isinstance(cmdline, list):
cmdline = " ".join(cmdline)
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, extra_path=[]):
+ if name is None:
+ name = module
+ pypath = list(extra_path)
+ if not has_system_subunit_run:
+ pypath.extend(["%s/lib/subunit/python" % srcdir(),
+ "%s/lib/testtools" % srcdir()])
+ args = [python, "-m", "subunit.run", "$LISTOPT", module]
+ if pypath:
+ args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath))
+ plantestsuite_idlist(name, env, args)