From 42c859e4cc38f91a1236cd93eae9e9f9a1bc1e62 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Mon, 6 Oct 2014 03:01:40 -0400 Subject: 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 Signed-off-by: Allan McRae --- test/pacman/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test/pacman/util.py') 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): -- cgit v1.2.3