summaryrefslogtreecommitdiff
path: root/test/pacman/util.py
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2014-10-06 03:01:40 -0400
committerAllan McRae <allan@archlinux.org>2014-10-13 12:54:29 +1000
commit42c859e4cc38f91a1236cd93eae9e9f9a1bc1e62 (patch)
tree23ddd2d78b3fbe4ce2cfed46e7c47f6c9acb91ec /test/pacman/util.py
parent01beca5df717252c7c9aa59bc705dc10a25ebdc8 (diff)
downloadpacman-42c859e4cc38f91a1236cd93eae9e9f9a1bc1e62.tar.xz
pmtest: allow tests to specify test binary
Adds a cmd property to tests (defaults to pacman) which is resolved using directories specified with --bindir (defaults to PATH). The ability to manually specify a particular binary is preserved in order to allow running individual tests with differently named binaries such as lt-pacman. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'test/pacman/util.py')
-rw-r--r--test/pacman/util.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/pacman/util.py b/test/pacman/util.py
index 57471fe8..ae96a3b7 100644
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -157,8 +157,9 @@ def mkmd5sum(data):
# Miscellaneous
#
-def which(filename):
- path = os.environ["PATH"].split(':')
+def which(filename, path=None):
+ if not path:
+ path = os.environ["PATH"].split(os.pathsep)
for p in path:
f = os.path.join(p, filename)
if os.access(f, os.F_OK):