diff options
Diffstat (limited to 'test/helpers.lua')
-rw-r--r-- | test/helpers.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/helpers.lua b/test/helpers.lua index 25ab80bb50..ecf90869c4 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -212,6 +212,14 @@ local function check_cores(app) end end +local function which(exe) + local pipe = io.popen('which ' .. exe, 'r') + local ret = pipe:read('*a') + pipe:close() + assert(ret:sub(-1) == '\n') + return ret:sub(1, -2) +end + return { eq = eq, neq = neq, @@ -224,4 +232,5 @@ return { glob = glob, check_cores = check_cores, hasenv = hasenv, + which = which, } |