From 9400466282918396c814ef456d0f65dca51b8889 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sat, 11 Mar 2017 13:28:18 +0300 Subject: unittests: Check core dumps in after_each, like in functests --- test/helpers.lua | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/helpers.lua') 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, } -- cgit