]> git.samba.org - mat/samba.git/blobdiff - selftest/selftesthelpers.py
selftesthelpers: Revert perl changes, add comment on why the original code was necessary.
[mat/samba.git] / selftest / selftesthelpers.py
index f4b032198be947bcd28ceee6c158fa15db83b516..0cfcb69a04061c3666a1ef05d5f8c7e87aec157e 100644 (file)
@@ -46,9 +46,10 @@ if binary_mapping_string is not None:
             continue
         binary_mapping[from_path] = to_path
 
-perl = os.getenv("PERL", "perl")
+# 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:
+if subprocess.call(perl + ["-e", "eval require Test::More;"]) == 0:
     has_perl_test_more = True
 else:
     has_perl_test_more = False
@@ -159,7 +160,7 @@ def planperltestsuite(name, path):
     :param path: Path to the test runner
     """
     if has_perl_test_more:
-        plantestsuite(name, "none", "%s %s | %s" % (perl, path, tap2subunit))
+        plantestsuite(name, "none", "%s %s | %s" % (" ".join(perl), path, tap2subunit))
     else:
         skiptestsuite(name, "Test::More not available")