diff options
author | ZyX <kp-pav@yandex.ru> | 2017-03-17 10:57:19 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-03-19 14:13:21 +0300 |
commit | 0e9286a19ed51ba9a2d6bfd06432c90e36cad4bd (patch) | |
tree | 60ebcc8135631a28cec7ecc40b1094e0a2770e97 /test/helpers.lua | |
parent | 0320a58082f922b54cb36ce57064c07a9e781aa8 (diff) | |
download | rneovim-0e9286a19ed51ba9a2d6bfd06432c90e36cad4bd.tar.gz rneovim-0e9286a19ed51ba9a2d6bfd06432c90e36cad4bd.tar.bz2 rneovim-0e9286a19ed51ba9a2d6bfd06432c90e36cad4bd.zip |
tests: Fix CI failures
Diffstat (limited to 'test/helpers.lua')
-rw-r--r-- | test/helpers.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/helpers.lua b/test/helpers.lua index 6ee95a4396..be83ff314b 100644 --- a/test/helpers.lua +++ b/test/helpers.lua @@ -17,8 +17,8 @@ local function argss_to_cmd(...) if type(arg) == 'string' then cmd = cmd .. ' ' ..shell_quote(arg) else - for _, arg in ipairs(arg) do - cmd = cmd .. ' ' .. shell_quote(arg) + for _, subarg in ipairs(arg) do + cmd = cmd .. ' ' .. shell_quote(subarg) end end end @@ -257,6 +257,19 @@ local function which(exe) end end +local function repeated_popen_r(...) + for _ = 1, 10 do + local stream = popen_r(...) + local ret = stream:read('*a') + stream:close() + if ret then + return ret + end + end + print('ERROR: Failed to execute ' .. argss_to_cmd(...) .. ': nil return after 10 attempts') + return nil +end + return { eq = eq, neq = neq, @@ -273,4 +286,5 @@ return { argss_to_cmd = argss_to_cmd, popen_r = popen_r, popen_w = popen_w, + repeated_popen_r = repeated_popen_r, } |